aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShachaf Ben-Kiki <shachaf@gmail.com>2021-04-24 16:41:10 -0700
committerShachaf Ben-Kiki <shachaf@gmail.com>2021-04-24 22:40:41 -0700
commit01aa74a93fa7c18f8a2f27a4c5f76333935c3502 (patch)
treede2602e3e0da264135be942426f50460c44952cc /src
parent37b05742ff1544bccf7c8ae9b12c6707a5a54df2 (diff)
downloadzig-01aa74a93fa7c18f8a2f27a4c5f76333935c3502.tar.gz
zig-01aa74a93fa7c18f8a2f27a4c5f76333935c3502.zip
parser: Use an operator precedence table
Instead of having one function per precedence level, mirroring the BNF grammar, this uses the "precedence climbing" algorithm with a table of operator precedences (and a few special cases that don't fit into the table as it is). This is a first pass -- it's probably possible to put more of the parser into this form, e.g. to support prefix/suffix operators with precedence, if necessary, or just to simplify the code more. It may also be possible to speed this up by putting more useful information into the tokens during tokenization, to avoid the extra branch on the token in operInfo.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions