Package antlr

Examples of antlr.ASTFactory.create()


  }

  public static void main(String[] paramArrayOfString)
  {
    ASTFactory localASTFactory = new ASTFactory();
    CommonAST localCommonAST = (CommonAST)localASTFactory.create(0, "ROOT");
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C1"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C2"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C3"));
    ASTFrame localASTFrame = new ASTFrame("AST JTree Example", localCommonAST);
    localASTFrame.setVisible(true);
View Full Code Here


  public static void main(String[] paramArrayOfString)
  {
    ASTFactory localASTFactory = new ASTFactory();
    CommonAST localCommonAST = (CommonAST)localASTFactory.create(0, "ROOT");
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C1"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C2"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C3"));
    ASTFrame localASTFrame = new ASTFrame("AST JTree Example", localCommonAST);
    localASTFrame.setVisible(true);
  }
View Full Code Here

  public static void main(String[] paramArrayOfString)
  {
    ASTFactory localASTFactory = new ASTFactory();
    CommonAST localCommonAST = (CommonAST)localASTFactory.create(0, "ROOT");
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C1"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C2"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C3"));
    ASTFrame localASTFrame = new ASTFrame("AST JTree Example", localCommonAST);
    localASTFrame.setVisible(true);
  }
View Full Code Here

  {
    ASTFactory localASTFactory = new ASTFactory();
    CommonAST localCommonAST = (CommonAST)localASTFactory.create(0, "ROOT");
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C1"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C2"));
    localCommonAST.addChild((CommonAST)localASTFactory.create(0, "C3"));
    ASTFrame localASTFrame = new ASTFrame("AST JTree Example", localCommonAST);
    localASTFrame.setVisible(true);
  }

  class MyTreeSelectionListener
View Full Code Here

          throw new QueryException( "collection of values in filter: this" );
        }

        String collectionElementEntityName = persister.getElementPersister().getEntityName();
        ASTFactory inputAstFactory = hqlParser.getASTFactory();
        AST fromElement = inputAstFactory.create( HqlTokenTypes.FILTER_ENTITY, collectionElementEntityName );
        ASTUtil.createSibling( inputAstFactory, HqlTokenTypes.ALIAS, "this", fromElement );
        fromClauseInput.addChild( fromElement );
        // Show the modified AST.
        LOG.debug( "prepareFromClauseInputTree() : Filter - Added 'this' as a from element..." );
        queryTranslatorImpl.showHqlAst( hqlParser.getAST() );
View Full Code Here

    private static DetailAST createArtificialTreeRoot()
    {
        ASTFactory factory = new ASTFactory();
        factory.setASTNodeClass(DetailAST.class.getName());
        // TODO: Need to resolve if need a fake root node....
        return (DetailAST) factory.create(TokenTypes.EOF, "ROOT");
    }

    void setParseTree(DetailAST parseTree)
    {
        DetailAST root = (DetailAST) getRoot();
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.