%byaccj
%line
%column
%{
private Parser yyparser;
public Yylex (java.io.Reader r, Parser yyparser) {
this (r);
this.yyparser = yyparser;
}
int getLineNum () {
return (yyline+1);
}
int getColNum () {
return (yycolumn+1);
}
%}
To get the position information in BYacc/J, add several lines in the specification:
private Yylex lexer;
public void yyerror (String strError) {
System.err.println ("Error at line: " + lexer.getLineNum() + ": " + strError);
}
2 comments:
hello,,blog walking..btw scrip itu untuk di blog ya mas??
salam.
BYacc/J bukan script untuk blog.
Post a Comment