Skip to content

Feat greek letters and infinity#1

Open
MANDRW wants to merge 2 commits intomainfrom
feat_greek_letters
Open

Feat greek letters and infinity#1
MANDRW wants to merge 2 commits intomainfrom
feat_greek_letters

Conversation

@MANDRW
Copy link
Collaborator

@MANDRW MANDRW commented Mar 22, 2026

This pull request extends the math expression parser and visitor framework to support Greek letter tokens and infinity, as well as unary plus and minus operators. It also standardizes import paths for ANTLR-generated classes. These changes improve the parser's ability to handle mathematical notation more naturally and in a way that's closer to LaTeX.

Parser and Grammar Enhancements:

  • Added GREEK and INFINITY tokens to MathLexer.g4, enabling recognition of Greek letter names (both lowercase and uppercase) and various representations of infinity.
  • Updated MathParser.g4 to support unary plus/minus operators, Greek letter tokens, and infinity as valid expressions.

Visitor and Output Handling:

  • Implemented visitUnarySign in AlgebraVisitor to handle unary plus and minus expressions.
  • Implemented visitInfinity in BasicVisitor to output \infty for infinity tokens.
  • Integrated a new GreekVisitor in MainVisitor and routed Greek and infinity expressions to the appropriate visitors.

@MANDRW MANDRW requested a review from PEXEL2002 March 22, 2026 21:43
@MANDRW MANDRW self-assigned this Mar 22, 2026
@MANDRW MANDRW added the enhancement New feature or request label Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant