I didn’t even know you *could* have something other than parser(lexer(input))
-
-
You can't parse C with parser(lexer(input))
2 replies 0 retweets 0 likes -
this isn't *strictly* true (I mean you can parse any language with a composition of those functions, even if they're pure, for given definitions of those functions). Like we *could* build a ruby parser where the lexer was a pure scanner, but it would be very hard.
2 replies 0 retweets 0 likes -
where does the lexer use state from the parser?
1 reply 0 retweets 0 likes -
Symbol table to disambiguate typedefs in expressions like (A) * B.
2 replies 0 retweets 0 likes -
is the ambiguity here that this means "A times B" or "deref B and cast to A"
1 reply 0 retweets 0 likes -
Yes
1 reply 0 retweets 0 likes -
Replying to @sgrif @mountain_ghosts and
Or from a lexer point of view it's what is A, since most C lexers chose to have types be a separate token class
2 replies 0 retweets 0 likes -
yeah I can see why this is so bad, it also changes the meaning of * and produces a completely different shape of AST
1 reply 0 retweets 0 likes -
Replying to @mountain_ghosts @sgrif and
(mul (id a) (id b)) vs (cast (type a) (deref (id b)))
1 reply 0 retweets 0 likes
Right but that's the parser's job ultimately.
-
-
sure but its gonna complicate the state space when multiple tokens in a row have unknown types
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.