2 ms·
SableCC used that visitor pattern for its outputs, and then immediately had an "empty implementation" of the interface to allow folks to subsclass the parts tha
by mdaniel 1y ago
SableCC used that visitor pattern for its outputs, and then immediately had an "empty implementation" of the interface to allow folks to subsclass the parts that were relevant https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src/org/sablecc/sablecc/core/analysis/IGrammarVisitor.java https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src... https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src/org/sablecc/sablecc/core/analysis/GrammarVisitor.java https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src... https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src/org/sablecc/sablecc/core/walker/AssignabilityVerifier.java https://github.com/SableCC/sablecc/blob/sablecc-4-beta.4/src...
I think Antlr 4 does similar, I just haven't used it in as much anger because its runtime always jammed me up https://github.com/antlr/antlr4/blob/4.13.2/doc/listeners.md#parse-tree-listeners https://github.com/antlr/antlr4/blob/4.13.2/doc/listeners.md...
I thought that IntelliJ did similarly but I am misremembering since they generate recursive descent style https://github.com/JetBrains/Grammar-Kit/blob/v2023.3/HOWTO.md#21-parser-basics https://github.com/JetBrains/Grammar-Kit/blob/v2023.3/HOWTO....