Antlr4.Tool.Rule.ResolveToAttribute C# (CSharp) Method

ResolveToAttribute() public method

public ResolveToAttribute ( string x, ActionAST node ) : Attribute
x string
node Antlr4.Tool.Ast.ActionAST
return Attribute
        public virtual Attribute ResolveToAttribute(string x, ActionAST node)
        {
            if (args != null)
            {
                Attribute a = args.Get(x);
                if (a != null)
                    return a;
            }
            if (retvals != null)
            {
                Attribute a = retvals.Get(x);
                if (a != null)
                    return a;
            }
            if (locals != null)
            {
                Attribute a = locals.Get(x);
                if (a != null)
                    return a;
            }
            AttributeDict properties = GetPredefinedScope(LabelType.RULE_LABEL);
            return properties.Get(x);
        }

Same methods

Rule::ResolveToAttribute ( string x, string y, ActionAST node ) : Attribute

Usage Example

Example #1
0
 /**  $x		Attribute: rule arguments, return values, predefined rule prop.
  */
 public virtual Attribute ResolveToAttribute(string x, ActionAST node)
 {
     return(rule.ResolveToAttribute(x, node)); // reuse that code
 }