Package antlr

Examples of antlr.ASTFactory.create()


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

        String collectionElementEntityName = persister.getElementPersister().getEntityName();
        ASTFactory inputAstFactory = hqlParser.getASTFactory();
        AST fromElement = inputAstFactory.create( FILTER_ENTITY, collectionElementEntityName );
        ASTUtil.createSibling( inputAstFactory, HqlTokenTypes.ALIAS, "this", fromElement );
        fromClauseInput.addChild( fromElement );
        // Show the modified AST.
        if ( log.isDebugEnabled() ) {
          log.debug( "prepareFromClauseInputTree() : Filter - Added 'this' as a from element..." );
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

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

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

    public static void doTreeAction(String f, AST t, String[] tokenNames) {
        if ( t==null ) return;
        if ( showTree ) {
            CommonAST.setVerboseStringConversion(true, tokenNames);
            ASTFactory factory = new ASTFactory();
            AST r = factory.create(0,"AST ROOT");
            r.setFirstChild(t);
            final ASTFrame frame = new ASTFrame("Groovy AST", r);
            frame.setVisible(true);
            frame.addWindowListener(
                new WindowAdapter() {
View Full Code Here

    public void doTreeAction(String f, AST t, String[] tokenNames) {
      if ( t==null ) return;
      if ( showTree ) {
         ((CommonAST)t).setVerboseStringConversion(true, tokenNames);
         ASTFactory factory = new ASTFactory();
         AST r = factory.create(0,"AST ROOT");
         r.setFirstChild(t);
         ASTFrame frame = new ASTFrame("Pascal AST", r);
         frame.setVisible(true);
         //System.out.println(t.toStringList());
      }
View Full Code Here

    private static DetailAST createArtificialTreeRoot()
    {
        final 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)
    {
        final DetailAST root = (DetailAST) getRoot();
View Full Code Here

    private static DetailAST createArtificialTreeRoot()
    {
        final 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)
    {
        final DetailAST root = (DetailAST) getRoot();
View Full Code Here

  public static void doTreeAction(String f, AST t, String[] tokenNames) {
    if ( t==null ) return;
    if ( showTree ) {
      CommonAST.setVerboseStringConversion(true, tokenNames);
      ASTFactory factory = new ASTFactory();
      AST r = factory.create(0,"AST ROOT");
      r.setFirstChild(t);
      final ASTFrame frame = new ASTFrame("Groovy AST", r);
      frame.setVisible(true);
      frame.addWindowListener(
        new WindowAdapter() {
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( FILTER_ENTITY, collectionElementEntityName );
        ASTUtil.createSibling( inputAstFactory, HqlTokenTypes.ALIAS, "this", fromElement );
        fromClauseInput.addChild( fromElement );
        // Show the modified AST.
        if ( log.isDebugEnabled() ) {
          log.debug( "prepareFromClauseInputTree() : Filter - Added 'this' as a from element..." );
View Full Code Here

        if (mXPath != null) {
            final ASTFactory factory = new ASTFactory();
            factory.setASTNodeType(DetailAST.class.getName());
            // TODO: Need to resolve if need a fake root node....
            final DetailAST root =
                (DetailAST) factory.create(TokenTypes.EOF, "ROOT");
            root.setFirstChild(aAST);
            try {
                final Iterator it = mXPath.selectNodes(aAST).iterator();
                while (it.hasNext()) {
                    final DetailAST node = (DetailAST) it.next();
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.