There are dozens of grammar rules I am mad about in Ruby, and this is one of them
-
-
Replying to @penelope_zone @mountain_ghosts
The lexer is dependent on the parser state james
1 reply 0 retweets 1 like -
-
Replying to @mountain_ghosts
if I was the ruby parser I would simply make it possible to parse as ast = parser(lexer(input)) where parser and lexer are pure functions. But I am not the ruby parser and it is not simple
1 reply 0 retweets 2 likes -
Replying to @penelope_zone @mountain_ghosts
I didn’t even know you *could* have something other than parser(lexer(input))
2 replies 0 retweets 1 like -
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
-
-
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 -
Yay for putting semantic information in lexers
0 replies 0 retweets 0 likes
End of conversation
New conversation -
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.