1. Unary-Pre operators detection fixed.

2. Unary Minus operator added (now legal, worked before?).
3. GetReference operator (&). For example (a=&b; *a=3;) will set b=3.
4. Operators precedence added (C-like), much more intellectual expressions parsing.
5. Functions redefenition added, use "#name", like "func()(1); #func()(2);".


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2950 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-09-22 22:56:52 +00:00
parent f82158960d
commit b2574f6b3b
7 changed files with 221 additions and 189 deletions

View file

@ -18,8 +18,7 @@
#define ITC_FLOAT 0x000200
#define ITC_INT 0x000400
#define ITC_ARRAY 0x000800
#define ITC_VARPTR 0x001000
#define ITC_UNKNOWN 0x002000
#define ITC_UNKNOWN 0x001000
// type function
#define FTT_FLOATF (ITC_UNKNOWN << 0)
@ -72,34 +71,37 @@
#define ITF_USER 0x000400
// array items sub-types
#define ITA_DEFINE 0x000100
#define ITA_ACCESS 0x000200
#define ITA_ACCESS 0x000000
#define ITEMOPTIONS 0x0000FF
// 16 bytes structure
typedef struct __ExpressionItem ExpressionItem;
//#define EIPARAM int
#define EIPARAM ExpressionItem*
typedef struct __ExpressionItem
{
int type;
int param1;
int param2;
EIPARAM param1;
EIPARAM param2;
ExpressionItem *next;
} ExpressionItem;
typedef struct __ParseInfo
{
int SetupNewRoot;
ExpressionItem *item;
ExpressionItem *OpsStack;
ExpressionItem* &place;
ExpressionItem **root;
int SetupNewRoot;
ExpressionItem *item;
ExpressionItem *OpsStack;
ExpressionItem *&place;
ExpressionItem **root;
char valbuf[108];
} ParseInfo;
#define OPERATOR_SET_PRECEDENCE 14
typedef struct __OpStruct
{
char name[4];
char name[3];
unsigned char precedence;
unsigned short int type;
} OpStruct;
@ -149,9 +151,6 @@ typedef struct __MathFunction
#define FF_EXP 0x20 // uses exp mode (small e)
#define FF_LEXP 0x40 // uses exp mode (large E)
// parsestring options
#define PSO_STOPATDELIMETER 0x1
// RunTree options
#define RTO_NEEDCONST 0x0001
#define RTO_PREFFEREDTYPE 0xFF00