command
module
Version:
v0.0.0-...-a54c318
Opens a new window with list of versions in this module.
Published: Oct 5, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
e
e
is a cut down version of evy.
This repository demonstrates how to build a minimal lexer and parser from
scratch without using any external libraries.
Try the e
command with:
go run main.go test.e
Syntax grammar
prog = { stmt } .
stmt = decl | assign .
decl = ident ":" type .
ident = LETTER { LETTER | DIGIT } .
type = "num" | "string" | "bool" .
assign = ident "=" expr .
expr = operand | unary_expr |
binary_expr .
operand = literal | ident | group .
literal = /* e.g. "abc", 1, 2.34, true, false */ .
group = "(" expr ")" .
unary_expr = UNARY_OP expr .
UNARY_OP = "-" | "!" .
binary_expr = expr BINARY_OP expr .
BINARY_OP = "*" | "/" | "%" |
"+" | "-" |
"<" | "<=" | ">" | ">=" |
"==" | "!=" |
"and" |
"or" .
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.