The file with the code to interpret the Please lang
- Since:
- 8/04/2021
Classes
Members
-
inner, constant WHITE
-
The defition of whitespace in the Please language
Methods
-
inner compile(origin, destination)
-
A function that compiles a Please file
Parameters:
Name Type Description originstring The name of the origin file destinationstring The name of the destination file Throws:
Will throw if there are errors in the program or if the files can't be opened -
inner parse(program) → {Object}
-
A function that parses a Please program
Parameters:
Name Type Description programstring The string with the unparsed program Throws:
Will throw if there are errors in the programReturns:
Object - The AST of the program -
inner parseCall(operator, lexer) → {Object}
-
A function that parses a call
Parameters:
Name Type Description operatorObject The already parsed operator of the operator lexerLexer An instance of the Lexer class properly initialized Throws:
Will throw if there are syntactical errorsReturns:
Object - The JSON AST of the call -
inner parseExpression(lexer) → {Object}
-
A function that parses an expression
Parameters:
Name Type Description lexerLexer An instance of the Lexer class initialized with the source of the program Throws:
Will throw if there are syntactical errorsReturns:
Object - The JSON AST of the expression -
inner parseFromFile(fileName) → {Object}
-
A function that reads a file and parses its contents
Parameters:
Name Type Description fileNamestring The name of the file Throws:
Will throw if there are errors in the program or if the file can't be openedReturns:
Object - The JSON AST of the program