Class TEXParser


  • public class TEXParser
    extends Object
    • Constructor Detail

      • TEXParser

        public TEXParser()
        Create a new TEXParser that uses the platform-specific newline.
      • TEXParser

        public TEXParser​(String newline)
        Create a new TEXParser that uses the specified string as a newline.
        Parameters:
        newline - The newline type that this parser will use
    • Method Detail

      • parse

        public void parse​(String content)
        Parse the given TEX content into tokens that can be then retrieved with calls to getNextToken(). Any existing tokens from previous calls to parse(String) will be discarded.
        Parameters:
        content - The TEX content to parse into tokens
      • hasNextToken

        public boolean hasNextToken()
      • getNextToken

        public TEXToken getNextToken()
        Returns the next available token and removes it from parser
        Returns:
        The next token
        Throws:
        IllegalStateException - If no more tokens are remaining
      • peekNextToken

        public TEXToken peekNextToken()
        Returns the next available token and keeps it in parser
        Returns:
        The next token null If no more tokens are remaining
      • getNewline

        public String getNewline()
      • setNewline

        public void setNewline​(String newline)