EasyLang CLI — Usage Guide¶
The EasyLang CLI (el) provides multiple tools to help you write, run, debug, and explore EasyLang programs.
This guide covers everyday usage, including:
- Running files
- Starting the REPL
- Viewing tokens
- Viewing the AST
- Checking the version
- Viewing interpreter information
All behavior is based on the implementation inside el.py.
Running an EasyLang File¶
To run a .elang program:
el program.elang
If the program has errors, the interpreter will show a friendly syntax or runtime error.
Starting the REPL (Interactive Shell)¶
Use:
el --repl
You will see:
EasyLang 0.1.x REPL
Type 'exit' or 'quit' to leave
>>>
Features:
- Live execution of expressions and statements
- Persistent interpreter state
- Supports multiline input via brackets
[ ] - Type
exitorquitto leave
Example:
>>> we let x = 10
>>> so print x plus 5
15
Printing Tokens¶
To see how the lexer tokenizes your program:
el --tokens file.elang
This prints each token in order:
Token(WELET, 'we let')
Token(IDENT, 'x')
Token(EQUAL, '=')
Token(NUMBER, 10)
...
Useful for debugging the lexer.
Printing the AST¶
To print the abstract syntax tree:
el --ast file.elang
This shows how the parser interpreted the structure of the code.
Example output:
Program([
Assignment(x, Number(10)),
Print(Identifier(x))
])
Great for parser debugging or language contributor work.
Linting (Coming Soon)¶
The CLI includes a placeholder command:
el --lint file.elang
Currently prints:
Linting is not implemented yet.
Viewing the¶
el --version
Output:
EasyLang version 0.1.x by GreenBugX(0xNA)
About Information¶
el --about
Prints:
- Description
- Version
- Author
- Contact
- License
Example:
=== EasyLang ===
EasyLang is a compact educational scripting language...
Version: 0.1.x
Author: GreenBugX(0xNA)
When No Arguments Are Provided¶
Running:
el
Starts the REPL automatically.
At the end of the session, the CLI prints:
=== EasyLang CLI ===
<description>
Author: GreenBugX(0xNA)
Version: 0.1.x
Usage: el <filename.elang>
Use --help for more options.
Summary¶
Use the CLI to:
- run files
- debug tokens and AST
- explore code in REPL
- get interpreter info
- prepare for future linting features
Next page: Commands Reference