Inheritance: AttributeResolver
コード例 #1
0
 public LeftRecursiveRule(Grammar g, string name, RuleAST ast)
     : base(g, name, ast, 1)
 {
     originalAST = ast;
     alt = new Alternative[numberOfAlts + 1]; // always just one
     for (int i = 1; i <= numberOfAlts; i++)
         alt[i] = new Alternative(this, i);
 }
コード例 #2
0
ファイル: ActionSniffer.cs プロジェクト: sharwell/antlr4cs
 public ActionSniffer(Grammar g, Rule r, Alternative alt, ActionAST node, IToken actionToken)
 {
     this.g = g;
     this.r = r;
     this.alt = alt;
     this.node = node;
     this.actionToken = actionToken;
     this.errMgr = g.tool.errMgr;
 }
コード例 #3
0
 public virtual CodeBlockForAlt Epsilon(Alternative alt, bool outerMost)
 {
     return null;
 }
コード例 #4
0
 public CodeBlockForOuterMostAlt(OutputModelFactory factory, Alternative alt)
     : base(factory)
 {
     this.alt = alt;
     altLabel = alt.ast.altLabel != null ? alt.ast.altLabel.Text : null;
 }
コード例 #5
0
ファイル: Rule.cs プロジェクト: sharwell/antlr4cs
        public int actionIndex = -1; // if lexer; 0..n-1 for n actions in a rule

        public Rule(Grammar g, string name, RuleAST ast, int numberOfAlts)
        {
            this.g = g;
            this.name = name;
            this.ast = ast;
            this.numberOfAlts = numberOfAlts;
            alt = new Alternative[numberOfAlts + 1]; // 1..n
            for (int i = 1; i <= numberOfAlts; i++)
                alt[i] = new Alternative(this, i);
        }
コード例 #6
0
 public virtual void SetCurrentOuterMostAlt(Alternative currentOuterMostAlt)
 {
     this.currentOuterMostAlt = currentOuterMostAlt;
 }
コード例 #7
0
 public virtual CodeBlockForAlt Epsilon(Alternative alt, bool outerMost)
 {
     CodeBlockForAlt blk = @delegate.Epsilon(alt, outerMost);
     foreach (CodeGeneratorExtension ext in extensions)
         blk = ext.Epsilon(blk);
     return blk;
 }
コード例 #8
0
 public virtual CodeBlockForAlt Alternative(Alternative alt, bool outerMost)
 {
     CodeBlockForAlt blk = @delegate.Alternative(alt, outerMost);
     if (outerMost)
     {
         currentOuterMostAlternativeBlock = (CodeBlockForOuterMostAlt)blk;
     }
     foreach (CodeGeneratorExtension ext in extensions)
         blk = ext.Alternative(blk, outerMost);
     return blk;
 }
コード例 #9
0
ファイル: ParserFactory.cs プロジェクト: sharwell/antlr4cs
 public override CodeBlockForAlt Alternative(Alternative alt, bool outerMost)
 {
     if (outerMost)
         return new CodeBlockForOuterMostAlt(this, alt);
     return new CodeBlockForAlt(this);
 }
コード例 #10
0
ファイル: ParserFactory.cs プロジェクト: sharwell/antlr4cs
 public override CodeBlockForAlt Epsilon(Alternative alt, bool outerMost)
 {
     return Alternative(alt, outerMost);
 }