Examples of CharStream


Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abc");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.insertBefore(0, "x");
    tokens.insertBefore(0, "y");
View Full Code Here

Examples of org.antlr.runtime3_3_0.CharStream

      e.printStackTrace();
    }
  }
*/
  public void process() throws IOException {
    CharStream input = new ANTLRFileStream(dispelFile);
    DISPEL lexer = new DISPEL(input);
    Token token;
    while ((token = lexer.nextToken()) != Token.EOF_TOKEN) {
      tp.process(token);
    }
View Full Code Here

Examples of org.antlr.v4.runtime.CharStream

import static org.junit.Assert.assertEquals;

public class TestUnbufferedCharStream extends BaseTest {
  @Test public void testNoChar() throws Exception {
    CharStream input = createStream("");
    assertEquals(IntStream.EOF, input.LA(1));
    assertEquals(IntStream.EOF, input.LA(2));
  }
View Full Code Here

Examples of org.apache.lucene.analysis.CharStream

  public TokenFilterFactory[] getTokenFilterFactories() { return filters; }

  @Override
  public Reader charStream(Reader reader){
    if( charFilters != null && charFilters.length > 0 ){
      CharStream cs = CharReader.get( reader );
      for (int i=0; i<charFilters.length; i++) {
        cs = charFilters[i].create(cs);
      }
      reader = cs;
    }
View Full Code Here

Examples of org.apache.lucene.analysis.CharStream

    NamedList<List<NamedList>> namedList = new NamedList<List<NamedList>>();

    if( cfiltfacs != null ){
      String source = value;
      for(CharFilterFactory cfiltfac : cfiltfacs ){
        CharStream reader = CharReader.get(new StringReader(source));
        reader = cfiltfac.create(reader);
        source = writeCharStream(namedList, reader);
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.antlr.runtime.CharStream

    private JSONAttributes attributes = new JSONAttributes();

  @Override
    public void parse(InputSource input) throws IOException, SAXException {
        try {
            CharStream charStream;
            InputStream inputStream = null;
            if(null != input.getByteStream()) {
                charStream = new ANTLRInputStream(input.getByteStream());
            } else if (null != input.getCharacterStream()){
                charStream = new ANTLRReaderStream(input.getCharacterStream());
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.