dbg.slate parsing itself

Paul Dufresne dufrp at hotmail.com
Wed Jul 2 08:38:54 PDT 2003


I added a rewFile: to dbg.slate.
It is just looping infinitely for now, so expect an error at the end. :-)

I've tried it with dbg.slate itself. Here is the result:
Slate 1> 'src/init.slate' fileIn.
Hi, there!
Nil
Slate 2> 'src/compiler/dbg.slate' fileIn.
Nil
Slate 3> rewFile: 'src/compiler/dbg.slate'.
'src/compiler/init.slate' fileIn.
( lobby addSlot: #lex).
( lobby addSlot: #par).
( lobby addSlot: #tmp).

_@( lobby) dbgpar: statement [ |  :_ :statement statem |  statem: ( 
ReadStream n
ewOn:  statement).
lex: ( Compiler Lexer newOn:  statem).
par: ( Compiler Parser newOn:  statem).
tmp:  par parseStatement.
tmp].
lobby addSlot: #source_writer.
source_writer:  Compiler SourceWriter clone.

_@( lobby) rewrite: statement [ |  :_ :statement |  dbgpar:  statement.
( ConsoleOutput ; '
=======================================
').
source_writer print:  tmp on:  ConsoleOutput.
( ConsoleOutput ; '
=======================================
')].

_@( lobby) rewFile: filename [ |  :_ :filename filestr |  filestr: ( 
FileStream
newForInputNamed:  filename).
lex: ( Compiler Lexer newOn:  filestr).
par: ( Compiler Parser newOn:  filestr).
[ tmp:  par parseStatement.
source_writer print:  tmp on:  ConsoleOutput.
( ConsoleOutput ; '.
')] loop].
Backtrace
---------
Method rewFile: @ primitive
Method loop @ primitive
Method value @ primitive
Block @ line 30 in src/compiler/dbg.slate
---------
<@_:  traits printsPrettily surroundingArity>Nil<@Oddball:  traits Stream>
Error: A method named 'print:on:' was not found for the arguments: (<@_:  
traits
printsPrettily surroundingArity>
Nil <@Oddball:  traits Stream>)
Return to the Slate top level?  (y/n)
Please answer with y or n :

The most obvious thing is that the \n have become ends-of-line.
It is incredibly slow, about 15 or 20 minutes for this very small file.
I'll tried with other files, and keep you informed of interestind 
development.

_________________________________________________________________
MSN Search, le moteur de recherche qui pense comme vous !  
http://fr.ca.search.msn.com/




More information about the Slate mailing list