Class ModelUtility.CutLeadInParser

java.lang.Object
net.ssehub.easy.dslCore.ModelUtility.CutLeadInParser
Enclosing class:
ModelUtility<E extends org.eclipse.emf.ecore.EObject,R extends net.ssehub.easy.basics.modelManagement.IModel>

private static class ModelUtility.CutLeadInParser extends Object
Specific "parser" that identifies a position where to cut the headers from the content.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • CutLeadInParser

      private CutLeadInParser(InputStream in, ModelUtility.Rule... rules)
      Creates a parser instance.
      Parameters:
      in - the input stream to analyze/cut
      rules - the rules
  • Method Details

    • parse

      private String parse() throws IOException
      Parse the text and cut it.
      Returns:
      the inital or modified text
      Throws:
      IOException - if reading a character fails
    • reset

      private ModelUtility.ParseState reset(int pos)
      Resets the parser for a new top-level unit.
      Parameters:
      pos - the next position of lastStart and lastEndMatch.
      Returns:
      the next state
    • handleOut

      private ModelUtility.ParseState handleOut(char ch, ModelUtility.ParseState nextState)
      Handles fixing or appending to out.
      Parameters:
      ch - the actual character
      nextState - the next state
      Returns:
      nextState
    • enableAnalysis

      private static boolean enableAnalysis(char ch)
      Enables token/symbol analysis, i.e., are we at a meaningful separator (in CODE).
      Parameters:
      ch - the actual character
      Returns:
      true for enable analysis, false else
    • analyze

      private void analyze()
      Analyze a token/constant/value/keyword.
    • matchRules

      private void matchRules()
      Matches the rules.