Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Problem when parsing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Laurent Reveillere <Laurent.Reveillere@l...>
Subject: [Caml-list] Problem when parsing
I wrote a small parser for iso C which does nothing (for now).
The lexer and parser files are well compiled by ocamllex and ocamlyacc.
But when I run the generated program, I have the following error :

Fatal error: uncaught exception Failure(lexing: empty token)


If I replace the following rule in the parser :
	
translation_unit:  
     external_declaration   { () }
  |  translation_unit external_declaration   { () }
 
;                                                                             	


by

translation_unit:  
     external_declaration   { () }
 
;                                                                             	

the test file is parsed with no problem.
The test file is just "int x;"


Any idea ...


I know that this error is raised by lex_engine in byterun/lexing.c but I
do not understand why !!!

-- 
Laurent
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr