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

ResolveToAttribute() public method

public ResolveToAttribute ( string x, string y, ActionAST node ) : Attribute
x string
y string
node Antlr4.Tool.Ast.ActionAST
return Attribute
        public virtual Attribute ResolveToAttribute(string x, string y, ActionAST node)
        {
            LabelElementPair anyLabelDef = GetAnyLabelDef(x);
            if (anyLabelDef != null)
            {
                if (anyLabelDef.type == LabelType.RULE_LABEL)
                {
                    return g.GetRule(anyLabelDef.element.Text).ResolveRetvalOrProperty(y);
                }
                else
                {
                    AttributeDict scope = GetPredefinedScope(anyLabelDef.type);
                    if (scope == null)
                    {
                        return null;
                    }

                    return scope.Get(y);
                }
            }
            return null;

        }

Same methods

Rule::ResolveToAttribute ( string x, 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
 }