[antlr-interest] PLSQLGrammar.g - antlr
Ed Delaney
edelaney at sungardsct.com
Fri Apr 29 06:50:43 PDT 2005
Hey Michiel,
Are you still working on your PL/Sql project?
I finally got the PL/Sql grammar to generate and compile. I've created a
simple main to test it, but I'm not sure what is happening. Have you made
any more progress?
Remember, my experience with Java is pretty basic, though I know a zillion
other languages.
All I want to do is feed it some Plsql and see if it parses or if it
detects an error:
import java.io.DataInputStream;
class main {
public static void main(String[] args) {
try {
PLSqlLexer lexer = new PLSqlLexer(new
DataInputStream(System.in));
PLSqlParser parser = new PLSqlParser(lexer);
parser.start_rule();
} catch(Exception e) {
System.err.println("exception: "+e);
}
}
}
later on I want to generate an AST that I can start working with. But as
it stands, shouldn't this work as a syntax checker?
My test input is:
BEGIN
null;
END;
And when it runs I get
java main < t.sql
line 1:1: expecting EOF, found 'BEGIN'
Thanks,
Ed
---------------------------------------------------
Ed Delaney
SunGard SCT
Advisory Software Engineer
Phone Number (Office): 765-939-0533
Time Zone: US Indiana
edelaney at sungardsct.com
www.sungardsct.com
Leadership - Choices - Excellence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050429/80d0544d/attachment.html
More information about the antlr-interest
mailing list