Closed rogerburtonpatel closed 4 months ago
The document:
I don't love top-level patterns, period. Why have two levels?
On my machine your LaTeX is running in 1.6 seconds. I tried annotate-output but it didn't illuminate things. But something is happening about here in your .log
file:
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
> Step: init table outer spec.
> Step: parse table options.
> Step: split table.
> Step: init table inner spec.
> Step: parse table inner spec.
> Step: execute table commands.
> Step: calculate cell and line sizes.
> Step: build the whole table.
I'd try tracking that to its lair.
"These rules are a variation on the rules found in Ramsey (2022, Section 8.X)," for some value of X.
How vexing. The sigma should not be there, and it should be rho + rho', not sigma + rho'. Both faults are an artifact of using the wrong \eval
macro in that chapter.
I have no particular thoughts about the \rab
notes.
The code:
It's a bit odd to have the two different lexical categories RESERVED and SPECIAL. Why aren't comma and friends reserved words?
It's also not clear that the LEFT and RIGHT are useful in your setting.
Bottom line: could be simpler, probably not worth changing.
Parsing combinators are effectively LL(k), which means you can't have left recursion. Let me spitball an EBNF grammar, adapted from Wirth's classic grammar for Pascal:
p ::= term {| term} term ::= factor {, factor} factor ::= atom {when exp} atom ::= x | K {atom} | ❨p❩
Don't incorporate technical material by reference. You should explain disjoint union and +, but not necessarily the way I did. Your proximate audience is your thesis committee. Your ultimate audience is PL professionals.
On further reflection, Alva may benefit from a detailed explanation.
p ::= term {| term}
term ::= factor {, factor}
factor ::= atom <- exp // pattern guard; expression results in atom
| atom {when exp} // side condition; expression results in true
atom ::= x | K {atom} | ❨p❩
I like this, except that a pattern guard can look like ❨p❩ <- exp, which could look like This when condition <- exp, which is a bit odd.
Embrace the oddness!
Review
tex/syntax-and-judgement/pplus/syntax-judgement-pplus.pdf
. It has a Makefile to build it this time, and you don't needsimplebnf
installed.Review
src/pplus/pplus-parse.sml and .../pplus-lex.sml
.COMMA
,BACKSLASH
, etc, and if the way I've done it is reasonable.bracketed
from thetoplevelpatterns
causes an OOM crash. My theory is thattoplevelpattern
attempting to immediately parse atoplevelpattern
underfix
is poison. Can I work around this somehow?