Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Predefined Primitive Parsers

Expression

Attribute

Description

eol

Unused

Matches the end of line (\r or \n or \r\n)

eoi

Unused

Matches the end of input (first == last)

eps

Unused

Match an empty string

eps(b)

Unused

If b is true, match an empty string

lazy(fp)

Attribute of P where P is the return type of fp

Invoke fp at parse time, returning a parser p which is then called to parse.

fp

see lazy(fp) above

Equivalent to lazy[fp]

p[fa]

Attribute of p

Call semantic action, fa if p succeeds.

byte_

8 bits native endian

Matches an 8 bit binary

word

16 bits native endian

Matches a 16 bit binary

big_word

16 bits big endian

Matches a 16 bit binary

little_word

16 bits little endian

Matches a 16 bit binary

dword

32 bits native endian

Matches a 32 bit binary

big_dword

32 bits big endian

Matches a 32 bit binary

little_dword

32 bits little endian

Matches a 32 bit binary

qword

64 bits native endian

Matches a 64 bit binary

big_qword

64 bits big endian

Matches a 64 bit binary

little_qword

64 bits little endian

Matches a 64 bit binary

char_

Ch

Matches any character

char_(ch)

Ch

Matches ch

char_("c")

Ch

Matches a single char string literal, c

char_(ch, ch2)

Ch

Matches a range of chars from ch to ch2 (inclusive)

char_(chset)

Ch

Matches a character set chset

ch

Unused

Matches ch

str

Unused

Matches str

lit(ch)

Unused

Matches ch

lit(str)

Unused

Matches str

string(str)

Str

Matches str

symbols<Ch, T> sym;

N/A

Declare a symbol table, sym. Ch is the underlying char type of the symbol table keys. T is the data type associated with each key.

sym.add
    (str1, val1)
    (str2, val2)
    /*...more...*/
;

N/A

Add symbols into a symbol table, sym. val1 and val2 are optional data of type T, the data type associated with each key.

sym

T

Matches entries in the symbol table, sym. If successful, returns the data associated with the key

lexeme[a]

A

Disable skip parsing for a

nocase[a]

A

Inhibits case-sensitivity for a

omit[a]

Unused

Ignores the attribute type of a

raw[a]

boost::iterator_range<I>

Presents the transduction of a as an iterator range

repeat[a]

vector<A>

Repeat a zero or more times

repeat(N)[a]

vector<A>

Repeat a N times

repeat(N, M)[a]

vector<A>

Repeat a N to M times

repeat(N, inf)[a]

vector<A>

Repeat a N or more times

skip[a]

A

Reestablish the skipper that got inhibited by lexeme

skip(p)[a]

A

Use p as a skipper for parsing a

float_

float

Parse a floating point number into a float

double_

double

Parse a floating point number into a double

long_double

long double

Parse a floating point number into a long double

bin

unsigned

Parse a binary integer into an unsigned

oct

unsigned

Parse an octal integer into an unsigned

hex

unsigned

Parse a hexadecimal integer into an unsigned

ushort_

unsigned short

Parse an unsigned short integer

ulong_

unsigned long

Parse an unsigned long integer

uint_

unsigned int

Parse an unsigned int

ulong_long

unsigned long long

Parse an unsigned long long

short_

short

Parse a short integer

long_

long

Parse a long integer

int_

int

Parse an int

long_long

long long

Parse a long long

!a

Unused

Not predicate. Ensure that a does not match but don't move the iterator position

&a

Unused

And predicate. Ensure that a matches but don't move the iterator position

-a

optional<A>

Optional. Parse a zero or one time

*a

vector<A>

Kleene. Parse a zero or more times

+a

vector<A>

Plus. Parse a one or more times

a | b

variant<A, B>

Alternative. Parse a or b

a >> b

tuple<A, B>

Sequence. Parse a followed by b

a > b

tuple<A, B>

Expect. Parse a followed by b. b is expected to match when a matches, otherwise, an expectation_failure is thrown.

a - b

A

Difference. Parse a but not b

a || b

tuple<A, B>

Sequential Or. Parse a or b or a followed by b

a % b

vector<A>

List. Parse a delimited b one or more times

a ^ b

tuple< optional<A>, optional<B> >

Permutation. Parse a and b in any order


PrevUpHomeNext