src/Pure/Syntax/syntax.ML
changeset 7944 cc1930ad1a88
parent 7025 afbd8241797b
child 8720 840c75ab2a7f
equal deleted inserted replaced
7943:e31a3c0c2c1e 7944:cc1930ad1a88
   351     val {lexicon, gram, parse_ast_trtab, logtypes, ...} = tabs;
   351     val {lexicon, gram, parse_ast_trtab, logtypes, ...} = tabs;
   352     val root' = if root mem logtypes then SynExt.logic else root;
   352     val root' = if root mem logtypes then SynExt.logic else root;
   353     val chars = Symbol.explode str;
   353     val chars = Symbol.explode str;
   354     val pts = Parser.parse gram root' (Lexicon.tokenize lexicon xids chars);
   354     val pts = Parser.parse gram root' (Lexicon.tokenize lexicon xids chars);
   355 
   355 
   356     fun show_pt pt =
   356     fun show_pt pt = warning (Pretty.string_of 
   357       warning (Symbol.output (Pretty.string_of 
   357 			(Ast.pretty_ast (SynTrans.pt_to_ast (K None) pt)));
   358 		(Ast.pretty_ast (SynTrans.pt_to_ast (K None) pt))));
       
   359   in
   358   in
   360     if length pts > ! ambiguity_level then
   359     if length pts > ! ambiguity_level then
   361       (warning ("Ambiguous input " ^ quote (Symbol.output str));
   360       (warning ("Ambiguous input " ^ quote str);
   362        warning "produces the following parse trees:";
   361        warning "produces the following parse trees:";
   363        seq show_pt pts)
   362        seq show_pt pts)
   364     else ();
   363     else ();
   365     map (SynTrans.pt_to_ast (lookup_tr parse_ast_trtab)) pts
   364     map (SynTrans.pt_to_ast (lookup_tr parse_ast_trtab)) pts
   366   end;
   365   end;