Package tool.model.grammar

Source Code of tool.model.grammar.TestCursor

package tool.model.grammar;

import java.io.IOException;

import junit.framework.Assert;

import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.TokenStream;
import org.antlr.runtime.tree.CommonTree;
import org.junit.Test;

public class TestCursor extends ANTLRTest {
  @Test
  public void cursorFile() throws RecognitionException, IOException{
    CharStream stream =
        new NoCaseFileStream("TestSmall/WinDB/BlobCursor.cur");
    ToolSQLLexer lexer = new ToolSQLLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    ForteParser parser = new ForteParser(tokenStream);
    CommonTree tree = (CommonTree) parser.cursorFile().getTree();
    printTree(tree);
    int errors = parser.getNumberOfSyntaxErrors();
    if (errors > 0Assert.fail() ;
  }
}
TOP

Related Classes of tool.model.grammar.TestCursor

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.