* http://helm.cs.unibo.it/
*)
-let ic = open_in Sys.argv.(1) in
-let token_stream = fst (Lexer.lex.Token.tok_func (Stream.of_channel ic)) in
+let ic =
+ try
+ open_in Sys.argv.(1)
+ with Invalid_argument _ -> stdin
+in
+let token_stream =
+ fst (CicTextualLexer2.cic_lexer.Token.tok_func (Stream.of_channel ic))
+in
let rec dump () =
let (a,b) = Stream.next token_stream in
if a = "EOI" then raise Stream.Failure;