Examples of RangeTransition


Examples of org.antlr.v4.runtime.atn.RangeTransition

  public Handle range(GrammarAST a, GrammarAST b) {
    ATNState left = newState(a);
    ATNState right = newState(b);
    int t1 = CharSupport.getCharValueFromGrammarCharLiteral(a.getText());
    int t2 = CharSupport.getCharValueFromGrammarCharLiteral(b.getText());
    left.addTransition(new  RangeTransition(right, t1, t2));
    a.atnState = left;
    b.atnState = left;
    return new Handle(left, right);
  }
View Full Code Here

Examples of org.antlr.v4.runtime.atn.RangeTransition

    }
    else {
      Transition transition;
      if (set.getIntervals().size() == 1) {
        Interval interval = set.getIntervals().get(0);
        transition = new RangeTransition(right, interval.a, interval.b);
      } else {
        transition = new SetTransition(right, set);
      }

      left.addTransition(transition);
View Full Code Here

Examples of org.antlr.v4.runtime.atn.RangeTransition

          if ( edge instanceof NotSetTransition ) label = "~"+label;
          edgeST.add("label", getEdgeLabel(label));
        }
        else if ( edge instanceof RangeTransition ) {
          edgeST = stlib.getInstanceOf("edge");
          RangeTransition range = (RangeTransition)edge;
          String label = range.label().toString();
          if ( isLexer ) label = range.toString();
          else if ( grammar!=null ) label = range.label().toString(grammar.getVocabulary());
          edgeST.add("label", getEdgeLabel(label));
        }
        else {
          edgeST = stlib.getInstanceOf("edge");
          edgeST.add("label", getEdgeLabel(edge.toString()));
View Full Code Here

Examples of org.antlr.v4.runtime.atn.RangeTransition

        if (matchSet.getIntervals().size() == 1) {
          if (matchSet.size() == 1) {
            newTransition = new AtomTransition(blockEndState, matchSet.getMinElement());
          } else {
            Interval matchInterval = matchSet.getIntervals().get(0);
            newTransition = new RangeTransition(blockEndState, matchInterval.a, matchInterval.b);
          }
        } else {
          newTransition = new SetTransition(blockEndState, matchSet);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.