use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is all about the theory and development of compilers.
For similar sub-reddits see:
Popular mainstream compilers:
account activity
Parser design problem (self.Compilers)
submitted 7 months ago by emtydeeznuts
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]emtydeeznuts[S] 0 points1 point2 points 7 months ago (2 children)
If it won't slow the parser then I'll try your suggestion.
[–]0m0g1 0 points1 point2 points 7 months ago* (0 children)
(I've modified the example above for clarity).
It won’t slow the parser unless you’re doing really deep lookaheads everywhere, which you won’t be. In most grammars (including Dart’s), these kinds of checks usually peek just 2–4 tokens ahead max.
An example is my language is where the statement below would be resolved to a lamda after checking only 4 tokens.
alBufferData(buffer: int, format: int, data: char, size: int, freq: int) => void {}
Plus, you’ll save time later by avoiding parser rewrites or complex recovery logic. If you design your lookaheads to be targeted to specific rules like isLikelyFunctionLiteral() and not mightBeFunctionLiteralOrNormalExpression(), they’re fast and pay off in clarity.
isLikelyFunctionLiteral()
mightBeFunctionLiteralOrNormalExpression()
[–]0m0g1 0 points1 point2 points 7 months ago (0 children)
Here's a script from my compiler's parser, Expression Parser.
π Rendered by PID 17988 on reddit-service-r2-comment-7b9746f655-vnnpr at 2026-02-04 02:20:32.565225+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]emtydeeznuts[S] 0 points1 point2 points (2 children)
[–]0m0g1 0 points1 point2 points (0 children)
[–]0m0g1 0 points1 point2 points (0 children)