Hi Jorge,
I've tested with the following files, and it works fine.
$ java -jar sablecc.jar grammar.sablecc
$ javac Main.java
$ java Main test.txt
Can you try with the attached files?
Etienne
Jorge Mario G. Mazo wrote:
> evey grammar I have tried I awlays get
> [1,1] expecting: EOF, if I move the first caracter of the example file
> ...
--
Etienne M. Gagnon, Ph.D. http://www.info2.uqam.ca/~egagnon/
SableVM: http://www.sablevm.org/
SableCC: http://www.sablecc.org/
Package org.sablecc.baba;
Helpers
digitos = ['0'..'9'];
letras = ['A'..'Z']|['a'..'z'];
caracteres = ' '|digitos|letras;
lf = 10;
cr = 13;
eol = cr lf | cr | lf;
blank = 10 | 10 13 | 9 | ' ';
Tokens
if = 'if';
then = 'then';
else = 'else';
while = 'while';
for = 'for';
end = 'end';
do = 'do';
numero = digitos+;
variable = letras(letras|digitos)*;
endofline = eol;
blanktoken = blank+;
Ignored Tokens
endofline,
blanktoken;
Productions
programa =
lista_decl;
lista_decl =
decl*;
decl =
variable;
lista_instr =
instr*;
instr =
{declaracion} decl |
{if} if variable then lista_instr end |
{while} while variable do lista_instr end |
{for} for variable do lista_instr end;
ahsh
_______________________________________________
SableCC-user mailing list
SableCC-user@xxxxxxxxxxx
http://sablecc.org/lists/control/listinfo/sablecc-user