Méthode | Description | |
---|---|---|
Parse ( ) : |
Parses javascript source code.
|
|
Parser ( ScriptEngine engine, |
Creates a Parser instance with the given lexer supplying the tokens.
|
Méthode | Description | |
---|---|---|
AtValidEndOfStatement ( ) : bool |
Returns a value that indicates whether the current position is a valid position to end a statement.
|
|
CheckASTValidity ( Jurassic.Compiler.Expression root ) : void |
Checks the given AST is valid.
|
|
Consume ( ParserExpressionState expressionState = ParserExpressionState.Literal ) : void |
Discards the current token and reads the next one.
|
|
CreateFunctionBodyParser ( |
Creates a parser that can read the body of a function.
|
|
CreateScopeContext ( |
Sets the current scope and returns an object which can be disposed to restore the previous scope.
|
|
Expect ( Jurassic.Compiler.Token token ) : void |
Indicates that the next token is identical to the given one. Throws an exception if this is not the case. Consumes the token.
|
|
ExpectEndOfStatement ( ) : void |
Indicates that the next token should end the current statement. This implies that the next token is a semicolon, right brace or a line terminator.
|
|
ExpectIdentifier ( ) : string |
Indicates that the next token should be an identifier. Throws an exception if this is not the case. Consumes the token.
|
|
InitializeOperatorLookup ( ) : Operator>.Dictionary |
Initializes the token -> operator mapping dictionary.
|
|
OperatorFromToken ( Jurassic.Compiler.Token token, bool postfixOrInfix ) : Jurassic.Compiler.Operator |
Finds a operator given a token and an indication whether the prefix or infix/postfix version is desired.
|
|
ParseArrayLiteral ( ) : |
Parses an array literal (e.g. "[1, 2]").
|
|
ParseBlock ( ) : Jurassic.Compiler.BlockStatement |
Parses a block of statements. The value of a block statement is the value of the last statement in the block, or undefined if there are no statements in the block. |
|
ParseBreak ( ) : Jurassic.Compiler.BreakStatement |
Parses a break statement.
|
|
ParseContinue ( ) : Jurassic.Compiler.ContinueStatement |
Parses a continue statement.
|
|
ParseDebugger ( ) : Jurassic.Compiler.DebuggerStatement |
Parses a debugger statement.
|
|
ParseDo ( ) : Jurassic.Compiler.DoWhileStatement |
Parses a do statement.
|
|
ParseEmpty ( ) : |
Parses an empty statement.
|
|
ParseExpression ( ) : Jurassic.Compiler.Expression |
Parses a javascript expression.
|
|
ParseFor ( ) : |
Parses a for statement, for-in statement, or a for-of statement.
|
|
ParseFunction ( FunctionDeclarationType functionType, |
Parses a function declaration or a function expression.
|
|
ParseFunctionArguments ( Jurassic.Compiler.Token endToken ) : List |
Parses a comma-separated list of function arguments.
|
|
ParseFunctionDeclaration ( ) : |
Parses a function declaration.
|
|
ParseFunctionExpression ( ) : Jurassic.Compiler.FunctionExpression |
Parses a function expression.
|
|
ParseIf ( ) : Jurassic.Compiler.IfStatement |
Parses an if statement.
|
|
ParseLabelOrExpressionStatement ( ) : |
Parses a statement consisting of an expression or starting with a label. These two cases are disambiguated here.
|
|
ParseObjectLiteral ( ) : |
Parses an object literal (e.g. "{a: 5}").
|
|
ParseReturn ( ) : Jurassic.Compiler.ReturnStatement |
Parses a return statement.
|
|
ParseStatement ( ) : |
Parses any statement other than a function declaration.
|
|
ParseStatementNoNewContext ( ) : |
Parses any statement other than a function declaration, without beginning a new statement context.
|
|
ParseSwitch ( ) : Jurassic.Compiler.SwitchStatement |
Parses a switch statement.
|
|
ParseTemplateLiteral ( ) : Jurassic.Compiler.Expression |
Parses a template literal (e.g. `Bought ${count} items`).
|
|
ParseThrow ( ) : Jurassic.Compiler.ThrowStatement |
Parses a throw statement.
|
|
ParseTry ( ) : Jurassic.Compiler.TryCatchFinallyStatement |
Parses a try statement.
|
|
ParseVarLetOrConst ( |
Parses a var, let or const statement.
|
|
ParseWhile ( ) : Jurassic.Compiler.WhileStatement |
Parses a while statement.
|
|
ParseWith ( ) : Jurassic.Compiler.WithStatement |
Parses a with statement.
|
|
ReadPropertyNameExpression ( PropertyNameType &nameType ) : Jurassic.Compiler.Expression |
Reads a property name, used in object literals.
|
|
SetInitialScope ( |
Sets the initial scope.
|
|
ValidateVariableName ( string name ) : void |
Throws an exception if the variable name is invalid.
|
public Parser ( ScriptEngine engine, |
||
engine | ScriptEngine | The associated script engine. |
lexer | The lexical analyser that provides the tokens. | |
initialScope | The initial variable scope. | |
options | Jurassic.Compiler.CompilerOptions | Options that influence the compiler. |
context | CodeContext | The context of the code (global, function or eval). |
methodOptimizationHints | Jurassic.Compiler.MethodOptimizationHints | Hints about whether optimization is possible. |
Résultat | System |