[e-lang] Left-to-right define syntax: "into"
Kevin Reid
kpreid at attglobal.net
Thu May 11 17:49:51 EDT 2006
This is the current idea for left-to-right define syntax which Mark
Miller and I have been discussing:
VALUE into PATTERN
VALUE into ^(EJECTOR) PATTERN
It is left-associative and its precedence is immediately above
sequences; that is, it parses like this (actual test cases from E-on-
CL):
? t("a; def b := c into d; e")
# stdout: SeqE. []
# NounE. a
# IntoE.
# DefrecE.
# FinalP.
# NounE. b
# null
# NounE. c
# null
# null
# FinalP.
# NounE. d
# null
# NounE. e
? t("a into b into c")
# stdout: IntoE.
# IntoE.
# NounE. a
# null
# FinalP.
# NounE. b
# null
# null
# FinalP.
# NounE. c
# null
This is the portion of the grammar which implements it; "withinInto"
is the next precedence level.
eExpr: withinInto
("into"^ {##.setType(IntoExpr);} intoOptEjector pattern)* ;
intoOptEjector: "^"! parenExpr | filler ;
withinInto: assign | ejector ;
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list