Exemple #1
0
 public ParserInterpreter(string grammarFileName, IVocabulary vocabulary, IEnumerable<string> ruleNames, ATN atn, ITokenStream input)
     : base(input)
 {
     this._grammarFileName = grammarFileName;
     this._atn = atn;
     this._ruleNames = ruleNames.ToArray();
     this.vocabulary = vocabulary;
     // identify the ATN states where pushNewRecursionContext must be called
     this.pushRecursionContextStates = new BitSet(atn.states.Count);
     foreach (ATNState state in atn.states)
     {
         if (!(state is StarLoopEntryState))
         {
             continue;
         }
         if (((StarLoopEntryState)state).isPrecedenceDecision)
         {
             this.pushRecursionContextStates.Set(state.stateNumber);
         }
     }
     // get atn simulator that knows how to do predictions
     Interpreter = new ParserATNSimulator(this, atn, null, null);
 }
	public BinShredParser(ITokenStream input)
		: base(input)
	{
		Interpreter = new ParserATNSimulator(this,_ATN);
	}
Exemple #3
0
	public VBGrammarParser(ITokenStream input)
		: base(input)
	{
		Interpreter = new ParserATNSimulator(this,_ATN);
	}
	public TortoiseParser(ITokenStream input)
		: base(input)
	{
		Interpreter = new ParserATNSimulator(this,_ATN);
	}
	public SymbolicStringsParser(ITokenStream input)
		: base(input)
	{
		Interpreter = new ParserATNSimulator(this,_ATN);
	}
Exemple #6
0
	public NCalc2Parser(ITokenStream input)
		: base(input)
	{
		_interp = new ParserATNSimulator(this,_ATN);
	}
        public ParserInterpreter(string grammarFileName, IVocabulary vocabulary, IEnumerable<string> ruleNames, ATN atn, ITokenStream input)
            : base(input)
        {
            this.grammarFileName = grammarFileName;
            this.atn = atn;
#pragma warning disable 612 // Type or member is obsolete
            this.tokenNames = new string[atn.maxTokenType];
            for (int i = 0; i < tokenNames.Length; i++)
            {
                tokenNames[i] = vocabulary.GetDisplayName(i);
            }
#pragma warning restore 612 // Type or member is obsolete
            this.ruleNames = ruleNames.ToArray();
            this.vocabulary = vocabulary;
            // identify the ATN states where pushNewRecursionContext() must be called
            this.pushRecursionContextStates = new BitSet(atn.states.Count);
            foreach (ATNState state in atn.states)
            {
                if (!(state is StarLoopEntryState))
                {
                    continue;
                }
                if (((StarLoopEntryState)state).precedenceRuleDecision)
                {
                    this.pushRecursionContextStates.Set(state.stateNumber);
                }
            }
            // get atn simulator that knows how to do predictions
            Interpreter = new ParserATNSimulator(this, atn);
        }
        /// <summary>
        /// A copy constructor that creates a new parser interpreter by reusing
        /// the fields of a previous interpreter.
        /// </summary>
        /// <param name="old">The interpreter to copy</param>
        /// <since>4.5</since>
        public ParserInterpreter(Antlr4.Runtime.ParserInterpreter old)
            : base(((ITokenStream)old.InputStream))
        {
            // latch and only override once; error might trigger infinite loop
            this.grammarFileName = old.grammarFileName;
            this.atn = old.atn;
            this.pushRecursionContextStates = old.pushRecursionContextStates;
#pragma warning disable 612 // Type or member is obsolete
            this.tokenNames = old.tokenNames;
#pragma warning restore 612 // Type or member is obsolete
            this.ruleNames = old.ruleNames;
            this.vocabulary = old.vocabulary;
            Interpreter = new ParserATNSimulator(this, atn);
        }
 /// <summary>
 /// A copy constructor that creates a new parser interpreter by reusing
 /// the fields of a previous interpreter.
 /// </summary>
 /// <remarks>
 /// A copy constructor that creates a new parser interpreter by reusing
 /// the fields of a previous interpreter.
 /// </remarks>
 /// <param name="old">The interpreter to copy</param>
 /// <since>4.5</since>
 public ParserInterpreter(Antlr4.Runtime.ParserInterpreter old)
     : base(((ITokenStream)old.InputStream))
 {
     this.grammarFileName = old.grammarFileName;
     this.atn = old.atn;
     this.pushRecursionContextStates = old.pushRecursionContextStates;
     this.tokenNames = old.tokenNames;
     this.ruleNames = old.ruleNames;
     this.vocabulary = old.vocabulary;
     Interpreter = new ParserATNSimulator(this, atn);
 }
	public PropositionalCalculusParser(ITokenStream input)
		: base(input)
	{
		Interpreter = new ParserATNSimulator(this,_ATN);
	}