tclCompExpr.c File Reference

#include "tclInt.h"
#include "tclCompile.h"

Go to the source code of this file.

Data Structures

struct  OpNode
struct  JumpList

Defines

#define IsOperator(l)   ((l) >= 0)
#define NotOperator(l)   ((l) < 0)
#define NODE_TYPE   0xC0
#define BINARY   0x40
#define UNARY   0x80
#define LEAF   0xC0
#define PLUS   1
#define MINUS   2
#define BAREWORD   3
#define INCOMPLETE   4
#define INVALID   5
#define NUMBER   ( LEAF | 1)
#define SCRIPT   ( LEAF | 2)
#define BOOLEAN   ( LEAF | BAREWORD)
#define BRACED   ( LEAF | 4)
#define VARIABLE   ( LEAF | 5)
#define QUOTED   ( LEAF | 6)
#define EMPTY   ( LEAF | 7)
#define UNARY_PLUS   ( UNARY | PLUS)
#define UNARY_MINUS   ( UNARY | MINUS)
#define FUNCTION   ( UNARY | BAREWORD)
#define START   ( UNARY | 4)
#define OPEN_PAREN   ( UNARY | 5)
#define NOT   ( UNARY | 6)
#define BIT_NOT   ( UNARY | 7)
#define BINARY_PLUS   ( BINARY | PLUS)
#define BINARY_MINUS   ( BINARY | MINUS)
#define COMMA   ( BINARY | 3)
#define MULT   ( BINARY | 4)
#define DIVIDE   ( BINARY | 5)
#define MOD   ( BINARY | 6)
#define LESS   ( BINARY | 7)
#define GREATER   ( BINARY | 8)
#define BIT_AND   ( BINARY | 9)
#define BIT_XOR   ( BINARY | 10)
#define BIT_OR   ( BINARY | 11)
#define QUESTION   ( BINARY | 12)
#define COLON   ( BINARY | 13)
#define LEFT_SHIFT   ( BINARY | 14)
#define RIGHT_SHIFT   ( BINARY | 15)
#define LEQ   ( BINARY | 16)
#define GEQ   ( BINARY | 17)
#define EQUAL   ( BINARY | 18)
#define NEQ   ( BINARY | 19)
#define AND   ( BINARY | 20)
#define OR   ( BINARY | 21)
#define STREQ   ( BINARY | 22)
#define STRNEQ   ( BINARY | 23)
#define EXPON   ( BINARY | 24)
#define IN_LIST   ( BINARY | 25)
#define NOT_IN_LIST   ( BINARY | 26)
#define CLOSE_PAREN   ( BINARY | 27)
#define END   ( BINARY | 28)

Enumerations

enum  OperandTypes { OT_LITERAL = -3, OT_TOKENS = -2, OT_EMPTY = -1 }
enum  Marks { MARK_LEFT, MARK_RIGHT, MARK_PARENT }
enum  Precedence {
  PREC_END = 1, PREC_START, PREC_CLOSE_PAREN, PREC_OPEN_PAREN,
  PREC_COMMA, PREC_CONDITIONAL, PREC_OR, PREC_AND,
  PREC_BIT_OR, PREC_BIT_XOR, PREC_BIT_AND, PREC_EQUAL,
  PREC_COMPARE, PREC_SHIFT, PREC_ADD, PREC_MULT,
  PREC_EXPON, PREC_UNARY
}

Functions

int Tcl_ParseExpr (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr)
void TclCompileExpr (Tcl_Interp *interp, const char *script, int numBytes, CompileEnv *envPtr, int optimize)
int TclSingleOpCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
int TclSortingOpCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
int TclVariadicOpCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
int TclNoIdentOpCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])


Define Documentation

#define AND   ( BINARY | 20)

Definition at line 258 of file tclCompExpr.c.

Referenced by TclSortingOpCmd().

#define BAREWORD   3

Definition at line 164 of file tclCompExpr.c.

#define BINARY   0x40

Definition at line 140 of file tclCompExpr.c.

Referenced by TclParseNumber(), and TclVariadicOpCmd().

#define BINARY_MINUS   ( BINARY | MINUS)

Definition at line 225 of file tclCompExpr.c.

#define BINARY_PLUS   ( BINARY | PLUS)

Definition at line 224 of file tclCompExpr.c.

#define BIT_AND   ( BINARY | 9)

Definition at line 239 of file tclCompExpr.c.

#define BIT_NOT   ( UNARY | 7)

Definition at line 220 of file tclCompExpr.c.

#define BIT_OR   ( BINARY | 11)

Definition at line 241 of file tclCompExpr.c.

#define BIT_XOR   ( BINARY | 10)

Definition at line 240 of file tclCompExpr.c.

#define BOOLEAN   ( LEAF | BAREWORD)

Definition at line 176 of file tclCompExpr.c.

#define BRACED   ( LEAF | 4)

Definition at line 177 of file tclCompExpr.c.

#define CLOSE_PAREN   ( BINARY | 27)

Definition at line 268 of file tclCompExpr.c.

#define COLON   ( BINARY | 13)

Definition at line 243 of file tclCompExpr.c.

#define COMMA   ( BINARY | 3)

Definition at line 226 of file tclCompExpr.c.

#define DIVIDE   ( BINARY | 5)

Definition at line 235 of file tclCompExpr.c.

Referenced by TclVariadicOpCmd().

#define EMPTY   ( LEAF | 7)

Definition at line 180 of file tclCompExpr.c.

#define END   ( BINARY | 28)

Definition at line 288 of file tclCompExpr.c.

#define EQUAL   ( BINARY | 18)

Definition at line 256 of file tclCompExpr.c.

#define EXPON   ( BINARY | 24)

Definition at line 262 of file tclCompExpr.c.

Referenced by TclVariadicOpCmd().

#define FUNCTION   ( UNARY | BAREWORD)

Definition at line 189 of file tclCompExpr.c.

#define GEQ   ( BINARY | 17)

Definition at line 255 of file tclCompExpr.c.

#define GREATER   ( BINARY | 8)

Definition at line 238 of file tclCompExpr.c.

#define IN_LIST   ( BINARY | 25)

Definition at line 266 of file tclCompExpr.c.

#define INCOMPLETE   4

Definition at line 167 of file tclCompExpr.c.

#define INVALID   5

Definition at line 169 of file tclCompExpr.c.

#define IsOperator (  )     ((l) >= 0)

Definition at line 79 of file tclCompExpr.c.

#define LEAF   0xC0

Definition at line 148 of file tclCompExpr.c.

#define LEFT_SHIFT   ( BINARY | 14)

Definition at line 252 of file tclCompExpr.c.

#define LEQ   ( BINARY | 16)

Definition at line 254 of file tclCompExpr.c.

#define LESS   ( BINARY | 7)

Definition at line 237 of file tclCompExpr.c.

#define MINUS   2

Definition at line 162 of file tclCompExpr.c.

#define MOD   ( BINARY | 6)

Definition at line 236 of file tclCompExpr.c.

#define MULT   ( BINARY | 4)

Definition at line 234 of file tclCompExpr.c.

#define NEQ   ( BINARY | 19)

Definition at line 257 of file tclCompExpr.c.

#define NODE_TYPE   0xC0

Definition at line 129 of file tclCompExpr.c.

#define NOT   ( UNARY | 6)

Definition at line 219 of file tclCompExpr.c.

#define NOT_IN_LIST   ( BINARY | 26)

Definition at line 267 of file tclCompExpr.c.

#define NotOperator (  )     ((l) < 0)

Definition at line 80 of file tclCompExpr.c.

#define NUMBER   ( LEAF | 1)

Definition at line 174 of file tclCompExpr.c.

#define OPEN_PAREN   ( UNARY | 5)

Definition at line 213 of file tclCompExpr.c.

#define OR   ( BINARY | 21)

Definition at line 259 of file tclCompExpr.c.

#define PLUS   1

Definition at line 160 of file tclCompExpr.c.

#define QUESTION   ( BINARY | 12)

Definition at line 242 of file tclCompExpr.c.

#define QUOTED   ( LEAF | 6)

Definition at line 179 of file tclCompExpr.c.

#define RIGHT_SHIFT   ( BINARY | 15)

Definition at line 253 of file tclCompExpr.c.

#define SCRIPT   ( LEAF | 2)

Definition at line 175 of file tclCompExpr.c.

#define START   ( UNARY | 4)

Definition at line 207 of file tclCompExpr.c.

Referenced by TclSingleOpCmd(), TclSortingOpCmd(), and TclVariadicOpCmd().

#define STREQ   ( BINARY | 22)

Definition at line 260 of file tclCompExpr.c.

#define STRNEQ   ( BINARY | 23)

Definition at line 261 of file tclCompExpr.c.

#define UNARY   0x80

Definition at line 144 of file tclCompExpr.c.

#define UNARY_MINUS   ( UNARY | MINUS)

Definition at line 188 of file tclCompExpr.c.

#define UNARY_PLUS   ( UNARY | PLUS)

Definition at line 187 of file tclCompExpr.c.

#define VARIABLE   ( LEAF | 5)

Definition at line 178 of file tclCompExpr.c.


Enumeration Type Documentation

enum Marks

Enumerator:
MARK_LEFT 
MARK_RIGHT 
MARK_PARENT 

Definition at line 111 of file tclCompExpr.c.

Enumerator:
OT_LITERAL 
OT_TOKENS 
OT_EMPTY 

Definition at line 65 of file tclCompExpr.c.

enum Precedence

Enumerator:
PREC_END 
PREC_START 
PREC_CLOSE_PAREN 
PREC_OPEN_PAREN 
PREC_COMMA 
PREC_CONDITIONAL 
PREC_OR 
PREC_AND 
PREC_BIT_OR 
PREC_BIT_XOR 
PREC_BIT_AND 
PREC_EQUAL 
PREC_COMPARE 
PREC_SHIFT 
PREC_ADD 
PREC_MULT 
PREC_EXPON 
PREC_UNARY 

Definition at line 305 of file tclCompExpr.c.


Function Documentation

int Tcl_ParseExpr ( Tcl_Interp interp,
const char *  start,
int  numBytes,
Tcl_Parse parsePtr 
)

void TclCompileExpr ( Tcl_Interp interp,
const char *  script,
int  numBytes,
CompileEnv envPtr,
int  optimize 
)

int TclNoIdentOpCmd ( ClientData  clientData,
Tcl_Interp interp,
int  objc,
Tcl_Obj *const   objv[] 
)

int TclSortingOpCmd ( ClientData  clientData,
Tcl_Interp interp,
int  objc,
Tcl_Obj *const   objv[] 
)



Generated on Wed Mar 12 12:18:28 2008 by  doxygen 1.5.1