This class contains profiling gathered for a particular decision.
This class contains profiling gathered for a particular decision.

Parsing performance in ANTLR 4 is heavily influenced by both static factors (e.g. the form of the rules in the grammar) and dynamic factors (e.g. the choice of input and the state of the DFA cache at the time profiling operations are started). For best results, gather and use aggregate statistics from a large sample of inputs representing the inputs expected in production before using the results to make changes in the grammar.

Example #1
0
 public ProfilingATNSimulator(Parser parser)
     : base(parser, parser.Interpreter.atn)
 {
     optimize_ll1      = false;
     reportAmbiguities = true;
     numDecisions      = atn.decisionToState.Count;
     decisions         = new Antlr4.Runtime.Atn.DecisionInfo[numDecisions];
     for (int i = 0; i < numDecisions; i++)
     {
         decisions[i] = new Antlr4.Runtime.Atn.DecisionInfo(i);
     }
 }
 public ProfilingATNSimulator(Parser parser)
     : base(parser, parser.Interpreter.atn)
 {
     optimize_ll1 = false;
     reportAmbiguities = true;
     numDecisions = atn.decisionToState.Count;
     decisions = new Antlr4.Runtime.Atn.DecisionInfo[numDecisions];
     for (int i = 0; i < numDecisions; i++)
     {
         decisions[i] = new Antlr4.Runtime.Atn.DecisionInfo(i);
     }
 }
Example #3
0
        public ProfilingATNSimulator(Parser parser)
            : base(parser,
				parser.Interpreter.atn,
				parser.Interpreter.decisionToDFA,
			   parser.Interpreter.getSharedContextCache())
        {
            numDecisions = atn.decisionToState.Count;
            decisions = new DecisionInfo[numDecisions];
            for (int i = 0; i < numDecisions; i++)
            {
            decisions[i] = new DecisionInfo(i);
            }
        }
Example #4
0
        public ProfilingATNSimulator(Parser parser)

            : base(parser,
                   parser.Interpreter.atn,
                   parser.Interpreter.decisionToDFA,
                   parser.Interpreter.getSharedContextCache())
        {
            numDecisions = atn.decisionToState.Count;
            decisions    = new DecisionInfo[numDecisions];
            for (int i = 0; i < numDecisions; i++)
            {
                decisions[i] = new DecisionInfo(i);
            }
        }