Package ortus.boxlang.compiler.parser
Class BoxTemplateParser
java.lang.Object
ortus.boxlang.compiler.parser.AbstractParser
ortus.boxlang.compiler.parser.BoxTemplateParser
-
Field Summary
FieldsFields inherited from class ortus.boxlang.compiler.parser.AbstractParser
comments, errorListener, file, issues, sourceCode, sourceToParse, startColumn, startLine, subParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParse a fileParse a cf script string expressionparseBoxExpression
(String code, Position position) parseBoxStatements
(String code, Position position) protected BoxNode
parserFirstStage
(InputStream inputStream, Boolean classOrInterface) Fist stage parsersetSubParser
(boolean subParser) protected BoxTemplate
Methods inherited from class ortus.boxlang.compiler.parser.AbstractParser
addErrorListeners, createOffsetPosition, createPosition, extractMultiLineCommentText, getComments, getInputStream, getPosition, getPosition, getPosition, getPosition, getPosition, getPositionStartingAt, getPositionStartingAt, getSourceText, getSourceText, getSourceText, getSourceText, getSourceText, isSubParser
-
Field Details
-
componentService
-
-
Constructor Details
-
BoxTemplateParser
public BoxTemplateParser() -
BoxTemplateParser
public BoxTemplateParser(int startLine, int startColumn)
-
-
Method Details
-
parse
Description copied from class:AbstractParser
Parse a file- Specified by:
parse
in classAbstractParser
- Parameters:
file
- source file to parse- Returns:
- a ParsingResult containing the AST with a BoxScript as root and the list of errors (if any)
- Throws:
IOException
- See Also:
-
parse
- Throws:
IOException
-
parse
Description copied from class:AbstractParser
Parse a cf script string expression- Specified by:
parse
in classAbstractParser
- Parameters:
code
- source of the expression to parse- Returns:
- a ParsingResult containing the AST with a BoxExpr as root and the list of errors (if any)
- Throws:
IOException
- See Also:
-
parserFirstStage
protected BoxNode parserFirstStage(InputStream inputStream, Boolean classOrInterface) throws IOException Description copied from class:AbstractParser
Fist stage parser- Specified by:
parserFirstStage
in classAbstractParser
- Parameters:
inputStream
- input stream (file or string) of the source codeclassOrInterface
- true if the code is a class or interface as opposed to just a list of statements- Returns:
- the ANTLR ParserRule representing the parse tree of the code
- Throws:
IOException
- io error
-
toAst
protected BoxTemplate toAst(File file, ortus.boxlang.parser.antlr.BoxTemplateGrammar.TemplateContext rule) throws IOException - Throws:
IOException
-
parseBoxExpression
-
parseBoxStatements
-
setSubParser
- Overrides:
setSubParser
in classAbstractParser
-