Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/Tools/Parser/mdl.lex
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/Tools/Parser/mdl.lex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 782, Fri Feb 16 19:42:00 2001 UTC revision 999, Tue Nov 27 06:28:37 2001 UTC
# Line 4  Line 4 
4  type svalue = Tokens.svalue  type svalue = Tokens.svalue
5  type ('a,'b) token = ('a,'b) Tokens.token  type ('a,'b) token = ('a,'b) Tokens.token
6  type lexresult = (svalue,pos) token  type lexresult = (svalue,pos) token
7  type lexarg = {srcMap  : SourceMap.sourcemap,  type lexarg = {srcMap  : SourceMapping.sourcemap,
8                 err     : pos * pos * string -> unit,                 err     : pos * pos * string -> unit,
9                 MDLmode : bool                 MDLmode : bool
10                }                }
# Line 28  Line 28 
28               )               )
29    
30  fun eof{srcMap,err,MDLmode} =  fun eof{srcMap,err,MDLmode} =
31      let val pos = SourceMap.currPos srcMap      let val pos = SourceMapping.currPos srcMap
32      in  EOF(pos,pos) end      in  EOF(pos,pos) end
33  fun debug _ = ()  fun debug _ = ()
34    
# Line 187  Line 187 
187    ("=", EQ) $$    ("=", EQ) $$
188    ("*", TIMES) $$    ("*", TIMES) $$
189    (":", COLON) $$    (":", COLON) $$
190      (":>",COLONGREATER) $$
191    ("|", BAR) $$    ("|", BAR) $$
192    ("->", ARROW) $$    ("->", ARROW) $$
193    ("=>", DARROW) $$    ("=>", DARROW) $$
# Line 197  Line 198 
198    
199  fun lookup(MDLmode,s,yypos) =  fun lookup(MDLmode,s,yypos) =
200  let val l = String.size s  let val l = String.size s
201      fun id() = ID(Symbol.toString(Symbol.fromString s), yypos, yypos + l)      fun id() = ID(UniqueSymbol.toString
202                        (UniqueSymbol.fromString s), yypos, yypos + l)
203  in  HashTable.lookup keywords s (yypos,yypos + l)  in  HashTable.lookup keywords s (yypos,yypos + l)
204        handle _ =>        handle _ =>
205          (if MDLmode then          (if MDLmode then
# Line 209  Line 211 
211  fun lookupSym(s,yypos) =  fun lookupSym(s,yypos) =
212  let val l = String.size s  let val l = String.size s
213  in  HashTable.lookup symbols s (yypos,yypos + l)  in  HashTable.lookup symbols s (yypos,yypos + l)
214        handle _ => SYMBOL(Symbol.toString(Symbol.fromString s), yypos, yypos + l)        handle _ => SYMBOL(UniqueSymbol.toString
215                         (UniqueSymbol.fromString s), yypos, yypos + l)
216  end  end
217    
218  %%  %%
# Line 245  Line 248 
248  %s COMMENT ASM ASMQUOTE;  %s COMMENT ASM ASMQUOTE;
249    
250  %%  %%
251  <INITIAL,COMMENT,ASM>\n         => (SourceMap.newline srcMap yypos; continue());  <INITIAL,COMMENT,ASM>\n         => (SourceMapping.newline srcMap yypos; continue());
252  <INITIAL,COMMENT,ASM>{ws}       => (continue());  <INITIAL,COMMENT,ASM>{ws}       => (continue());
253  <ASMQUOTE>\n            => (err(yypos,yypos+size yytext,  <ASMQUOTE>\n            => (err(yypos,yypos+size yytext,
254                                  "newline in assembly text!"); continue());                                  "newline in assembly text!"); continue());

Legend:
Removed from v.782  
changed lines
  Added in v.999

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0