comparison parse.rhope @ 182:db30bda91aad

Cleanup grammar comment in new parser
author Mike Pavone <pavone@retrodev.com>
date Wed, 27 Jul 2011 21:06:57 -0700
parents 47ab97730865
children
comparison
equal deleted inserted replaced
181:a658c17148cb 182:db30bda91aad
276 Body[node,tokens,current,depth:out,out index, done] 276 Body[node,tokens,current,depth:out,out index, done]
277 { 277 {
278 Print[["Body: Depth="]Append[String[depth]]] 278 Print[["Body: Depth="]Append[String[depth]]]
279 If[[depth] > [0]] 279 If[[depth] > [0]]
280 { 280 {
281 //symbol list = Symbol [List Separator symbol list] 281 /*
282 //value = String Literal | Number Literal | List Literal | Symbol | Block Reference | expression 282 symbol list = Symbol [List Separator symbol list]
283 //call = [Args Begin arg list Args End]Symbol[Args Begin arg list Args End] | (value | Arg Placeholder) Call Separator Symbol 283 value = String Literal | Number Literal | List Literal | Symbol | Block Reference | expression
284 //arg list = value | Arg Placeholder [List Separator arg list] 284 call =
285 //block = Block Begin [expressions] Block End 285 Args Begin arg list Args End Symbol[Args Begin [arg list] Args End]
286 //blocks = block [blocks] 286 | Symbol Args Begin [arg list] Args End
287 //expressions = expression [expressions] 287 | (value | Arg Placeholder) Call Separator Symbol[Args Begin [arg list] Args End]
288 //expression = [symbol list Assignment] call | value blocks | Newline 288 arg list = value | Arg Placeholder [List Separator arg list]
289 block = Block Begin [expressions] Block End
290 blocks = block [blocks]
291 expressions = expression [expressions]
292 expression = [symbol list Assignment] (call | value) blocks
293
294 */
289 token <- [tokens]Index[current] 295 token <- [tokens]Index[current]
290 [token]Type Match["Block Begin"] 296 [token]Type Match["Block Begin"]
291 { 297 {
292 ,end stream <- [tokens]Next[current] 298 ,end stream <- [tokens]Next[current]
293 { 299 {