Class Alternative

    • Field Detail

      • rule

        public Rule rule
      • altNum

        public int altNum
        What alternative number is this outermost alt? 1..n
      • tokenRefs

        public <any> tokenRefs
      • tokenRefsInActions

        public <any> tokenRefsInActions
      • ruleRefs

        public <any> ruleRefs
      • ruleRefsInActions

        public <any> ruleRefsInActions
      • labelDefs

        public <any> labelDefs
        A list of all LabelElementPair attached to tokens like id=ID, ids+=ID
      • actions

        public List<ActionAST> actions
        Track all executable actions other than named actions like @init and catch/finally (not in an alt). Also tracks predicates, rewrite actions. We need to examine these actions before code generation so that we can detect refs to $rule.attr etc... This tracks per alt
    • Constructor Detail

      • Alternative

        public Alternative(Rule r,
                           int altNum)
    • Method Detail

      • resolvesToToken

        public boolean resolvesToToken(String x,
                                       ActionAST node)
      • resolvesToAttributeDict

        public boolean resolvesToAttributeDict(String x,
                                               ActionAST node)
      • resolveToAttribute

        public Attribute resolveToAttribute(String x,
                                            ActionAST node)
        $x Attribute: rule arguments, return values, predefined rule prop.
      • resolveToAttribute

        public Attribute resolveToAttribute(String x,
                                            String y,
                                            ActionAST node)
        $x.y, x can be surrounding rule, token/rule/label ref. y is visible attr in that dictionary. Can't see args on rule refs.
      • resolvesToLabel

        public boolean resolvesToLabel(String x,
                                       ActionAST node)
      • resolvesToListLabel

        public boolean resolvesToListLabel(String x,
                                           ActionAST node)
      • resolveToRule

        public Rule resolveToRule(String x)
        x can be ruleref or rule label.