Package org.eclipse.ease
Class AbstractCodeParser
java.lang.Object
org.eclipse.ease.AbstractCodeParser
- All Implemented Interfaces:
ICodeParser
- Direct Known Subclasses:
GroovyCodeParser
,JavaScriptCodeParser
,JVMCompiledHeaderParser
,PythonCodeParser
,RubyCodeParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractKeywords
(String comment) getHeaderComment
(InputStream stream) Default implementation to extract the first comment area from a stream.boolean
isAcceptedBeforeHeader
(String line) Verify if a line of code is accepted before the header comment section.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ease.ICodeParser
getContext
-
Field Details
-
PARAMETER_PATTERN
-
-
Constructor Details
-
AbstractCodeParser
public AbstractCodeParser()
-
-
Method Details
-
extractKeywords
-
getHeaderComment
Default implementation to extract the first comment area from a stream. Looks for block and line comments. Might be replaced by more specific implementations for dedicated languages.- 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
-