coan 4.2.4
The Lexicon component interface.
Collaboration diagram for The Lexicon component interface.:

Files

file  lexicon.c
file  lexicon.h

Defines

#define IF   "if"
#define IFDEF   "ifdef"
#define IFNDEF   "ifndef"
#define ELSE   "else"
#define ELIF   "elif"
#define ENDIF   "endif"
#define DEFINE   "define"
#define UNDEF   "undef"
#define INCLUDE   "include"
#define PRAGMA   "pragma"
#define ERROR   "error"
#define DEFINED   "defined"
#define BOOLEAN_OR   "||"
#define BOOLEAN_AND   "&&"
#define BIT_OR   "|"
#define BIT_XOR   "^"
#define BIT_AND   "&"
#define EQ   "=="
#define NEQ   "!="
#define LE   "<="
#define GE   ">="
#define LESS   "<"
#define GREATER   ">"
#define LSHIFT   "<<"
#define RSHIFT   ">>"
#define ADD   "+"
#define SUBTRACT   "-"
#define MULTIPLY   "*"
#define DIV   "/"
#define MOD   "%"

Functions

bool match_keyword (char const **ptxt, char const *keyword)
bool match_op (char const **ptxt, char const *op)

Define Documentation

#define ADD   "+"

Constant denoting the addition/plus operators

Definition at line 75 of file lexicon.h.

#define BIT_AND   "&"

Constant denoting the bitwise and operator

Definition at line 66 of file lexicon.h.

#define BIT_OR   "|"

Constant denoting the bitwise inclusive-or operator

Definition at line 64 of file lexicon.h.

#define BIT_XOR   "^"

Constant denoting the bitwise exclusive-or operator

Definition at line 65 of file lexicon.h.

#define BOOLEAN_AND   "&&"

Constant denoting the boolean and operator

Definition at line 63 of file lexicon.h.

#define BOOLEAN_OR   "||"

Constant denoting the boolean inclusive-or operator

Definition at line 62 of file lexicon.h.

#define DEFINE   "define"

Constant denoting the hash-define directive

Definition at line 56 of file lexicon.h.

#define DEFINED   "defined"

Constant denoting the defined operator

Definition at line 61 of file lexicon.h.

#define DIV   "/"

Constant denoting the division operator

Definition at line 78 of file lexicon.h.

#define ELIF   "elif"

Constant denoting the hash-elif directive

Definition at line 54 of file lexicon.h.

#define ELSE   "else"

Constant denoting the hash-else directive

Definition at line 53 of file lexicon.h.

#define ENDIF   "endif"

Constant denoting the hash-endif directive

Definition at line 55 of file lexicon.h.

#define EQ   "=="

Constant denoting the equality operator

Definition at line 67 of file lexicon.h.

#define ERROR   "error"

Constant denoting the hash-error directive

Definition at line 60 of file lexicon.h.

#define GE   ">="

Constant denoting the greater-than-or-equal operator

Definition at line 70 of file lexicon.h.

#define GREATER   ">"

Constant denoting the greater-than operator

Definition at line 72 of file lexicon.h.

#define IF   "if"

Constant denoting the hash-if directive

Definition at line 50 of file lexicon.h.

#define IFDEF   "ifdef"

Constant denoting the hash-ifdef directive

Definition at line 51 of file lexicon.h.

#define IFNDEF   "ifndef"

Constant denoting the hash-ifndef directive

Definition at line 52 of file lexicon.h.

#define INCLUDE   "include"

Constant denoting the hash-include directive

Definition at line 58 of file lexicon.h.

#define LE   "<="

Constant denoting the less-than-or-equal operator

Definition at line 69 of file lexicon.h.

#define LESS   "<"

Constant denoting the less-than operator

Definition at line 71 of file lexicon.h.

#define LSHIFT   "<<"

Constant denoting the left-shift operator

Definition at line 73 of file lexicon.h.

#define MOD   "%"

Constant denoting the modulus operator

Definition at line 79 of file lexicon.h.

#define MULTIPLY   "*"

Constant denoting the multiplication operator

Definition at line 77 of file lexicon.h.

#define NEQ   "!="

Constant denoting the inequality operator

Definition at line 68 of file lexicon.h.

#define PRAGMA   "pragma"

Constant denoting the hash-pragma directive

Definition at line 59 of file lexicon.h.

#define RSHIFT   ">>"

Constant denoting the right-shift operator

Definition at line 74 of file lexicon.h.

#define SUBTRACT   "-"

Constant denoting the subtraction/minus operators

Definition at line 76 of file lexicon.h.

#define UNDEF   "undef"

Constant denoting the hash-undef directive

Definition at line 57 of file lexicon.h.


Function Documentation

bool match_keyword ( char const **  ptxt,
char const *  keyword 
)

Say whether text in the line-buffer matches a preprocessor keyword

Parameters:
ptxtOn entry, a pointer to an address in the line buffer at which to match the keyword. On return, stores the address of the first byte in the line buffer not consumed in the matched text, if the text is an unambiguous occurrence of the keyword; otherwise unchanged.
keywordThe keyword to be matched.
Returns:
True if the text at *ptxt on entry is an unambiguous occurrence of keyword; else false.

Say whether text in the line-buffer matches a prepprocessor keyword

Parameters:
ptxtOn entry, a pointer to an address in the line buffer at which to match the keyword. On return, stores the address of the first byte in the line buffer not consumed by the in the matched text, if the text is an unambiguous occurrence of the keyword; otherwise unchanged.
keywordThe keyword to be matched.
Returns:
True if the text at *ptxt on entry is an unambiguous occurrence of keyword; else false.

Definition at line 97 of file lexicon.c.

References is_symbol_start_char(), and text_match().

Referenced by eval_unary(), and get_directive_type().

Here is the call graph for this function:

bool match_op ( char const **  ptxt,
char const *  op 
)

Say whether a given operator occurs at a given line-buffer position.

Parameters:
ptxtOn entry, pointer to an address in line buffer. On return, if the operator is matched, stores the first line buffer address not consumed by the match; otherwise the entry value is unchanged.
opPointer to an operator token to match.
Returns:
true iff the operator token op occurs at position txt

Definition at line 109 of file lexicon.c.

References chew_continuation().

Referenced by eval_table().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines