Package org.antlr.v4.automata

Examples of org.antlr.v4.automata.ParserATNFactory


  @Override
  public List<SrcOp> sempred(ActionAST ast) { return list(new SemPred(this, ast)); }

  @Override
  public List<SrcOp> ruleRef(GrammarAST ID, GrammarAST label, GrammarAST args) {
    InvokeRule invokeOp = new InvokeRule(this, ID, label);
    // If no manual label and action refs as token/rule not label, we need to define implicit label
    if ( controller.needsImplicitLabel(ID, invokeOp) ) defineImplicitLabel(ID, invokeOp);
    AddToLabelList listLabelOp = getAddToListOpIfListLabelPresent(invokeOp, label);
    return list(invokeOp, listLabelOp);
  }
View Full Code Here


    return getComplexEBNFBlock(ebnfRoot, alts);
  }

  @Override
  public Choice getLL1ChoiceBlock(BlockAST blkAST, List<CodeBlockForAlt> alts) {
    return new LL1AltBlock(this, blkAST, alts);
  }
View Full Code Here

    if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType();
    Choice c = null;
    switch ( ebnf ) {
      case ANTLRParser.OPTIONAL :
        if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts);
        else c = new LL1OptionalBlock(this, ebnfRoot, alts);
        break;
      case ANTLRParser.CLOSURE :
        if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
        break;
View Full Code Here

    int ebnf = 0;
    if ( ebnfRoot!=null ) ebnf = ebnfRoot.getType();
    Choice c = null;
    switch ( ebnf ) {
      case ANTLRParser.OPTIONAL :
        if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts);
        else c = new LL1OptionalBlock(this, ebnfRoot, alts);
        break;
      case ANTLRParser.CLOSURE :
        if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
View Full Code Here

      case ANTLRParser.CLOSURE :
        if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
        break;
      case ANTLRParser.POSITIVE_CLOSURE :
        if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
        break;
    }
    return c;
  }
View Full Code Here

      case ANTLRParser.OPTIONAL :
        if ( alts.size()==1 ) c = new LL1OptionalBlockSingleAlt(this, ebnfRoot, alts);
        else c = new LL1OptionalBlock(this, ebnfRoot, alts);
        break;
      case ANTLRParser.CLOSURE :
        if ( alts.size()==1 ) c = new LL1StarBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
        break;
      case ANTLRParser.POSITIVE_CLOSURE :
        if ( alts.size()==1 ) c = new LL1PlusBlockSingleAlt(this, ebnfRoot, alts);
        else c = getComplexEBNFBlock(ebnfRoot, alts);
View Full Code Here

  }

  @Override
  public RuleFunction rule(Rule r) {
    if ( r instanceof LeftRecursiveRule ) {
      return new LeftRecursiveRuleFunction(this, (LeftRecursiveRule)r);
    }
    else {
      RuleFunction rf = new RuleFunction(this, r);
      return rf;
    }
View Full Code Here

  }

  @Override
  public List<SrcOp> set(GrammarAST setAST, GrammarAST labelAST, boolean invert) {
    MatchSet matchOp;
    if ( invert ) matchOp = new MatchNotSet(this, setAST);
    else matchOp = new MatchSet(this, setAST);
    if ( labelAST!=null ) {
      String label = labelAST.getText();
      RuleFunction rf = getCurrentRuleFunction();
      if ( labelAST.parent.getType() == ANTLRParser.PLUS_ASSIGN ) {
View Full Code Here

    return new TokenListDecl(this, gen.getTarget().getListLabel(label));
  }

  @Override
  public List<SrcOp> set(GrammarAST setAST, GrammarAST labelAST, boolean invert) {
    MatchSet matchOp;
    if ( invert ) matchOp = new MatchNotSet(this, setAST);
    else matchOp = new MatchSet(this, setAST);
    if ( labelAST!=null ) {
      String label = labelAST.getText();
      RuleFunction rf = getCurrentRuleFunction();
      if ( labelAST.parent.getType() == ANTLRParser.PLUS_ASSIGN ) {
        defineImplicitLabel(setAST, matchOp);
View Full Code Here

    return list(invokeOp, listLabelOp);
  }

  @Override
  public List<SrcOp> tokenRef(GrammarAST ID, GrammarAST labelAST, GrammarAST args) {
    MatchToken matchOp = new MatchToken(this, (TerminalAST) ID);
    if ( labelAST!=null ) {
      String label = labelAST.getText();
      RuleFunction rf = getCurrentRuleFunction();
      if ( labelAST.parent.getType() == ANTLRParser.PLUS_ASSIGN ) {
        // add Token _X and List<Token> X decls
View Full Code Here

TOP

Related Classes of org.antlr.v4.automata.ParserATNFactory

Copyright © 2018 www.massapicom. 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.