org.eclipse.mofscript.parser
Class ParserUtil

java.lang.Object
  extended by org.eclipse.mofscript.parser.ParserUtil

public class ParserUtil
extends java.lang.Object

Author:
jol Utility class that works as a proxy for the parser and the model checker.

Constructor Summary
ParserUtil()
          Default constructor
 
Method Summary
static void addMOFScriptComment(MOFScriptComment comment)
          Utility function for adding comments during parsing Used by the parser.
protected  MOFScriptSpecification doParse(java.io.Reader in, boolean primary, boolean doPostCheck, java.lang.String uri)
          Performs the parsing of a transformation and included transformations
static int getColumn()
          Gets the current column during parsing
static ExecutionManager getExecutionManager()
           
 java.lang.String getInputFileLocation()
          Retrieves the location of input files
static MofScript2Lexer getLexer()
          GEts the lexer
static int getLine()
          Gets the current line during parsing
static MofScriptModelChecker getModelChecker()
          Gets the model checker
static MOFScriptModelFactory getMofScriptModelFactory()
          Retrives an instance of the MOFScript Model Factory
 TransformationProxy getParsedTransformation()
           
static int getParserLineTracker()
          Deprecated.  
static void incrementParserLineTracker()
          Deprecated. Increments parser linef
static java.io.File lookupFileMetaModel2(java.lang.String model)
          Deprecated.  
protected  MOFScriptSpecification parse(java.io.File f)
           
 MOFScriptSpecification parse(java.io.File f, boolean doPostCheck)
           
 MOFScriptSpecification parse(java.lang.String str, boolean doPostCheck, java.lang.String uri)
          Parses the MOFScript specification 'str'
 MOFScriptSpecification parse(java.lang.String str, boolean doPostCheck, java.lang.String uri, boolean silent)
           
 MOFScriptSpecification parse(java.lang.String str, java.lang.String uri)
          Parses the MOFScript specification 'str'
 java.util.List readModelDecls(java.lang.String str)
           
static java.lang.String replaceEscapes(java.lang.String input)
           
static void resetParserLineTracker()
          Deprecated. Resets line tracker information
 void setCompilePath(java.lang.String path)
          The compilePath is given as a sequence of directory reference, separated by ';'
 void setInputFileLocation(java.lang.String location)
          Defines the location of input files
 void setMetaModelRepositoryURI(java.lang.String uri)
          Defines the metamodel repository uri location
static void setParseInfo(MOFScriptObject parseobj)
          Utiliy function for setting line and comment information on parsed objects.
static void setParseInfo(MOFScriptObject toSet, MOFScriptObject setFrom)
           
static void setParseInfo(MOFScriptObject parseobj, org.antlr.runtime.ParserRuleReturnScope rrscope)
          Utiliy function for setting line and comment information on parsed objects.
static void setParseInfo(MOFScriptObject parseobj, org.antlr.runtime.Token token)
           
protected static void setParseInfoFromToken(MOFScriptObject parseobj, java.lang.Object startToken)
           
static void setParserLine(int line)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserUtil

public ParserUtil()
Default constructor

Method Detail

setMetaModelRepositoryURI

public void setMetaModelRepositoryURI(java.lang.String uri)
Defines the metamodel repository uri location

Parameters:
uri -

setInputFileLocation

public void setInputFileLocation(java.lang.String location)
Defines the location of input files

Parameters:
location -

getInputFileLocation

public java.lang.String getInputFileLocation()
Retrieves the location of input files

Returns:

getMofScriptModelFactory

public static MOFScriptModelFactory getMofScriptModelFactory()
Retrives an instance of the MOFScript Model Factory

Returns:

setCompilePath

public void setCompilePath(java.lang.String path)
The compilePath is given as a sequence of directory reference, separated by ';'

Parameters:
path -

doParse

protected MOFScriptSpecification doParse(java.io.Reader in,
                                         boolean primary,
                                         boolean doPostCheck,
                                         java.lang.String uri)
Performs the parsing of a transformation and included transformations

Parameters:
in - The input for parsing
primary - Specifies if the given input is 'the primary transformation' rather than an imported one
postCheck - Specifies that the input should be postChecked (function usage etc)
uri - The URI of the input (i.e. the file URI).
Returns:

getParsedTransformation

public TransformationProxy getParsedTransformation()
Returns:

parse

public MOFScriptSpecification parse(java.lang.String str,
                                    java.lang.String uri)
Parses the MOFScript specification 'str'

Parameters:
str -
uri - The URI of the input
Returns:

parse

protected MOFScriptSpecification parse(java.io.File f)
Parameters:
f - The input file to parse
Returns:

parse

public MOFScriptSpecification parse(java.lang.String str,
                                    boolean doPostCheck,
                                    java.lang.String uri)
Parses the MOFScript specification 'str'

Parameters:
str -
doPostCheck - Specifies whether a post checking should be done. Should always be true called from an external party.
uri - The URI of the input
Returns:

parse

public MOFScriptSpecification parse(java.lang.String str,
                                    boolean doPostCheck,
                                    java.lang.String uri,
                                    boolean silent)
Parameters:
str -
doPostCheck -
uri -
silent -
Returns:

parse

public MOFScriptSpecification parse(java.io.File f,
                                    boolean doPostCheck)
Parameters:
f - The input file to parse
doPostCheck - Specifies if postchecking should be done or not.
Returns:

readModelDecls

public java.util.List readModelDecls(java.lang.String str)
Parameters:
str - the input part for the parser
Returns:
a list of the parameters to the transformation

getModelChecker

public static MofScriptModelChecker getModelChecker()
Gets the model checker

Returns:

getExecutionManager

public static ExecutionManager getExecutionManager()
Returns:

lookupFileMetaModel2

public static java.io.File lookupFileMetaModel2(java.lang.String model)
Deprecated. 

Parameters:
model -
Returns:

setParseInfo

public static void setParseInfo(MOFScriptObject parseobj)
Utiliy function for setting line and comment information on parsed objects. Used by the parser.

Parameters:
parseobj -

setParseInfo

public static void setParseInfo(MOFScriptObject parseobj,
                                org.antlr.runtime.ParserRuleReturnScope rrscope)
Utiliy function for setting line and comment information on parsed objects. Used by the parser.

Parameters:
parseobj -

setParseInfo

public static void setParseInfo(MOFScriptObject parseobj,
                                org.antlr.runtime.Token token)

setParseInfo

public static void setParseInfo(MOFScriptObject toSet,
                                MOFScriptObject setFrom)

setParseInfoFromToken

protected static void setParseInfoFromToken(MOFScriptObject parseobj,
                                            java.lang.Object startToken)

addMOFScriptComment

public static void addMOFScriptComment(MOFScriptComment comment)
Utility function for adding comments during parsing Used by the parser.

Parameters:
comment -

getLexer

public static MofScript2Lexer getLexer()
GEts the lexer

Returns:

getLine

public static int getLine()
Gets the current line during parsing

Returns:

getColumn

public static int getColumn()
Gets the current column during parsing

Returns:

resetParserLineTracker

public static void resetParserLineTracker()
Deprecated. Resets line tracker information


incrementParserLineTracker

public static void incrementParserLineTracker()
Deprecated. Increments parser linef


setParserLine

public static void setParserLine(int line)
Deprecated. 

Parameters:
line -

getParserLineTracker

public static int getParserLineTracker()
Deprecated. 

Returns:

replaceEscapes

public static java.lang.String replaceEscapes(java.lang.String input)