This is a homework which implements a language. The language is for drawing.
- gn(in path)
- ninja(in path)
- gcc(in path)
- bison
- flex
- python3 with matplotlib(in path)
-
Statements are seprated with
;
. -
Statements are case insensitive.
-
Comments are started with
//
and ended with\n
. -
<expression>
is a expression which can be calculated supporting sin, cos, tan, exp, ln and constant PI and E. -
<t_expression>
is a<expression>
optionally with the variablet
.
-
ORIGIN IS (expression,expression)
-
SCALE IS (expression,expression)
-
SCALE IS AUTO
-
ROT IS expression
-
FOR T FROM expression TO expression STEP expression DRAW (t_expression,t_expression)
-
SLEEP expression
-
EXIT
-
CLEAR
- Install all the requirements on your computer.
- Change the
PYTHON_PATH
(ONLY NEEDED ON WINDOWS) ,TARGET
andPYTHON_VERSION
variable in theBUILD.gn
to your python path and subversion. - Run
gn gen out/Default --args=target_os=\"linux\"
orgn gen out/Default --args=target_os="windows"
in the root directory of the project. - Run
ninja -C out/Default
to compile it. - Run
./out/Default/main
to start interactive mode or./out/Default/main <sourcefile> [targetfile]
to run a file.