org.eclipse.mtl.parser.cst
Class CSTParserBlock

java.lang.Object
  extended by org.eclipse.mtl.parser.cst.CSTParserBlock

public class CSTParserBlock
extends java.lang.Object

Creates a CST node by parsing a text representing a MTL statement : 'for', 'if'...


Field Summary
protected  Sequence pElse
          To parse a 'else' sequence in the text.
protected  SequenceBlock pElseIf
          To parse a 'else if' block in the text.
protected  SequenceBlock pElseLet
          To parse a 'else let' block in the text.
protected  SequenceBlock pExpression
          To parse an OCL expression in the text.
protected  SequenceBlock pFile
          To parse a 'file' block in the text.
protected  SequenceBlock pFor
          To parse a 'for' block in the text.
protected  SequenceBlock pIf
          To parse a 'if' block in the text.
protected  SequenceBlock pLet
          To parse a 'let' block in the text.
protected  CSTParser pMTL
          The main parser.
protected  SequenceBlock pProtectedArea
          To parse a 'protected area' block in the text.
protected  SequenceBlock pTrace
          To parse a 'trace' block in the text.
protected  MTLSourceBuffer source
          The source buffer to parse.
 
Constructor Summary
CSTParserBlock(CSTParser pMTL)
          Constructor.
 
Method Summary
 void parse(int posBegin, int posEnd, Block eBlock)
          Reads the text and creates a new 'block' in the CST model.
 void parseExpressionHeader(int posBegin, int posEnd, ModelExpression eModelExpression)
          Reads the information of the 'expression' header in the text, and modifies the properties of the current CST node.
 void parseFileBody(int posBegin, int posEnd, FileBlock eFile)
          Reads the information of the 'file' body in the text, and modifies the children of the current CST node.
 void parseFileHeader(int posBegin, int posEnd, FileBlock eFile)
          Reads the information of the 'file' header in the text, and modifies the properties of the current CST node.
 void parseForBody(int posBegin, int posEnd, ForBlock eFor)
          Reads the information of the 'for' body in the text, and modifies the children of the current CST node.
 void parseForHeader(int posBegin, int posEnd, ForBlock eFor)
          Reads the information of the 'for' header in the text, and modifies the properties of the current CST node.
 void parseIfBody(int posBegin, int posEnd, IfBlock eIf)
          Reads the information of the 'if' body in the text, and modifies the children of the current CST node.
 void parseIfHeader(int posBegin, int posEnd, IfBlock eIf)
          Reads the information of the 'if' header in the text, and modifies the properties of the current CST node.
 void parseLetBody(int posBegin, int posEnd, LetBlock eLet)
          Reads the information of the 'let' body in the text, and modifies the children of the current CST node.
 void parseLetHeader(int posBegin, int posEnd, LetBlock eLet)
          Reads the information of the 'let' header in the text, and modifies the properties of the current CST node.
 void parseProtectedAreaBody(int posBegin, int posEnd, ProtectedAreaBlock eProtectedArea)
          Reads the information of the 'protected area' body in the text, and modifies the children of the current CST node.
 void parseProtectedAreaHeader(int posBegin, int posEnd, ProtectedAreaBlock eProtectedArea)
          Reads the information of the 'protected area' header in the text, and modifies the properties of the current CST node.
 void parseTraceBody(int posBegin, int posEnd, TraceBlock eTrace)
          Reads the information of the 'trace' body in the text, and modifies the children of the current CST node.
 void parseTraceHeader(int posBegin, int posEnd, TraceBlock eTrace)
          Reads the information of the 'trace' header in the text, and modifies the properties of the current CST node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pMTL

protected CSTParser pMTL
The main parser.


pTrace

protected SequenceBlock pTrace
To parse a 'trace' block in the text.


pFile

protected SequenceBlock pFile
To parse a 'file' block in the text.


pFor

protected SequenceBlock pFor
To parse a 'for' block in the text.


pIf

protected SequenceBlock pIf
To parse a 'if' block in the text.


pElseIf

protected SequenceBlock pElseIf
To parse a 'else if' block in the text.


pElse

protected Sequence pElse
To parse a 'else' sequence in the text.


pLet

protected SequenceBlock pLet
To parse a 'let' block in the text.


pElseLet

protected SequenceBlock pElseLet
To parse a 'else let' block in the text.


pProtectedArea

protected SequenceBlock pProtectedArea
To parse a 'protected area' block in the text.


pExpression

protected SequenceBlock pExpression
To parse an OCL expression in the text.


source

protected MTLSourceBuffer source
The source buffer to parse.

Constructor Detail

CSTParserBlock

public CSTParserBlock(CSTParser pMTL)
Constructor.

Parameters:
pMTL - is the main parser
Method Detail

parse

public void parse(int posBegin,
                  int posEnd,
                  Block eBlock)
Reads the text and creates a new 'block' in the CST model. It's the main method. This method is able to choose the instance of the new block to create. The given eBlock is the parent of the new block.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eBlock - will be the parent of the new block to create

parseFileHeader

public void parseFileHeader(int posBegin,
                            int posEnd,
                            FileBlock eFile)
Reads the information of the 'file' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eFile - is the current object of the CST model, it will be modified in this method

parseFileBody

public void parseFileBody(int posBegin,
                          int posEnd,
                          FileBlock eFile)
Reads the information of the 'file' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eFile - is the current object of the CST model, it will be modified in this method

parseForHeader

public void parseForHeader(int posBegin,
                           int posEnd,
                           ForBlock eFor)
Reads the information of the 'for' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eFor - is the current object of the CST model, it will be modified in this method

parseForBody

public void parseForBody(int posBegin,
                         int posEnd,
                         ForBlock eFor)
Reads the information of the 'for' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eFor - is the current object of the CST model, it will be modified in this method

parseIfHeader

public void parseIfHeader(int posBegin,
                          int posEnd,
                          IfBlock eIf)
Reads the information of the 'if' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eIf - is the current object of the CST model, it will be modified in this method

parseIfBody

public void parseIfBody(int posBegin,
                        int posEnd,
                        IfBlock eIf)
Reads the information of the 'if' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eIf - is the current object of the CST model, it will be modified in this method

parseLetHeader

public void parseLetHeader(int posBegin,
                           int posEnd,
                           LetBlock eLet)
Reads the information of the 'let' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eLet - is the current object of the CST model, it will be modified in this method

parseLetBody

public void parseLetBody(int posBegin,
                         int posEnd,
                         LetBlock eLet)
Reads the information of the 'let' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eLet - is the current object of the CST model, it will be modified in this method

parseTraceHeader

public void parseTraceHeader(int posBegin,
                             int posEnd,
                             TraceBlock eTrace)
Reads the information of the 'trace' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eTrace - is the current object of the CST model, it will be modified in this method

parseTraceBody

public void parseTraceBody(int posBegin,
                           int posEnd,
                           TraceBlock eTrace)
Reads the information of the 'trace' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eTrace - is the current object of the CST model, it will be modified in this method

parseProtectedAreaHeader

public void parseProtectedAreaHeader(int posBegin,
                                     int posEnd,
                                     ProtectedAreaBlock eProtectedArea)
Reads the information of the 'protected area' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eProtectedArea - is the current object of the CST model, it will be modified in this method

parseProtectedAreaBody

public void parseProtectedAreaBody(int posBegin,
                                   int posEnd,
                                   ProtectedAreaBlock eProtectedArea)
Reads the information of the 'protected area' body in the text, and modifies the children of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eProtectedArea - is the current object of the CST model, it will be modified in this method

parseExpressionHeader

public void parseExpressionHeader(int posBegin,
                                  int posEnd,
                                  ModelExpression eModelExpression)
Reads the information of the 'expression' header in the text, and modifies the properties of the current CST node.

Parameters:
posBegin - is the beginning index
posEnd - is the ending index
eModelExpression - is the current object of the CST model, it will be modified in this method

Copyright 2008 Obeo
All Rights Reserved.