Class AbstractCodeParser

java.lang.Object
org.eclipse.ease.AbstractCodeParser
All Implemented Interfaces:
ICodeParser
Direct Known Subclasses:
GroovyCodeParser, JavaScriptCodeParser, JVMCompiledHeaderParser, PythonCodeParser, RubyCodeParser

public abstract class AbstractCodeParser extends Object implements ICodeParser
  • Field Details

    • PARAMETER_PATTERN

      public static final Pattern PARAMETER_PATTERN
  • Constructor Details

    • AbstractCodeParser

      public AbstractCodeParser()
  • Method Details

    • extractKeywords

      public static Map<String,String> extractKeywords(String comment)
    • getHeaderComment

      public String getHeaderComment(InputStream stream)
      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 interface ICodeParser
      Parameters:
      stream - code content stream
      Returns:
      comment data without decoration characters (eg: '*' at beginning of each line)
    • isAcceptedBeforeHeader

      public boolean isAcceptedBeforeHeader(String line)
      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 interface ICodeParser
      Parameters:
      line - line of code
      Returns:
      true when line is accepted before the comment header