On Wed, Feb 25, 2009 at 1:13 PM, Geoffrey Irving <[email protected]> wrote:
>
> On Wed, Feb 25, 2009 at 8:02 AM, Jonathan S. Shapiro <[email protected]> wrote:
> > 2. I'm increasingly convinced (however reluctantly) that mixfix is important
> > in a non-sexpr surface syntax. The problem with this is that (a) there are
> > no parser generators that seem to support this and (b) writing a parser for
> > the non-sexpr syntax by hand is probably not the best way to coverge on a
> > syntax. Once the syntax is stable it's not a problem, but hand-written
> > parsers do not tend to be easily modified or easily validated.
>
> I may be misunderstanding the issue, but couldn't this be solved with
> a simple feedback loop between the lexer and the parser?  E.g., the
> set of infix expression tokens would be something like INFIX0 ...
> INFIX100, one for each precedence level.  The parser would gradually
> produce a map from strings to precendence, and the lexer would use the
> most recent map to produce future tokens....

This could be made to work, but there are two issues. First, having
128 productions in the grammar in order to capture precedence is
decidedly unattractive. Second, this doesn't address mixfix operators
having more than two holes (or at least, I am not seeing how it would
do so).
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to