The parser written in Slate is beginning to work!

Paul Dufresne dufrp at hotmail.com
Sat May 31 05:02:13 PDT 2003


After changing parser findVariable: to parser currentScope findVariable, I 
am beginning to be
able to parse stuff! I include session log here:

G:\slate2\slate>slate.fas

WARNING:
INTERN("SOCKET-STREAM"): #<PACKAGE SOCKET> is locked
Ignore the lock and proceed
Slate 1> 'src/init.slate' fileIn.
Hi, there!
Nil
Slate 2> 'src/compiler/dbg.slate' fileIn.
Nil
Slate 3> dbgpar: '[ Nil ifNil: [4] ]'.
<@_: traits, type, statements, parentScope, depth, inputVariables, 
freeVariables
, localVariables, heapOffset, stackOffset><@*PRIMITIVE-CLONEABLE*: traits, 
type,
statements, parentScope, depth, inputVariables, freeVariables, 
localVariables,
heapOffset, stackOffset>
Slate 4> dbgpar: '[ | a | a]'.
<@_: traits, type, statements, parentScope, depth, inputVariables, 
freeVariables
, localVariables, heapOffset, stackOffset><@*PRIMITIVE-CLONEABLE*: traits, 
type,
statements, parentScope, depth, inputVariables, freeVariables, 
localVariables,
heapOffset, stackOffset>
Slate 5> dbgpar: '[ | a | a * a]'.
<@_: traits, type, statements, parentScope, depth, inputVariables, 
freeVariables
, localVariables, heapOffset, stackOffset><@*PRIMITIVE-CLONEABLE*: traits, 
type,
statements, parentScope, depth, inputVariables, freeVariables, 
localVariables,
heapOffset, stackOffset>
Slate 7> tmp.
<@_: traits, type, statements, parentScope, depth, inputVariables, 
freeVariables
, localVariables, heapOffset, stackOffset><@*PRIMITIVE-CLONEABLE*: traits, 
type,
statements, parentScope, depth, inputVariables, freeVariables, 
localVariables,
heapOffset, stackOffset>
Slate 8> tmp statements.
{<@_: traits, type, selector, arguments>.#(<@*PRIMITIVE-CLONEABLE*: traits, 
type
, selector, arguments>)
Slate 9> tmp statements selector.
Backtrace
---------
---------
Error: A method named 'selector' was not found for the arguments: 
(#(<@*PRIMITIV
E-CLONEABLE*: traits, type, selector, arguments>))
Return to the Slate top level?  (y/n)
Please answer with y or n : y
Slate 12> dbgpar: '[ | a | a ifNil: [ 11] ifNotNil: [a * a]'.
Backtrace
---------
Method dbgpar: @ primitive
Method parseStatement @ primitive
Method parseKeywordMessage: @ primitive
Method value @ primitive
Block @ line 155 in src/compiler/parser.slate
Method parseBinaryMessage @ primitive
Method parseUnaryMessage @ primitive
Method parseAtom @ primitive
Method parseBlock: @ primitive
Method whileFalse: @ primitive
Method value @ primitive
Block @ line 203 in src/compiler/parser.slate
Method value @ primitive
---------
Error: A method named 'error:' was not found for the arguments: 
(<@*PRIMITIVE-AC
TIVATION*: traits, currentMethod, lexicalParent, continuation>
Line 1: Expected ] for [ at line 1)
Return to the Slate top level?  (y/n)
---I don't see my error.
Please answer with y or n : y
Slate 13> dbgpar: '34 or: 54'.
<@_: traits, type, selector, arguments><@*PRIMITIVE-CLONEABLE*: traits, 
type, se
lector, arguments>
Slate 14> dbgpar: '34 or: 54 or: 21'.
<@_: traits, type, selector, arguments><@*PRIMITIVE-CLONEABLE*: traits, 
type, se
lector, arguments>
Slate 15> dbgpar: '34 or: 54 or: 21 + 1'.
<@_: traits, type, selector, arguments><@*PRIMITIVE-CLONEABLE*: traits, 
type, se
lector, arguments>
Slate 16> dbgpar: '_@(lobby) hi [ ConsoleOutput ; 54 ].'.
Backtrace
---------
Method dbgpar: @ primitive
Method parseStatement @ primitive
Method parseExpression @ primitive
Method whileTrue: @ primitive
Method value @ primitive
Block @ line 359 in src/compiler/parser.slate
Method value @ primitive
Block @ line 361 in src/compiler/parser.slate
Method parseDefinition @ primitive
Method whileFalse: @ primitive
Method value @ primitive
Block @ line 300 in src/compiler/parser.slate
Method value @ primitive
Block @ line 309 in src/compiler/parser.slate
Method parseAtom @ primitive
Method parseAtom: @ primitive
Method whileFalse: @ primitive
Method value @ primitive
Block @ line 91 in src/compiler/token.slate
Method parseStatement @ primitive
Method parseKeywordMessage: @ primitive
Method value @ primitive
Block @ line 155 in src/compiler/parser.slate
Method parseBinaryMessage @ primitive
Method parseUnaryMessage @ primitive
Method parseAtom @ primitive
Method parseAtom: @ primitive
---------
Error: A method named 'findVariable:' was not found for the arguments: 
(<@*PRIMI
TIVE-NIL*: traits>
lobby)
Return to the Slate top level?  (y/n)
Please answer with y or n :

Maybe there would be a need for an empty root currentScope?

Anyway, that's an interesting beginning I wanted to share.

And fixing the FileStream problem, will allows us to test the parser with 
real files...

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




More information about the Slate mailing list