Package antlr

Class LexerGrammar


  • class LexerGrammar
    extends Grammar
    Lexer-specific grammar subclass
    • Field Detail

      • charVocabulary

        protected BitSet charVocabulary
      • testLiterals

        protected boolean testLiterals
      • caseSensitiveLiterals

        protected boolean caseSensitiveLiterals
      • caseSensitive

        protected boolean caseSensitive
        true if the lexer generates case-sensitive literals testing
      • filterMode

        protected boolean filterMode
        true if lexer is to ignore all unrecognized tokens
      • filterRule

        protected java.lang.String filterRule
        if filterMode is true, then filterRule can indicate an optional rule to use as the scarf language. If null, programmer used plain "filter=true" not "filter=rule".
    • Constructor Detail

      • LexerGrammar

        LexerGrammar​(java.lang.String className_,
                     Tool tool_,
                     java.lang.String superClass)
    • Method Detail

      • generate

        public void generate()
                      throws java.io.IOException
        Top-level call to generate the code
        Specified by:
        generate in class Grammar
        Throws:
        java.io.IOException
      • getSuperClass

        public java.lang.String getSuperClass()
        Specified by:
        getSuperClass in class Grammar
      • getTestLiterals

        public boolean getTestLiterals()
      • processArguments

        public void processArguments​(java.lang.String[] args)
        Process command line arguments. -trace have all rules call traceIn/traceOut -traceLexer have lexical rules call traceIn/traceOut -debug generate debugging output for parser debugger
        Specified by:
        processArguments in class Grammar
      • setCharVocabulary

        public void setCharVocabulary​(BitSet b)
        Set the character vocabulary used by the lexer
      • setOption

        public boolean setOption​(java.lang.String key,
                                 Token value)
        Set lexer options
        Overrides:
        setOption in class Grammar
        Parameters:
        key - The name of the option.
        value - The value to associate with the key.
        Returns:
        true if the option was a valid generic grammar option, false o/w