Syntax & Reference — Introduction¶
Welcome to the Syntax & Reference section of the EasyLang documentation.
This part of the documentation explains how the EasyLang language works at a deeper level.
If you're looking for formal rules, grammar, operators, data types, and the structure of statements — this is where everything is defined.
EasyLang focuses on clear English-like expressions, but it still has a precise and consistent internal structure that the interpreter follows.
What You Will Learn¶
Each chapter in this section explains one important part of the language:
Lexical Structure¶
How EasyLang reads your code:
tokens, numbers, strings, identifiers, comments, whitespace, and reserved keywords.
Grammar¶
A simplified explanation of how complete programs are formed.
Statements¶
Everything that forms executable actions:
- assignments
- printing
- imports
- loops
- conditionals
- file operations
- returns
These are mapped directly from the syntax handled by the Parser in the interpreter.
Expressions¶
How EasyLang evaluates:
- numbers
- strings
- booleans
- arithmetic
- logic
- comparisons
- nested expressions
- lists & dictionaries
- function calls
- attribute access (dot-methods)
This section explains operator rules in simple English.
Variables & Scopes¶
How variables live inside:
- global scope
- local function scopes
- nested blocks
- module namespaces
And how EasyLang resolves variable names from inner scopes outward.
Functions¶
How to define and call functions, how parameters work, return values, and how EasyLang evaluates them internally.
Modules¶
How to import:
- EasyLang
.elanghmodules - Python modules (through wrapper APIs)
And how namespaces are created, loaded, cached, and used.
Standard Library¶
All built-in functions provided by EasyLang:
- math
- strings
- lists
- dictionaries
- random
- type conversion
- Python interoperability
A complete reference based on the built-ins defined inside the interpreter.
Error System¶
EasyLang provides a friendly error reporting engine with:
- file/line/column tracking
- caret indicators
- code previews
- SyntaxError + RuntimeError structure
You’ll learn how errors occur and how to interpret them.
Types System¶
EasyLang supports:
- numbers
- strings
- booleans
- lists
- dictionaries
- module namespaces
- Python objects (wrapped safely)
We explain what each type can do.
Appendix¶
A fully detailed, beginner-friendly grammar summary.
This section gives you a complete picture of how the language is parsed.
Who Is This Section For?¶
This reference is designed for:
🟢 Beginners¶
who want to understand how EasyLang works behind the scenes.
🟢 Students & educators¶
using EasyLang to learn programming and basic compiler concepts.
🟢 Contributors¶
who want to extend the language or help improve its interpreter.
🟢 Power users¶
who want to know every rule, operator, and structure EasyLang supports.
How to Use This Section¶
You can read it:
🔹 Top-to-bottom¶
- like a small language handbook
- understanding everything step-by-step
🔹 Jump directly to what you need¶
because each topic is separated cleanly.
🔹 As a reference while coding¶
because it describes exact syntax, keywords, and behavior.
Ready?¶
Choose one of the core sections on the left to begin:
- Lexical Structure
- Grammar
- Statements
- Expressions
- Variables & Scopes
- Functions
- Modules
- Standard Library
- Error System
- Types System
- Appendix
Happy exploring — and happy coding with EasyLang!