TransitionLexer.cxx File Reference

#include <assert.h>
#include <string.h>
#include <string>
#include <unicode/uchar.h>
#include <libsherpa/utf8.hxx>
#include <libsherpa/LexLoc.hxx>
#include "BUILD/TransitionParser.hxx"
#include "TransitionLexer.hxx"
#include "LitValue.hxx"

Go to the source code of this file.

Data Structures

struct  TransitionLexer
 Hand-crafted transitional syntax lexer. More...

Defines

#define RETURN_TOKEN(tok)

Functions

const char * TransitionTokenName (int lexTokenNumber)
static int kwstrcmp (const void *vKey, const void *vCandidate)
static bool isWhiteSpace (ucs4_t c)
static bool isCharDelimiter (ucs4_t c)

Variables

static bool keywords_sorted = false
 Whether keyword table has been sorted.


Define Documentation

#define RETURN_TOKEN ( tok   ) 

Value:

do {               \
    LToken _tok = tok;                       \
    _tok.prevTokType = lastTokType;          \
    if (atBeginningOfLine) {                 \
      _tok.flags |= TF_FIRST_ON_LINE;        \
      atBeginningOfLine = false;             \
    }                                        \
    return _tok;                             \
  } while(false)

Definition at line 1073 of file TransitionLexer.cxx.


Function Documentation

static bool isCharDelimiter ( ucs4_t  c  )  [static]

Definition at line 535 of file TransitionLexer.cxx.

References isWhiteSpace().

static bool isWhiteSpace ( ucs4_t  c  )  [static]

Definition at line 521 of file TransitionLexer.cxx.

Referenced by isCharDelimiter().

static int kwstrcmp ( const void *  vKey,
const void *  vCandidate 
) [static]

Definition at line 303 of file TransitionLexer.cxx.

Referenced by TransitionLexer::TransitionLexer().

const char* TransitionTokenName ( int  lexTokenNumber  ) 


Variable Documentation

bool keywords_sorted = false [static]

Whether keyword table has been sorted.

I added this because the emacs sort-lines function doesn't do the right thing for trailing punctuation in keywords. This is true because '!' sorts lower than '"', so

"set" sorts lower than "set!

I finally got tired of forgetting to fix this by hand.

Definition at line 176 of file TransitionLexer.cxx.


Generated on Thu May 17 23:59:16 2012 for BitC Compiler by  doxygen 1.4.7