mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
renamed 'exp' in xlat_parser.y to 'expr' because this gets in the way of searching for calls of the exp(x) function.
This commit is contained in:
parent
9843f16cc0
commit
7edd5e2dac
1 changed files with 30 additions and 30 deletions
|
@ -30,18 +30,18 @@ external_declaration ::= NOP.
|
|||
%left MULTIPLY DIVIDE MODULUS.
|
||||
%left NEG.
|
||||
|
||||
%type exp {int}
|
||||
exp(A) ::= NUM(B). { A = B.val; }
|
||||
exp(A) ::= exp(B) PLUS exp(C). { A = B + C; }
|
||||
exp(A) ::= exp(B) MINUS exp(C). { A = B - C; }
|
||||
exp(A) ::= exp(B) MULTIPLY exp(C). { A = B * C; }
|
||||
exp(A) ::= exp(B) DIVIDE exp(C). { if (C != 0) A = B / C; else context->PrintError("Division by zero"); }
|
||||
exp(A) ::= exp(B) MODULUS exp(C). { if (C != 0) A = B % C; else context->PrintError("Division by zero"); }
|
||||
exp(A) ::= exp(B) OR exp(C). { A = B | C; }
|
||||
exp(A) ::= exp(B) AND exp(C). { A = B & C; }
|
||||
exp(A) ::= exp(B) XOR exp(C). { A = B ^ C; }
|
||||
exp(A) ::= MINUS exp(B). [NEG] { A = -B; }
|
||||
exp(A) ::= LPAREN exp(B) RPAREN. { A = B; }
|
||||
%type expr {int}
|
||||
expr(A) ::= NUM(B). { A = B.val; }
|
||||
expr(A) ::= expr(B) PLUS expr(C). { A = B + C; }
|
||||
expr(A) ::= expr(B) MINUS expr(C). { A = B - C; }
|
||||
expr(A) ::= expr(B) MULTIPLY expr(C). { A = B * C; }
|
||||
expr(A) ::= expr(B) DIVIDE expr(C). { if (C != 0) A = B / C; else context->PrintError("Division by zero"); }
|
||||
expr(A) ::= expr(B) MODULUS expr(C). { if (C != 0) A = B % C; else context->PrintError("Division by zero"); }
|
||||
expr(A) ::= expr(B) OR expr(C). { A = B | C; }
|
||||
expr(A) ::= expr(B) AND expr(C). { A = B & C; }
|
||||
expr(A) ::= expr(B) XOR expr(C). { A = B ^ C; }
|
||||
expr(A) ::= MINUS expr(B). [NEG] { A = -B; }
|
||||
expr(A) ::= LPAREN expr(B) RPAREN. { A = B; }
|
||||
|
||||
|
||||
//==========================================================================
|
||||
|
@ -50,7 +50,7 @@ exp(A) ::= LPAREN exp(B) RPAREN. { A = B; }
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
define_statement ::= DEFINE SYM(A) LPAREN exp(B) RPAREN.
|
||||
define_statement ::= DEFINE SYM(A) LPAREN expr(B) RPAREN.
|
||||
{
|
||||
context->AddSym (A.sym, B);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ single_enum ::= SYM(A).
|
|||
context->AddSym (A.sym, context->EnumVal++);
|
||||
}
|
||||
|
||||
single_enum ::= SYM(A) EQUALS exp(B).
|
||||
single_enum ::= SYM(A) EQUALS expr(B).
|
||||
{
|
||||
context->AddSym (A.sym, B);
|
||||
context->EnumVal = B+1;
|
||||
|
@ -90,19 +90,19 @@ single_enum ::= SYM(A) EQUALS exp(B).
|
|||
//==========================================================================
|
||||
|
||||
%type linetype_exp {int}
|
||||
linetype_exp(Z) ::= exp(A).
|
||||
linetype_exp(Z) ::= expr(A).
|
||||
{
|
||||
Z = static_cast<XlatParseContext *>(context)->DefiningLineType = A;
|
||||
}
|
||||
|
||||
linetype_declaration ::= linetype_exp(linetype) EQUALS exp(flags) COMMA exp(special) LPAREN special_args(arg) RPAREN.
|
||||
linetype_declaration ::= linetype_exp(linetype) EQUALS expr(flags) COMMA expr(special) LPAREN special_args(arg) RPAREN.
|
||||
{
|
||||
SimpleLineTranslations.SetVal(linetype,
|
||||
FLineTrans(special&0xffff, flags+arg.addflags, arg.args[0], arg.args[1], arg.args[2], arg.args[3], arg.args[4]));
|
||||
static_cast<XlatParseContext *>(context)->DefiningLineType = -1;
|
||||
}
|
||||
|
||||
linetype_declaration ::= linetype_exp EQUALS exp COMMA SYM(S) LPAREN special_args RPAREN.
|
||||
linetype_declaration ::= linetype_exp EQUALS expr COMMA SYM(S) LPAREN special_args RPAREN.
|
||||
{
|
||||
Printf ("%s, line %d: %s is undefined\n", context->SourceFile, context->SourceLine, S.sym);
|
||||
static_cast<XlatParseContext *>(context)->DefiningLineType = -1;
|
||||
|
@ -222,7 +222,7 @@ special_args(Z) ::= multi_special_arg(A).
|
|||
%type boom_body {MoreLines *}
|
||||
|
||||
|
||||
boom_declaration ::= LBRACKET exp(special) RBRACKET LPAREN exp(firsttype) COMMA exp(lasttype) RPAREN LBRACE boom_body(stores) RBRACE.
|
||||
boom_declaration ::= LBRACKET expr(special) RBRACKET LPAREN expr(firsttype) COMMA expr(lasttype) RPAREN LBRACE boom_body(stores) RBRACE.
|
||||
{
|
||||
int i;
|
||||
MoreLines *probe;
|
||||
|
@ -308,12 +308,12 @@ boom_selector(A) ::= ARG5. { A = 3; }
|
|||
boom_op(A) ::= EQUALS. { A = '='; }
|
||||
boom_op(A) ::= OR_EQUAL. { A = OR_EQUAL; }
|
||||
|
||||
boom_args(A) ::= exp(B).
|
||||
boom_args(A) ::= expr(B).
|
||||
{
|
||||
A.constant = B;
|
||||
A.filters = NULL;
|
||||
}
|
||||
boom_args(A) ::= exp(B) LBRACKET arg_list(C) RBRACKET.
|
||||
boom_args(A) ::= expr(B) LBRACKET arg_list(C) RBRACKET.
|
||||
{
|
||||
A.mask = B;
|
||||
A.filters = C;
|
||||
|
@ -332,7 +332,7 @@ arg_list(A) ::= list_val(B) COMMA arg_list(C).
|
|||
A->filter = B;
|
||||
}
|
||||
|
||||
list_val(A) ::= exp(B) COLON exp(C).
|
||||
list_val(A) ::= expr(B) COLON expr(C).
|
||||
{
|
||||
A.filter = B;
|
||||
A.value = C;
|
||||
|
@ -344,7 +344,7 @@ list_val(A) ::= exp(B) COLON exp(C).
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
maxlinespecial_def ::= MAXLINESPECIAL EQUALS exp(mx) SEMICOLON.
|
||||
maxlinespecial_def ::= MAXLINESPECIAL EQUALS expr(mx) SEMICOLON.
|
||||
{
|
||||
// Just kill all specials higher than the max.
|
||||
// If the translator wants to redefine some later, just let it.
|
||||
|
@ -359,36 +359,36 @@ maxlinespecial_def ::= MAXLINESPECIAL EQUALS exp(mx) SEMICOLON.
|
|||
|
||||
%type sector_op {int}
|
||||
|
||||
sector_declaration ::= SECTOR exp(from) EQUALS exp(to) SEMICOLON.
|
||||
sector_declaration ::= SECTOR expr(from) EQUALS expr(to) SEMICOLON.
|
||||
{
|
||||
FSectorTrans tr(to, true);
|
||||
SectorTranslations.SetVal(from, tr);
|
||||
}
|
||||
|
||||
sector_declaration ::= SECTOR exp EQUALS SYM(sy) SEMICOLON.
|
||||
sector_declaration ::= SECTOR expr EQUALS SYM(sy) SEMICOLON.
|
||||
{
|
||||
Printf("Unknown constant '%s'\n", sy.sym);
|
||||
}
|
||||
|
||||
sector_declaration ::= SECTOR exp(from) EQUALS exp(to) NOBITMASK SEMICOLON.
|
||||
sector_declaration ::= SECTOR expr(from) EQUALS expr(to) NOBITMASK SEMICOLON.
|
||||
{
|
||||
FSectorTrans tr(to, false);
|
||||
SectorTranslations.SetVal(from, tr);
|
||||
}
|
||||
|
||||
sector_bitmask ::= SECTOR BITMASK exp(mask) sector_op(op) exp(shift) SEMICOLON.
|
||||
sector_bitmask ::= SECTOR BITMASK expr(mask) sector_op(op) expr(shift) SEMICOLON.
|
||||
{
|
||||
FSectorMask sm = { mask, op, shift};
|
||||
SectorMasks.Push(sm);
|
||||
}
|
||||
|
||||
sector_bitmask ::= SECTOR BITMASK exp(mask) SEMICOLON.
|
||||
sector_bitmask ::= SECTOR BITMASK expr(mask) SEMICOLON.
|
||||
{
|
||||
FSectorMask sm = { mask, 0, 0};
|
||||
SectorMasks.Push(sm);
|
||||
}
|
||||
|
||||
sector_bitmask ::= SECTOR BITMASK exp(mask) CLEAR SEMICOLON.
|
||||
sector_bitmask ::= SECTOR BITMASK expr(mask) CLEAR SEMICOLON.
|
||||
{
|
||||
FSectorMask sm = { mask, 0, 1};
|
||||
SectorMasks.Push(sm);
|
||||
|
@ -399,7 +399,7 @@ sector_op(A) ::= RSHASSIGN. { A = -1; }
|
|||
|
||||
%type lineflag_op {int}
|
||||
|
||||
lineflag_declaration ::= LINEFLAG exp(from) EQUALS exp(to) SEMICOLON.
|
||||
lineflag_declaration ::= LINEFLAG expr(from) EQUALS expr(to) SEMICOLON.
|
||||
{
|
||||
if (from >= 0 && from < 16)
|
||||
{
|
||||
|
@ -408,7 +408,7 @@ lineflag_declaration ::= LINEFLAG exp(from) EQUALS exp(to) SEMICOLON.
|
|||
}
|
||||
}
|
||||
|
||||
lineflag_declaration ::= LINEFLAG exp(from) AND exp(mask) SEMICOLON.
|
||||
lineflag_declaration ::= LINEFLAG expr(from) AND expr(mask) SEMICOLON.
|
||||
{
|
||||
if (from >= 0 && from < 16)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue