Package snap.parse

Class CodeTokenizer

java.lang.Object
snap.parse.Tokenizer
snap.parse.CodeTokenizer

public class CodeTokenizer extends Tokenizer
This Tokenizer subclass supports Java/C single-line and multi-line comments.
  • Constructor Details

    • CodeTokenizer

      public CodeTokenizer()
      Constructor.
  • Method Details

    • isReadSingleLineComments

      public boolean isReadSingleLineComments()
      Returns whether tokenizer reads standard Java single line comments.
    • setReadSingleLineComments

      public void setReadSingleLineComments(boolean aValue)
      Sets whether tokenizer reads standard Java single line comments.
    • isReadMultiLineComments

      public boolean isReadMultiLineComments()
      Returns whether tokenizer reads standard Java multiple line comments.
    • setReadMultiLineComments

      public void setReadMultiLineComments(boolean aValue)
      Sets whether tokenizer reads standard Java multiple line comments.
    • getNextSpecialTokenOrToken

      public ParseToken getNextSpecialTokenOrToken()
      Returns next special token or token.
    • getNextSpecialToken

      public ParseToken getNextSpecialToken()
      Processes and returns a special token if found. If more than one in a row, returns last one, which points to previous ones.
      Overrides:
      getNextSpecialToken in class Tokenizer
    • getNextSpecialTokenImpl

      protected ParseToken getNextSpecialTokenImpl()
      Processes and returns next special token.
    • getSingleLineCommentToken

      protected ParseToken getSingleLineCommentToken()
      Processes and returns a single line comment token if next up in input.
    • getMultiLineCommentToken

      public ParseToken getMultiLineCommentToken()
      Process and return a multi-line comment if next up in input.
    • getMultiLineCommentTokenMore

      public ParseToken getMultiLineCommentTokenMore()
      Returns a token from the current char to multi-line comment termination or input end.