Class ManifestParser
java.lang.Object
org.eclipse.ease.lang.scriptarchive.ManifestParser
- All Implemented Interfaces:
ICodeParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContext
(IScriptEngine scriptEngine, Object resource, String contents, int position, int selectionRange) Parse the given piece of code into a language specificICompletionContext
.getHeaderComment
(InputStream stream) Parses the file for a comment section at the beginning.boolean
isAcceptedBeforeHeader
(String line) Verify if a line of code is accepted before the header comment section.
-
Constructor Details
-
ManifestParser
public ManifestParser()
-
-
Method Details
-
getHeaderComment
Description copied from interface:ICodeParser
Parses the file for a comment section at the beginning.- Specified by:
getHeaderComment
in interfaceICodeParser
- Parameters:
stream
- code content stream- Returns:
- comment data without decoration characters (eg: '*' at beginning of each line)
-
isAcceptedBeforeHeader
Description copied from interface:ICodeParser
Verify if a line of code is accepted before the header comment section. This allows special magic tokens to be placed before the header comment as some script languages depend on that.- Specified by:
isAcceptedBeforeHeader
in interfaceICodeParser
- Parameters:
line
- line of code- Returns:
true
when line is accepted before the comment header
-
getContext
public ICompletionContext getContext(IScriptEngine scriptEngine, Object resource, String contents, int position, int selectionRange) Description copied from interface:ICodeParser
Parse the given piece of code into a language specificICompletionContext
.- Specified by:
getContext
in interfaceICodeParser
- Parameters:
scriptEngine
- running script engineresource
- resource instance to be parsedcontents
- code to be parsed (only up to cursor position)position
- cursor position within contentsselectionRange
- amount of selected characters from cursor position- Returns:
ICompletionContext
with parsed information if successful,null
in case invalid syntax given.
-