|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mtl.parser.cst.CSTParser
public class CSTParser
The main class of the CST creator. Creates a CST model from a MTL file. You just have to launch the 'parse' method...
| Field Summary | |
|---|---|
protected CSTParserBlock |
pBlock
To parse a block statement in the text : 'for', 'if'... |
protected SequenceBlock |
pBrackets
To parse a 'brackets' block in the text. |
protected Sequence |
pComma
To parse a 'comma' sequence in the text. |
protected SequenceBlock |
pComment
To parse a 'comment' block in the text. |
protected Sequence |
pGuard
To parse a 'guard' sequence in the text. |
protected SequenceBlock |
pImport
To parse an 'import' block in the text. |
protected SequenceBlock |
pLiteral
To parse a 'literal' block in the text. |
protected SequenceBlock |
pMacro
To parse a 'macro' block in the text. |
protected SequenceBlock |
pModule
To parse a 'module' block in the text. |
protected SequenceBlock |
pParenthesis
To parse a 'parenthesis' block in the text. |
protected Sequence |
pPipe
To parse a 'pipe' sequence in the text. |
protected SequenceBlock |
pQuery
To parse a 'query' block in the text. |
protected Sequence |
pSemicolon
To parse a 'semicolon' sequence in the text. |
protected SequenceBlock |
pTemplate
To parse a 'template' block in the text. |
protected MTLSourceBuffer |
source
The source buffer to parse. |
| Constructor Summary | |
|---|---|
CSTParser(MTLSourceBuffer source)
Constructor. |
|
| Method Summary | |
|---|---|
Variable |
createVariable(int posBegin,
int posEnd,
Module eModule)
Creates a new variable in the CST model by reading the following text between the given delimiters. |
protected Variable[] |
createVariablesCommaSeparator(int posBegin,
int posEnd,
Module eModule)
Creates new variables in the CST model by reading the following text between the given delimiters. |
protected Module |
getModule(org.eclipse.emf.ecore.EObject eObject)
Gets the current module for the given object of the CST model. |
CSTParserBlock |
getPBlock()
Gets the block parser, for the statement : 'for', 'if'... |
MTLSourceBuffer |
getSource()
Gets the source buffer to parse. |
Module |
parse()
Creates a CST model for the file. |
void |
parseMacroBody(int posBegin,
int posEnd,
Macro eMacro)
Reads the information of the 'macro' body in the text, and modifies the children of the current CST node. |
void |
parseMacroHeader(int posBegin,
int posEnd,
Macro eMacro)
Reads the information of the 'macro' header in the text, and modifies the properties of the current CST node. |
void |
parseModuleBody(int posBegin,
int posEnd,
Module eModule)
Reads the information of the 'module' body in the text, and modifies the children of the current CST node. |
void |
parseModuleHeader(int posBegin,
int posEnd,
Module eModule)
Reads the information of the 'module' header in the text, and modifies the properties of the current CST node. |
void |
parseQueryHeader(int posBegin,
int posEnd,
Query eQuery)
Reads the information of the 'query' header in the text, and modifies the properties of the current CST node. |
void |
parseTemplateBody(int posBegin,
int posEnd,
Template eTemplate)
Reads the information of the 'template' body in the text, and modifies the children of the current CST node. |
void |
parseTemplateHeader(int posBegin,
int posEnd,
Template eTemplate)
Reads the information of the 'template' header in the text, and modifies the properties of the current CST node. |
protected void |
setPositions(CSTNode eCSTNode,
int posBegin,
int posEnd)
To store the position in the CST node. |
protected int |
shiftInitSectionBody(int posBegin,
int posEnd,
Block eBlock)
Reads eventually the following text as a new 'init section' (header and body) in the CST model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final MTLSourceBuffer source
protected final SequenceBlock pLiteral
protected final SequenceBlock pComment
protected final SequenceBlock pParenthesis
protected final SequenceBlock pBrackets
protected final Sequence pComma
protected final Sequence pSemicolon
protected final Sequence pPipe
protected final Sequence pGuard
protected final SequenceBlock pModule
protected final SequenceBlock pImport
protected final SequenceBlock pTemplate
protected final SequenceBlock pMacro
protected final SequenceBlock pQuery
protected final CSTParserBlock pBlock
| Constructor Detail |
|---|
public CSTParser(MTLSourceBuffer source)
source - is the source buffer to parse| Method Detail |
|---|
public MTLSourceBuffer getSource()
public CSTParserBlock getPBlock()
protected void setPositions(CSTNode eCSTNode,
int posBegin,
int posEnd)
eCSTNode - is the node to updateposBegin - is the beginning indexposEnd - is the ending indexpublic Module parse()
public void parseModuleHeader(int posBegin,
int posEnd,
Module eModule)
posBegin - is the beginning indexposEnd - is the ending indexeModule - is the current object of the CST model, it will be modified in this method
public void parseModuleBody(int posBegin,
int posEnd,
Module eModule)
posBegin - is the beginning indexposEnd - is the ending indexeModule - is the current object of the CST model, it will be modified in this method
public void parseTemplateHeader(int posBegin,
int posEnd,
Template eTemplate)
posBegin - is the beginning indexposEnd - is the ending indexeTemplate - is the current object of the CST model, it will be modified in this method
protected int shiftInitSectionBody(int posBegin,
int posEnd,
Block eBlock)
posBegin - is the beginning indexposEnd - is the ending indexeBlock - is the current object of the CST model, it will be modified in this method
protected Variable[] createVariablesCommaSeparator(int posBegin,
int posEnd,
Module eModule)
posBegin - is the beginning indexposEnd - is the ending indexeModule - is the module of the CST model, it is used to get the model types...
public Variable createVariable(int posBegin,
int posEnd,
Module eModule)
posBegin - is the beginning indexposEnd - is the ending indexeModule - is the module of the CST model, it is used to get the model types...
protected Module getModule(org.eclipse.emf.ecore.EObject eObject)
eObject - is an object of the CST model
public void parseTemplateBody(int posBegin,
int posEnd,
Template eTemplate)
posBegin - is the beginning indexposEnd - is the ending indexeTemplate - is the current object of the CST model, it will be modified in this method
public void parseQueryHeader(int posBegin,
int posEnd,
Query eQuery)
posBegin - is the beginning indexposEnd - is the ending indexeQuery - is the current object of the CST model, it will be modified in this method
public void parseMacroHeader(int posBegin,
int posEnd,
Macro eMacro)
posBegin - is the beginning indexposEnd - is the ending indexeMacro - is the current object of the CST model, it will be modified in this method
public void parseMacroBody(int posBegin,
int posEnd,
Macro eMacro)
posBegin - is the beginning indexposEnd - is the ending indexeMacro - is the current object of the CST model, it will be modified in this method
|
Copyright 2008 Obeo All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||