Package antlr

Examples of antlr.TokenStreamRewriteEngine.discard()


    ANTLRLexer lexer = new ANTLRLexer(new StringReader(matchTokenRuleST.toString()));
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.setGrammar(this);
View Full Code Here


    ANTLRLexer lexer = new ANTLRLexer(new StringReader(matchTokenRuleST.toString()));
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.setGrammar(this);
    parser.setGtype(ANTLRParser.LEXER_GRAMMAR);
View Full Code Here

    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.setGrammar(this);
    parser.setGtype(ANTLRParser.LEXER_GRAMMAR);
    parser.setASTNodeClass("org.antlr.tool.GrammarAST");
View Full Code Here

    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.setGrammar(this);
    parser.setGtype(ANTLRParser.LEXER_GRAMMAR);
    parser.setASTNodeClass("org.antlr.tool.GrammarAST");
    try {
View Full Code Here

    //System.out.println("translate template: "+templateActionText);
    org.antlr.grammar.v2.ANTLRLexer lexer = new org.antlr.grammar.v2.ANTLRLexer(new StringReader(templateActionText));
    lexer.setFilename(grammar.getFileName());
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokenBuffer = new TokenStreamRewriteEngine(lexer);
    tokenBuffer.discard(ANTLRParser.WS);
    tokenBuffer.discard(ANTLRParser.ML_COMMENT);
    tokenBuffer.discard(ANTLRParser.COMMENT);
    tokenBuffer.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokenBuffer);
    parser.setFilename(grammar.getFileName());
View Full Code Here

    org.antlr.grammar.v2.ANTLRLexer lexer = new org.antlr.grammar.v2.ANTLRLexer(new StringReader(templateActionText));
    lexer.setFilename(grammar.getFileName());
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokenBuffer = new TokenStreamRewriteEngine(lexer);
    tokenBuffer.discard(ANTLRParser.WS);
    tokenBuffer.discard(ANTLRParser.ML_COMMENT);
    tokenBuffer.discard(ANTLRParser.COMMENT);
    tokenBuffer.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokenBuffer);
    parser.setFilename(grammar.getFileName());
    parser.setASTNodeClass("org.antlr.tool.GrammarAST");
View Full Code Here

    lexer.setFilename(grammar.getFileName());
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokenBuffer = new TokenStreamRewriteEngine(lexer);
    tokenBuffer.discard(ANTLRParser.WS);
    tokenBuffer.discard(ANTLRParser.ML_COMMENT);
    tokenBuffer.discard(ANTLRParser.COMMENT);
    tokenBuffer.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokenBuffer);
    parser.setFilename(grammar.getFileName());
    parser.setASTNodeClass("org.antlr.tool.GrammarAST");
    try {
View Full Code Here

    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokenBuffer = new TokenStreamRewriteEngine(lexer);
    tokenBuffer.discard(ANTLRParser.WS);
    tokenBuffer.discard(ANTLRParser.ML_COMMENT);
    tokenBuffer.discard(ANTLRParser.COMMENT);
    tokenBuffer.discard(ANTLRParser.SL_COMMENT);
    ANTLRParser parser = new ANTLRParser(tokenBuffer);
    parser.setFilename(grammar.getFileName());
    parser.setASTNodeClass("org.antlr.tool.GrammarAST");
    try {
      parser.rewrite_template();
View Full Code Here

        ANTLRLexer lexer = new ANTLRLexer(new StringReader(matchTokenRuleST.toString()));
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
        ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.grammar = this;
View Full Code Here

        ANTLRLexer lexer = new ANTLRLexer(new StringReader(matchTokenRuleST.toString()));
    lexer.setTokenObjectClass("antlr.TokenWithIndex");
    TokenStreamRewriteEngine tokbuf =
      new TokenStreamRewriteEngine(lexer);
    tokbuf.discard(ANTLRParser.WS);
    tokbuf.discard(ANTLRParser.ML_COMMENT);
    tokbuf.discard(ANTLRParser.COMMENT);
    tokbuf.discard(ANTLRParser.SL_COMMENT);
        ANTLRParser parser = new ANTLRParser(tokbuf);
    parser.grammar = this;
    parser.gtype = ANTLRParser.LEXER_GRAMMAR;
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.