This project implements a lexer that does the tokenization of any set of valid G++ expressions or statements.
G++ is a kind of programming language that is not real.
It takes a file or an input from console and do lexical analysis.
The rules are given in the /Files/G++Syntax.pdf
-
Download Ubuntu clisp package
-
Load gpp_lexer.lisp file
-
Call gppinterpreter OR gppinterpreter "filename"
Input:
(deffun sumup (x)
(if (equal x 0)
1
(+ x (sumup (- x 1)))
)
)
Output:
COMMENT
OP_OP
KW_DEFFUN
IDENTIFIER
OP_OP
IDENTIFIER
OP_CP
OP_OP
….