[antlr-interest] Get position of the symbol in the input string?
Serge
sun2 at public.kherson.ua
Thu Nov 30 09:39:01 PST 2006
Hi,
I am do parsing of the sql string like "select * from t; select *
from t2;"
sql
: sql_single ( SEMI! (sql_single)? )* EOF!
| EOF!
;
When in the parser I meet token SEMI,
how can I receive position of this symbol ";" in my input string?
For my example: 14 and 32
I need this because we need extract ORIGINAL STRING of a SQL command
to be saved into system tables of database.
As far as I see it is bad idea try do manual parsing to search ';'
because it can be also part of string literals.
So may be ANTLR do have such feature, which I have miss?
If such feature not presented, then what workaround?
Serge
More information about the antlr-interest
mailing list