TransitionLexer Struct Reference

Hand-crafted transitional syntax lexer. More...

#include <TransitionLexer.hxx>


Public Types

typedef sherpa::EnumSet< LangFlagsValuesLangFlags
 lf_block = 0x1u
 lf_version = 0x2u
enum  LangFlagsValues { lf_block = 0x1u, lf_version = 0x2u }

Public Member Functions

 KeyWord ("=", lf_block, '=')
 KeyWord ("->", lf_block, tk_FNARROW)
 KeyWord ("==", lf_block, tk_EQUALS)
 KeyWord ("and", lf_block, tk_AND)
 KeyWord ("apply", lf_block, tk_APPLY)
 KeyWord ("array", lf_block, tk_ARRAY)
 KeyWord ("ArrayRef", lf_block, tk_ARRAY_REF)
 KeyWord ("as", lf_block, tk_AS)
 KeyWord ("assert", lf_block, tk_ReservedWord)
 KeyWord ("begin", lf_block, tk_BEGIN)
 KeyWord ("bitc", lf_version, tk_BITC)
 KeyWord ("bitfield", lf_block, tk_BITFIELD)
 KeyWord ("bitsizeof", lf_block, tk_BITSIZEOF)
 KeyWord ("bool", lf_block, tk_BOOL)
 KeyWord ("boxed", lf_block, tk_BOXED)
 KeyWord ("break", lf_block, tk_ReservedWord)
 KeyWord ("ByRef", lf_block, tk_BY_REF)
 KeyWord ("case", lf_block, tk_CASE)
 KeyWord ("catch", lf_block, tk_CATCH)
 KeyWord ("char", lf_block, tk_CHAR)
 KeyWord ("check", lf_block, tk_ReservedWord)
 KeyWord ("closed", lf_block, tk_CLOSED)
 KeyWord ("cond", lf_block, tk_COND)
 KeyWord ("const", lf_block, tk_CONST)
 KeyWord ("constrain", lf_block, tk_ReservedWord)
 KeyWord ("continue", lf_block, tk_CONTINUE)
 KeyWord ("declare", lf_block, tk_DECLARE)
 KeyWord ("deep", lf_block, tk_ReservedWord)
 KeyWord ("def", lf_block, tk_DEF)
 KeyWord ("deref", lf_block, tk_DEREF)
 KeyWord ("disable", lf_block, tk_ReservedWord)
 KeyWord ("do", lf_block, tk_DO)
 KeyWord ("do*", lf_block, tk_ReservedWord)
 KeyWord ("double", lf_block, tk_DOUBLE)
 KeyWord ("dup", lf_block, tk_DUP)
 KeyWord ("else", lf_block, tk_ELSE)
 KeyWord ("enable", lf_block, tk_ReservedWord)
 KeyWord ("exception", lf_block, tk_EXCEPTION)
 KeyWord ("external", lf_block, tk_EXTERNAL)
 KeyWord ("false", lf_block, tk_FALSE)
 KeyWord ("fill", lf_block, tk_FILL)
 KeyWord ("float", lf_block, tk_FLOAT)
 KeyWord ("fn", lf_block, tk_FN)
 KeyWord ("forall", lf_block, tk_FORALL)
 KeyWord ("from", lf_block, tk_FROM)
 KeyWord ("if", lf_block, tk_IF)
 KeyWord ("import", lf_block, tk_IMPORT)
 KeyWord ("impure", lf_block, tk_IMPURE)
 KeyWord ("in", lf_block, tk_IN)
 KeyWord ("InnerRef", lf_block, tk_INNER_REF)
 KeyWord ("instance", lf_block, tk_INSTANCE)
 KeyWord ("int16", lf_block, tk_INT16)
 KeyWord ("int32", lf_block, tk_INT32)
 KeyWord ("int64", lf_block, tk_INT64)
 KeyWord ("int8", lf_block, tk_INT8)
 KeyWord ("interface", lf_block, tk_INTERFACE)
 KeyWord ("is", lf_block, tk_IS)
 KeyWord ("label", lf_block, tk_LABEL)
 KeyWord ("lambda", lf_block, tk_LAMBDA)
 KeyWord ("let", lf_block, tk_LET)
 KeyWord ("let*", lf_block, tk_ReservedWord)
 KeyWord ("letrec", lf_block, tk_LETREC)
 KeyWord ("location", lf_block, tk_ReservedWord)
 KeyWord ("loop", lf_block, tk_LOOP)
 KeyWord ("MakeVector", lf_block, tk_MAKE_VECTOR)
 KeyWord ("member", lf_block, tk_MEMBER)
 KeyWord ("method", lf_block, tk_METHOD)
 KeyWord ("mixfix", lf_block, tk_MIXFIX)
 KeyWord ("module", lf_block, tk_MODULE)
 KeyWord ("mutable", lf_block, tk_MUTABLE)
 KeyWord ("namespace", lf_block, tk_ReservedWord)
 KeyWord ("object", lf_block, tk_OBJECT)
 KeyWord ("opaque", lf_block, tk_OPAQUE)
 KeyWord ("or", lf_block, tk_OR)
 KeyWord ("otherwise", lf_block, tk_OTHERWISE)
 KeyWord ("provide", lf_block, tk_PROVIDE)
 KeyWord ("provide!", lf_block, tk_ReservedWord)
 KeyWord ("pure", lf_block, tk_PURE)
 KeyWord ("quad", lf_block, tk_QUAD)
 KeyWord ("read-only", lf_block, tk_ReservedWord)
 KeyWord ("reference", lf_block, tk_PTR)
 KeyWord ("repr", lf_block, tk_REPR)
 KeyWord ("require", lf_block, tk_ReservedWord)
 KeyWord ("reserved", lf_block, tk_RESERVED)
 KeyWord ("return", lf_block, tk_RETURN)
 KeyWord ("sensory", lf_block, tk_ReservedWord)
 KeyWord ("sizeof", lf_block, tk_SIZEOF)
 KeyWord ("string", lf_block, tk_STRING)
 KeyWord ("struct", lf_block, tk_STRUCT)
 KeyWord ("super", lf_block, tk_ReservedWord)
 KeyWord ("suspend", lf_block, tk_SUSPEND)
 KeyWord ("switch", lf_block, tk_SWITCH)
 KeyWord ("tag", lf_block, tk_TAG)
 KeyWord ("then", lf_block, tk_THEN)
 KeyWord ("throw", lf_block, tk_THROW)
 KeyWord ("trait", lf_block, tk_TRAIT)
 KeyWord ("true", lf_block, tk_TRUE)
 KeyWord ("try", lf_block, tk_TRY)
 KeyWord ("tycon", lf_block, tk_ReservedWord)
 KeyWord ("tyfn", lf_block, tk_ReservedWord)
 KeyWord ("typecase", lf_block, tk_TYPECASE)
 KeyWord ("uint16", lf_block, tk_UINT16)
 KeyWord ("uint32", lf_block, tk_UINT32)
 KeyWord ("uint64", lf_block, tk_UINT64)
 KeyWord ("uint8", lf_block, tk_UINT8)
 KeyWord ("unboxed", lf_block, tk_UNBOXED)
 KeyWord ("union", lf_block, tk_UNION)
 KeyWord ("unless", lf_block, tk_UNLESS)
 KeyWord ("until", lf_block, tk_UNTIL)
 KeyWord ("using", lf_block, tk_ReservedWord)
 KeyWord ("value-at", lf_block, tk_ReservedWord)
 KeyWord ("vector", lf_block, tk_VECTOR)
 KeyWord ("version", lf_version, tk_VERSION)
 KeyWord ("when", lf_block, tk_WHEN)
 KeyWord ("where", lf_block, tk_WHERE)
sherpa::LToken getLastToken ()
void beginBlock (const sherpa::LToken &tok)
void endBlock (const sherpa::LToken &tok)
 TransitionLexer (std::ostream &errStream, std::istream &inStream, const std::string &origin, bool commandLineInput)
 Constructor.
void ReportParseError (const sherpa::LexLoc &loc, std::string msg)
 Report parse error msg attributed to a particular location loc.
void ReportParseWarning (const sherpa::LexLoc &loc, std::string msg)
 Report parse warning msg attributed to a particular location loc.
void ReportParseError ()
 Report generic syntax error attributed to current input location.
void ReportParseError (std::string msg)
 Report parse error msg attributed to current input location.
void ReportParseWarning (std::string msg)
 Report parse warning msg attributed to current input location.
void setDebug (bool showlex)
 Issue debugging output on iff showlex is true.
void setIfIdentMode (bool arg)
 Restrict identifiers to interface identifiers iff arg is true.
int lex (ParseType *yylvalp)
 Fetch next token, return result via yylvalp.
 ~TransitionLexer ()
 Destructor.
void pushTokenBack (const sherpa::LToken &tok, bool verbose=false)
 Push a token back onto the input stream.

Data Fields

bool showNextError
boost::shared_ptr< LayoutFramelayoutStack
bool atBeginningOfLine
LangFlags currentLang
sherpa::LexLoc here
 Start position of current token.
int num_errors
 Number of parse errors incurred.
bool debug
 Whether lexer debugging output is enabled.
bool isRuntimeUoc
 True iff the current unit of compilation is part of the BitC runtime.
bool ifIdentMode
 Whether we are presently looking for identifiers that satisfy the interface identifier name restrictions.
bool isCommandLineInput
 Whether we are looking at a unit of compilation that was admitted from the command line, as opposed to one that we imported.
std::istream & inStream
 The input stream that we are processing.
std::ostream & errStream
 The error stream to which errors should be reported.
unsigned nModules
 Number of modules that we have seen in the current parse.

Data Structures

struct  KeyWord
 Structure type for keyword table. More...


Detailed Description

Hand-crafted transitional syntax lexer.

TransitionLexer is yet another variant of shap's generic hand-crafted lexer. The main job of TransitionLexer is to generate tokens (instances of LToken) and keep track of input positions in the input stream (via LexLoc). In addition, TransitionLexer serves as a holding box for some meta-information about the current unit of compilation.

Note that the inStream and errStream slots are by-reference, which means that a TransitionLexer should not survive the streams that it is processing.

Definition at line 178 of file TransitionLexer.cxx.


Member Typedef Documentation

typedef sherpa::EnumSet<LangFlagsValues> TransitionLexer::LangFlags

Definition at line 147 of file TransitionLexer.hxx.


Member Enumeration Documentation

enum TransitionLexer::LangFlagsValues

Enumerator:
lf_block 
lf_version 

Definition at line 142 of file TransitionLexer.hxx.


Constructor & Destructor Documentation

TransitionLexer::TransitionLexer ( std::ostream &  errStream,
std::istream &  inStream,
const std::string &  origin,
bool  commandLineInput 
)

Constructor.

Instantiate a new TransitionLexer drawing input from inStream and reporting errors to errStream. Use origin as the name of the containing "file" for any errors. Set commandLineInput to false if this unit of compilation was imported rather than processed from the command line or the user

Definition at line 386 of file TransitionLexer.cxx.

References currentLang, debug, ifIdentMode, inStream, isCommandLineInput, isRuntimeUoc, kwstrcmp(), lf_block, lf_version, nModules, num_errors, and showNextError.

TransitionLexer::~TransitionLexer (  )  [inline]

Destructor.

Definition at line 280 of file TransitionLexer.hxx.


Member Function Documentation

void TransitionLexer::beginBlock ( const sherpa::LToken tok  ) 

Definition at line 625 of file TransitionLexer.cxx.

References sherpa::LToken::flags, here, layoutStack, LayoutFrame::make(), TF_INSERTED, tok, and sherpa::LToken::tokType.

void TransitionLexer::endBlock ( const sherpa::LToken tok  ) 

Definition at line 650 of file TransitionLexer.cxx.

References sherpa::LToken::flags, here, layoutStack, sherpa::LToken::loc, ReportParseError(), TF_INSERTED, and tok.

sherpa::LToken TransitionLexer::getLastToken (  )  [inline]

Definition at line 124 of file TransitionLexer.hxx.

TransitionLexer::KeyWord ( "where"  ,
lf_block  ,
tk_WHERE   
)

TransitionLexer::KeyWord ( "when"  ,
lf_block  ,
tk_WHEN   
)

TransitionLexer::KeyWord ( "version"  ,
lf_version  ,
tk_VERSION   
)

TransitionLexer::KeyWord ( "vector"  ,
lf_block  ,
tk_VECTOR   
)

TransitionLexer::KeyWord ( "value-at"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "using"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "until"  ,
lf_block  ,
tk_UNTIL   
)

TransitionLexer::KeyWord ( "unless"  ,
lf_block  ,
tk_UNLESS   
)

TransitionLexer::KeyWord ( "union"  ,
lf_block  ,
tk_UNION   
)

TransitionLexer::KeyWord ( "unboxed"  ,
lf_block  ,
tk_UNBOXED   
)

TransitionLexer::KeyWord ( "uint8"  ,
lf_block  ,
tk_UINT8   
)

TransitionLexer::KeyWord ( "uint64"  ,
lf_block  ,
tk_UINT64   
)

TransitionLexer::KeyWord ( "uint32"  ,
lf_block  ,
tk_UINT32   
)

TransitionLexer::KeyWord ( "uint16"  ,
lf_block  ,
tk_UINT16   
)

TransitionLexer::KeyWord ( "typecase"  ,
lf_block  ,
tk_TYPECASE   
)

TransitionLexer::KeyWord ( "tyfn"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "tycon"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "try"  ,
lf_block  ,
tk_TRY   
)

TransitionLexer::KeyWord ( "true"  ,
lf_block  ,
tk_TRUE   
)

TransitionLexer::KeyWord ( "trait"  ,
lf_block  ,
tk_TRAIT   
)

TransitionLexer::KeyWord ( "throw"  ,
lf_block  ,
tk_THROW   
)

TransitionLexer::KeyWord ( "then"  ,
lf_block  ,
tk_THEN   
)

TransitionLexer::KeyWord ( "tag"  ,
lf_block  ,
tk_TAG   
)

TransitionLexer::KeyWord ( "switch"  ,
lf_block  ,
tk_SWITCH   
)

TransitionLexer::KeyWord ( "suspend"  ,
lf_block  ,
tk_SUSPEND   
)

TransitionLexer::KeyWord ( "super"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "struct"  ,
lf_block  ,
tk_STRUCT   
)

TransitionLexer::KeyWord ( "string"  ,
lf_block  ,
tk_STRING   
)

TransitionLexer::KeyWord ( "sizeof"  ,
lf_block  ,
tk_SIZEOF   
)

TransitionLexer::KeyWord ( "sensory"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "return"  ,
lf_block  ,
tk_RETURN   
)

TransitionLexer::KeyWord ( "reserved"  ,
lf_block  ,
tk_RESERVED   
)

TransitionLexer::KeyWord ( "require"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "repr"  ,
lf_block  ,
tk_REPR   
)

TransitionLexer::KeyWord ( "reference"  ,
lf_block  ,
tk_PTR   
)

TransitionLexer::KeyWord ( "read-only"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "quad"  ,
lf_block  ,
tk_QUAD   
)

TransitionLexer::KeyWord ( "pure"  ,
lf_block  ,
tk_PURE   
)

TransitionLexer::KeyWord ( "provide!"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "provide"  ,
lf_block  ,
tk_PROVIDE   
)

TransitionLexer::KeyWord ( "otherwise"  ,
lf_block  ,
tk_OTHERWISE   
)

TransitionLexer::KeyWord ( "or"  ,
lf_block  ,
tk_OR   
)

TransitionLexer::KeyWord ( "opaque"  ,
lf_block  ,
tk_OPAQUE   
)

TransitionLexer::KeyWord ( "object"  ,
lf_block  ,
tk_OBJECT   
)

TransitionLexer::KeyWord ( "namespace"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "mutable"  ,
lf_block  ,
tk_MUTABLE   
)

TransitionLexer::KeyWord ( "module"  ,
lf_block  ,
tk_MODULE   
)

TransitionLexer::KeyWord ( "mixfix"  ,
lf_block  ,
tk_MIXFIX   
)

TransitionLexer::KeyWord ( "method"  ,
lf_block  ,
tk_METHOD   
)

TransitionLexer::KeyWord ( "member"  ,
lf_block  ,
tk_MEMBER   
)

TransitionLexer::KeyWord ( "MakeVector"  ,
lf_block  ,
tk_MAKE_VECTOR   
)

TransitionLexer::KeyWord ( "loop"  ,
lf_block  ,
tk_LOOP   
)

TransitionLexer::KeyWord ( "location"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "letrec"  ,
lf_block  ,
tk_LETREC   
)

TransitionLexer::KeyWord ( "let*"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "let"  ,
lf_block  ,
tk_LET   
)

TransitionLexer::KeyWord ( "lambda"  ,
lf_block  ,
tk_LAMBDA   
)

TransitionLexer::KeyWord ( "label"  ,
lf_block  ,
tk_LABEL   
)

TransitionLexer::KeyWord ( "is"  ,
lf_block  ,
tk_IS   
)

TransitionLexer::KeyWord ( "interface"  ,
lf_block  ,
tk_INTERFACE   
)

TransitionLexer::KeyWord ( "int8"  ,
lf_block  ,
tk_INT8   
)

TransitionLexer::KeyWord ( "int64"  ,
lf_block  ,
tk_INT64   
)

TransitionLexer::KeyWord ( "int32"  ,
lf_block  ,
tk_INT32   
)

TransitionLexer::KeyWord ( "int16"  ,
lf_block  ,
tk_INT16   
)

TransitionLexer::KeyWord ( "instance"  ,
lf_block  ,
tk_INSTANCE   
)

TransitionLexer::KeyWord ( "InnerRef"  ,
lf_block  ,
tk_INNER_REF   
)

TransitionLexer::KeyWord ( "in"  ,
lf_block  ,
tk_IN   
)

TransitionLexer::KeyWord ( "impure"  ,
lf_block  ,
tk_IMPURE   
)

TransitionLexer::KeyWord ( "import"  ,
lf_block  ,
tk_IMPORT   
)

TransitionLexer::KeyWord ( "if"  ,
lf_block  ,
tk_IF   
)

TransitionLexer::KeyWord ( "from"  ,
lf_block  ,
tk_FROM   
)

TransitionLexer::KeyWord ( "forall"  ,
lf_block  ,
tk_FORALL   
)

TransitionLexer::KeyWord ( "fn"  ,
lf_block  ,
tk_FN   
)

TransitionLexer::KeyWord ( "float"  ,
lf_block  ,
tk_FLOAT   
)

TransitionLexer::KeyWord ( "fill"  ,
lf_block  ,
tk_FILL   
)

TransitionLexer::KeyWord ( "false"  ,
lf_block  ,
tk_FALSE   
)

TransitionLexer::KeyWord ( "external"  ,
lf_block  ,
tk_EXTERNAL   
)

TransitionLexer::KeyWord ( "exception"  ,
lf_block  ,
tk_EXCEPTION   
)

TransitionLexer::KeyWord ( "enable"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "else"  ,
lf_block  ,
tk_ELSE   
)

TransitionLexer::KeyWord ( "dup"  ,
lf_block  ,
tk_DUP   
)

TransitionLexer::KeyWord ( "double"  ,
lf_block  ,
tk_DOUBLE   
)

TransitionLexer::KeyWord ( "do*"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "do"  ,
lf_block  ,
tk_DO   
)

TransitionLexer::KeyWord ( "disable"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "deref"  ,
lf_block  ,
tk_DEREF   
)

TransitionLexer::KeyWord ( "def"  ,
lf_block  ,
tk_DEF   
)

TransitionLexer::KeyWord ( "deep"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "declare"  ,
lf_block  ,
tk_DECLARE   
)

TransitionLexer::KeyWord ( "continue"  ,
lf_block  ,
tk_CONTINUE   
)

TransitionLexer::KeyWord ( "constrain"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "const"  ,
lf_block  ,
tk_CONST   
)

TransitionLexer::KeyWord ( "cond"  ,
lf_block  ,
tk_COND   
)

TransitionLexer::KeyWord ( "closed"  ,
lf_block  ,
tk_CLOSED   
)

TransitionLexer::KeyWord ( "check"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "char"  ,
lf_block  ,
tk_CHAR   
)

TransitionLexer::KeyWord ( "catch"  ,
lf_block  ,
tk_CATCH   
)

TransitionLexer::KeyWord ( "case"  ,
lf_block  ,
tk_CASE   
)

TransitionLexer::KeyWord ( "ByRef"  ,
lf_block  ,
tk_BY_REF   
)

TransitionLexer::KeyWord ( "break"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "boxed"  ,
lf_block  ,
tk_BOXED   
)

TransitionLexer::KeyWord ( "bool"  ,
lf_block  ,
tk_BOOL   
)

TransitionLexer::KeyWord ( "bitsizeof"  ,
lf_block  ,
tk_BITSIZEOF   
)

TransitionLexer::KeyWord ( "bitfield"  ,
lf_block  ,
tk_BITFIELD   
)

TransitionLexer::KeyWord ( "bitc"  ,
lf_version  ,
tk_BITC   
)

TransitionLexer::KeyWord ( "begin"  ,
lf_block  ,
tk_BEGIN   
)

TransitionLexer::KeyWord ( "assert"  ,
lf_block  ,
tk_ReservedWord   
)

TransitionLexer::KeyWord ( "as"  ,
lf_block  ,
tk_AS   
)

TransitionLexer::KeyWord ( "ArrayRef"  ,
lf_block  ,
tk_ARRAY_REF   
)

TransitionLexer::KeyWord ( "array"  ,
lf_block  ,
tk_ARRAY   
)

TransitionLexer::KeyWord ( "apply"  ,
lf_block  ,
tk_APPLY   
)

TransitionLexer::KeyWord ( "and"  ,
lf_block  ,
tk_AND   
)

TransitionLexer::KeyWord (  ) 

TransitionLexer::KeyWord ( "->"  ,
lf_block  ,
tk_FNARROW   
)

TransitionLexer::KeyWord (  ) 

int TransitionLexer::lex ( ParseType yylvalp  ) 

Fetch next token, return result via yylvalp.

Definition at line 604 of file TransitionLexer.cxx.

References assert(), debug, sherpa::LToken::endLoc, here, sherpa::LToken::prevTokType, ParseType::tok, tok, and sherpa::LToken::tokType.

void TransitionLexer::pushTokenBack ( const sherpa::LToken tok,
bool  verbose = false 
)

Push a token back onto the input stream.

Used in some cases by layout processing.

Definition at line 804 of file TransitionLexer.cxx.

References debug, sherpa::LToken::prevTokType, and tok.

void TransitionLexer::ReportParseError ( std::string  msg  )  [inline]

Report parse error msg attributed to current input location.

Definition at line 253 of file TransitionLexer.hxx.

References sherpa::LToken::loc, and ReportParseError().

void TransitionLexer::ReportParseError (  ) 

Report generic syntax error attributed to current input location.

Definition at line 361 of file TransitionLexer.cxx.

References errStream, sherpa::LToken::loc, and num_errors.

Referenced by endBlock(), and ReportParseError().

void TransitionLexer::ReportParseError ( const sherpa::LexLoc loc,
std::string  msg 
)

Report parse error msg attributed to a particular location loc.

Definition at line 369 of file TransitionLexer.cxx.

References errStream, and num_errors.

void TransitionLexer::ReportParseWarning ( std::string  msg  )  [inline]

Report parse warning msg attributed to current input location.

Definition at line 258 of file TransitionLexer.hxx.

References sherpa::LToken::loc, and ReportParseWarning().

void TransitionLexer::ReportParseWarning ( const sherpa::LexLoc loc,
std::string  msg 
)

Report parse warning msg attributed to a particular location loc.

Definition at line 379 of file TransitionLexer.cxx.

References errStream.

Referenced by ReportParseWarning().

void TransitionLexer::setDebug ( bool  showlex  )  [inline]

Issue debugging output on iff showlex is true.

Definition at line 264 of file TransitionLexer.hxx.

References debug.

void TransitionLexer::setIfIdentMode ( bool  arg  )  [inline]

Restrict identifiers to interface identifiers iff arg is true.

Definition at line 271 of file TransitionLexer.hxx.

References ifIdentMode.


Field Documentation

bool TransitionLexer::atBeginningOfLine

Definition at line 131 of file TransitionLexer.hxx.

LangFlags TransitionLexer::currentLang

Definition at line 149 of file TransitionLexer.hxx.

Referenced by TransitionLexer().

bool TransitionLexer::debug

Whether lexer debugging output is enabled.

If debug is true, then the lexer will dump each token that it sees to the error stream.

Definition at line 167 of file TransitionLexer.hxx.

Referenced by lex(), pushTokenBack(), setDebug(), and TransitionLexer().

std::ostream& TransitionLexer::errStream

The error stream to which errors should be reported.

Definition at line 193 of file TransitionLexer.hxx.

Referenced by ReportParseError(), and ReportParseWarning().

sherpa::LexLoc TransitionLexer::here

Start position of current token.

Definition at line 152 of file TransitionLexer.hxx.

Referenced by beginBlock(), endBlock(), and lex().

bool TransitionLexer::ifIdentMode

Whether we are presently looking for identifiers that satisfy the interface identifier name restrictions.

Initially false. Toggled from the parser.

Definition at line 180 of file TransitionLexer.hxx.

Referenced by setIfIdentMode(), and TransitionLexer().

std::istream& TransitionLexer::inStream

The input stream that we are processing.

Definition at line 191 of file TransitionLexer.hxx.

Referenced by TransitionLexer().

bool TransitionLexer::isCommandLineInput

Whether we are looking at a unit of compilation that was admitted from the command line, as opposed to one that we imported.

Bug:
This is misnamed, since input from stdin in an interactive implementation should have this true as well. It should probably be called isImportInput instead (sense invert).

Definition at line 189 of file TransitionLexer.hxx.

Referenced by TransitionLexer().

bool TransitionLexer::isRuntimeUoc

True iff the current unit of compilation is part of the BitC runtime.

This alters the criteria for identifier admission. If the unit is part of the BitC runtime, it is entitled to admit symbols starting with double underscore. This is set from the parser.

Definition at line 175 of file TransitionLexer.hxx.

Referenced by TransitionLexer().

boost::shared_ptr<LayoutFrame> TransitionLexer::layoutStack

Definition at line 130 of file TransitionLexer.hxx.

Referenced by beginBlock(), and endBlock().

unsigned TransitionLexer::nModules

Number of modules that we have seen in the current parse.

Initialized to zero. This is parser state that is placed here for convenience. It is used to give every source module a unique name when multiple modules appear in a single source unit of compilation.

Definition at line 202 of file TransitionLexer.hxx.

Referenced by TransitionLexer().

int TransitionLexer::num_errors

Number of parse errors incurred.

The current parser is not particularly good at context recovery, and I don't really see much point to improving the error handling when we are likely to abandon the LISP-style surface syntax entirely. In a hypothetical future parser, we would want to check num_errors before admitting a unit of compilation into the compile phase.

Definition at line 162 of file TransitionLexer.hxx.

Referenced by ReportParseError(), and TransitionLexer().

bool TransitionLexer::showNextError

Definition at line 128 of file TransitionLexer.hxx.

Referenced by TransitionLexer().


The documentation for this struct was generated from the following files:
Generated on Fri Feb 10 07:59:21 2012 for BitC Compiler by  doxygen 1.4.7