Class ParseHelper
- java.lang.Object
-
- com._1c.g5.v8.dt.lcore.parser.helper.ParseHelper
-
- All Implemented Interfaces:
IParseHelper
public class ParseHelper extends Object implements IParseHelper
Special class for parse text to the right model for xtext language- See Also:
IParseHelper
-
-
Constructor Summary
Constructors Constructor Description ParseHelper()
Constructor.ParseHelper(Charset encoding)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
parse(String textToParse, org.eclipse.emf.common.util.URI uri, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
Parses text of xtext languge.<T> T
parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
Parses text of xtext languge.
-
-
-
Field Detail
-
fileExt
@Inject public String fileExt
-
-
Constructor Detail
-
ParseHelper
public ParseHelper()
Constructor. Uses "UTF-8" encoding by default
-
ParseHelper
public ParseHelper(Charset encoding)
Constructor- Parameters:
encoding
- - the encoding to use
-
-
Method Detail
-
parse
public <T> T parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
Parses text of xtext languge.
Try to useEmbeddedEditorResourceProvider
for creatingXtextResource
- Specified by:
parse
in interfaceIParseHelper
- Type Parameters:
T
- type of the root language grammar element- Parameters:
textToParse
- text of languageuri
-URI
of created resourceresourceSet
-ResourceSet
of created resourceoptions
- the load optionsoutputErrors
- empty list of output errors, will be filled with parse errors during method execution, cannot benull
- Returns:
- the root element of the language model
- Throws:
ClassCastException
- if the root language element can't be cast to T
-
parse
public <T> T parse(String textToParse, org.eclipse.emf.common.util.URI uri, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
Parses text of xtext languge.- Specified by:
parse
in interfaceIParseHelper
- Type Parameters:
T
- type of the root language grammar element- Parameters:
textToParse
- text of languageuri
-URI
of created resourceoptions
- the load optionsoutputErrors
- empty list of output errors, will be filled with parse errors during method execution, cannot benull
- Returns:
- the root element of the language model
- Throws:
ClassCastException
- if the root language element can't be cast to T
-
-