Skip to content

Pluas-Ca/CamilasWorld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

My ANTLR Project:❤️🙌

I created a math parser using ANTLR. What my program does is super impressive! Here’s what's happening:

The Magic Behind the Scenes ✨ Input (Math Equation) 📝: The user gives your program a math equation—like 3 + 5 * (2 - 1). This equation can have numbers (like 3, 5, 2, 1) and operations (like +, *, -, () for parentheses).

ANTLR’s Role (Lexing + Parsing) 🧠: ANTLR steps in to break down this equation into smaller chunks called tokens (like 3, +, 5, *, (, 2, etc.). ANTLR uses these tokens to apply parsing rules that define how the math operations are supposed to work (like order of operations—PEMDAS, or Parentheses, Exponents, Multiplication, Division, Addition, Subtraction).

Building the Syntax Tree (AST) 🌳: My parser, thanks to ANTLR, builds a parsing tree (called an Abstract Syntax Tree or AST). This tree visually represents how your equation is structured.

What is ANTLR:

So, ANTLR (which stands for Another Tool for Language Recognition) is this super cool tool that helps you create parsers. 🛠️ A parser is like the brain of a program that understands and interprets the code (or text) you give it. Imagine it like a translator who takes something in one language (your code) and turns it into something the computer can understand. 💬 If you have some structured input (like code, JSON, or even a language you're making), ANTLR helps you build a program that can read and interpret that input in a meaningful way. For example, if you create a programming language or even a data format, ANTLR will help you define the structure and the rules for how your input is understood by your program.🌸

Why Did I Choose Python?

Python is so much fun! Python is very the friendly, easy to learn and super popular.Since ANTLR supports Python, you get to use it to make your cool language projects work. Super Easy Integration: ANTLR has a Python runtime, which means all the stuff you create with ANTLR can easily be used in your Python programs. Plus, Python has a bunch of helpful libraries. 😎 Clear syntax: Python’s syntax is super clean, which is great when you're working with something complex like parsing. You can focus more on building cool things and less on worrying about how to write code. Think of it like your favorite colorful stationery that makes everything look cute and organized! 🖍️📚

Releases

No releases published

Packages

No packages published