LitValue Struct Reference

#include <LitValue.hxx>


Public Member Functions

std::string asString () const
 LitValue ()

Static Public Member Functions

static bool valid_char_printable (ucs4_t ucs4)
static bool valid_charpoint (ucs4_t ucs4)
static bool valid_charpunct (ucs4_t ucs4)
static unsigned validate_string (const char *s)
static long digitValue (ucs4_t, unsigned radix)
 If c is a digit character in radix radix, return its decimal value.
static ucs4_t GetEscapedCodePoint (const char *escapedLiteral)
static ucs4_t DecodeNumericCharacter (const char *s, const char **next)
static ucs4_t DecodeBlockCharacter (const char *s)
static ucs4_t DecodeStringCharacter (const char *s, const char **next)
static ucs4_t DecodeCharacter (const std::string &)

Data Fields

LiteralType litType
bool b
unsigned long c
sherpa::BigNum i
double d
std::string s

Static Public Attributes

static EscapedLiteral EscapedLiteralMap []
static const size_t EscapedLiteralMapLength

Data Structures

struct  EscapedLiteral


Detailed Description

Definition at line 56 of file LitValue.hxx.


Constructor & Destructor Documentation

LitValue::LitValue (  )  [inline]

Definition at line 94 of file LitValue.hxx.

References litType, and lt_none.


Member Function Documentation

std::string LitValue::asString (  )  const

Definition at line 409 of file LitValue.cxx.

References asciiPrintableCharacter(), b, c, d, i, litType, lt_bool, lt_char, lt_float, lt_int, lt_string, needsBackslashEscape(), and s.

Referenced by operator<<().

ucs4_t LitValue::DecodeBlockCharacter ( const char *  s  )  [static]

Definition at line 340 of file LitValue.cxx.

References DecodeNumericCharacter(), GetEscapedCodePoint(), sherpa::utf8_decode(), valid_charpoint(), and valid_charpunct().

Referenced by DecodeCharacter().

ucs4_t LitValue::DecodeCharacter ( const std::string &   )  [static]

Definition at line 380 of file LitValue.cxx.

References DecodeBlockCharacter().

Referenced by AST::makeCharLit().

ucs4_t LitValue::DecodeNumericCharacter ( const char *  s,
const char **  next 
) [static]

Definition at line 221 of file LitValue.cxx.

References digitValue().

Referenced by DecodeBlockCharacter().

ucs4_t LitValue::DecodeStringCharacter ( const char *  s,
const char **  next 
) [static]

Definition at line 272 of file LitValue.cxx.

References c, DEBUG_DECODE, GetEscapedCodePoint(), and sherpa::utf8_decode().

Referenced by toc(), and validate_string().

long LitValue::digitValue ( ucs4_t  ,
unsigned  radix 
) [static]

If c is a digit character in radix radix, return its decimal value.

Definition at line 57 of file LitValue.cxx.

Referenced by DecodeNumericCharacter().

ucs4_t LitValue::GetEscapedCodePoint ( const char *  escapedLiteral  )  [static]

Definition at line 209 of file LitValue.cxx.

References EscapedLiteralMap, EscapedLiteralMapLength, i, and s.

Referenced by DecodeBlockCharacter(), and DecodeStringCharacter().

bool LitValue::valid_char_printable ( ucs4_t  ucs4  )  [static]

Definition at line 74 of file LitValue.cxx.

Referenced by valid_charpoint().

bool LitValue::valid_charpoint ( ucs4_t  ucs4  )  [static]

Definition at line 118 of file LitValue.cxx.

References valid_char_printable().

Referenced by DecodeBlockCharacter().

bool LitValue::valid_charpunct ( ucs4_t  ucs4  )  [static]

Definition at line 127 of file LitValue.cxx.

Referenced by DecodeBlockCharacter().

unsigned LitValue::validate_string ( const char *  s  )  [static]

Definition at line 135 of file LitValue.cxx.

References assert(), c, and DecodeStringCharacter().


Field Documentation

bool LitValue::b

Definition at line 59 of file LitValue.hxx.

Referenced by asString().

unsigned long LitValue::c

Definition at line 60 of file LitValue.hxx.

Referenced by asString(), DecodeStringCharacter(), and validate_string().

double LitValue::d

Definition at line 62 of file LitValue.hxx.

Referenced by asString().

LitValue::EscapedLiteral LitValue::EscapedLiteralMap [static]

Initial value:

 {
  ESCAPED_LITERAL("space", ' '),
  ESCAPED_LITERAL("linefeed", '\n'),
  SINGLE_LITERAL("n", '\n' ),
  ESCAPED_LITERAL("return", '\r'),
  SINGLE_LITERAL("r", '\r' ),
  ESCAPED_LITERAL("tab", '\t'),
  SINGLE_LITERAL("t", '\t' ),
  ESCAPED_LITERAL("backspace", '\b'),
  SINGLE_LITERAL("b", '\b' ),
  ESCAPED_LITERAL("formfeed", '\f'),
  SINGLE_LITERAL("f", '\f' ),
  SINGLE_LITERAL("s", ' ' ),
  ESCAPED_LITERAL("backslash", '\\'),
  SINGLE_LITERAL("\\", '\\' ),
  ESCAPED_LITERAL("dquote", '\"'),
  SINGLE_LITERAL("\"", '\"' ),
  ESCAPED_LITERAL("squote", '\''),

}

Definition at line 83 of file LitValue.hxx.

Referenced by GetEscapedCodePoint().

const size_t LitValue::EscapedLiteralMapLength [static]

Initial value:

Definition at line 84 of file LitValue.hxx.

Referenced by GetEscapedCodePoint().

sherpa::BigNum LitValue::i

Definition at line 61 of file LitValue.hxx.

Referenced by asString(), and GetEscapedCodePoint().

LiteralType LitValue::litType

Definition at line 57 of file LitValue.hxx.

Referenced by asString(), and LitValue().

std::string LitValue::s

Definition at line 76 of file LitValue.hxx.

Referenced by asString(), and GetEscapedCodePoint().


The documentation for this struct was generated from the following files:
Generated on Sat Feb 4 23:59:29 2012 for BitC Compiler by  doxygen 1.4.7