Using the interpreter

Last updated 5 months ago

Using the interpreter

When you install the interpreter, a binary file is generated and copied into /usr/bin folder to be available from the command line.

In the next section the symbol $ is used to denote the command line.

Running programs

To run a program you can simply invoke lincas with a filemane

$ lincas some_program.lc

LinCAS files ends with .lc extension, but it can be omitted.

Alternatively you ca use a shebang, that is adding as first line of your program the code #! /usr/bin/lincas. Than you can simply run your file just typing on your command line $ ./my_program.lc ensuring it has the executable privileges.

Other options

To see the possible options of the interpreter, type $ lincas -h

$ lincas -h
Usage : lincas [options] [filename] [arguments]
‚Äč
options:
-t --tokens Displays the tokens generated by the scanner
(the program won't be executed)
-a --ast Displays the AST generated by the parser
-i --iseq Displays the compiled bytecode
-n --no-exec Suppresses the execution of the program