Logo Search packages:      
Sourcecode: antlr version File versions

CharScanner Class Reference

#include <CharScanner.hpp>

Inheritance diagram for CharScanner:

TokenStream

List of all members.


Detailed Description

Superclass of generated lexers

Definition at line 79 of file CharScanner.hpp.


Public Member Functions

virtual const ANTLR_USE_NAMESPACE (std) string &getText() const
virtual const ANTLR_USE_NAMESPACE (std) string &getFilename() const
 get the filename for the file currently used
virtual void append (const ANTLR_USE_NAMESPACE(std) string &s)
virtual void append (char c)
 CharScanner (const LexerSharedInputState &state, bool case_sensitive)
 CharScanner (InputBuffer *cb, bool case_sensitive)
 CharScanner (InputBuffer &cb, bool case_sensitive)
virtual void commit ()
virtual void consume ()
virtual void consumeUntil (const BitSet &set)
virtual void consumeUntil (int c)
virtual bool getCaseSensitive () const
virtual bool getCaseSensitiveLiterals () const =0
virtual int getColumn () const
 Get the column the scanner currently is in (starts at 1).
virtual bool getCommitToPath () const
virtual InputBuffergetInputBuffer ()
virtual LexerSharedInputState getInputState ()
virtual int getLine () const
 Get the line the scanner currently is in (starts at 1).
int getTabSize () const
 Return the tabsize used by the scanner.
virtual RefToken getTokenObject () const
virtual int LA (int i)
virtual int mark ()
 Mark the current position and return a id for it.
virtual void match (const ANTLR_USE_NAMESPACE(std) string &s)
 See if input contains string 's' throw MismatchedCharException if not.
virtual void match (const BitSet &b)
virtual void match (int c)
 See if input contains character 'c' throw MismatchedCharException if not.
virtual void matchNot (int c)
virtual void matchRange (int c1, int c2)
virtual void newline ()
virtual RefToken nextToken ()=0
void panic (const ANTLR_USE_NAMESPACE(std) string &s)
 Called when a unrecoverable error is encountered.
void panic ()
 Called when a unrecoverable error is encountered.
virtual void reportError (const ANTLR_USE_NAMESPACE(std) string &s)
virtual void reportError (const RecognitionException &e)
virtual void reportWarning (const ANTLR_USE_NAMESPACE(std) string &s)
virtual void resetText ()
virtual void rewind (int pos)
 Rewind the scanner to a previously marked position.
virtual void setCaseSensitive (bool t)
virtual void setColumn (int c)
 set the column number
virtual void setCommitToPath (bool commit)
virtual void setFilename (const ANTLR_USE_NAMESPACE(std) string &f)
 Set the filename the scanner is using (used in error messages).
virtual void setInputState (LexerSharedInputState state)
virtual void setLine (int l)
 set the line number
int setTabsize (int size)
 set the tabsize. Returns the old tabsize
virtual void setText (const ANTLR_USE_NAMESPACE(std) string &s)
virtual void setTokenObjectFactory (factory_type factory)
 Set the factory for created tokens.
virtual void tab ()
virtual int testLiteralsTable (const ANTLR_USE_NAMESPACE(std) string &txt, int ttype) const
virtual int testLiteralsTable (int ttype) const
virtual int toLower (int c) const
 Override this method to get more specific case handling.
virtual void traceIn (const char *rname)
virtual void traceIndent ()
 Methods used to change tracing behavior.
virtual void traceOut (const char *rname)
virtual void uponEOF ()

Static Public Attributes

static const int EOF_CHAR = EOF

Protected Types

typedef RefToken(* factory_type )()

Protected Member Functions

 ANTLR_USE_NAMESPACE (std) map< ANTLR_USE_NAMESPACE(std) string
 ANTLR_USE_NAMESPACE (std) string text
virtual RefToken makeToken (int t)
 Create a new RefToken of type t.

Protected Attributes

RefToken _returnToken
 used to return tokens w/o using return val
bool caseSensitive
 Is this lexer case sensitive.
bool commitToPath
LexerSharedInputState inputState
 Input state, gives access to input stream, shared among different lexers.
 int
CharScannerLiteralsLess literals
bool saveConsumedInput
 flag indicating wether consume saves characters
int tabsize
 tab size the scanner uses.
factory_type tokenFactory
 Factory for tokens.
int traceDepth

Private Member Functions

 CharScanner (const CharScanner &other)
CharScanneroperator= (const CharScanner &other)

Static Private Attributes

static const int NO_CHAR = 0

Classes

class  Tracer

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index