diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-04 01:22:27 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-10-04 01:22:27 +0300 |
commit | 11db69e6d2b292df96845515f7df0e850b60c125 (patch) | |
tree | 9c4bb3a47ead03b6093ceed3e0142fc259a91de0 /lib/forlangrm.y | |
parent | 256d8b3572532af87ea5b28379cee709ad44cea6 (diff) | |
download | eclat-11db69e6d2b292df96845515f7df0e850b60c125.tar.gz eclat-11db69e6d2b292df96845515f7df0e850b60c125.tar.bz2 |
Implement eq/ne comparisons in forlan; Implement describe-security-groups command.
* etc/Makefile.am: Add new file.
* etc/describe-security-groups.fln: New file.
* lib/forlan.c: Implement equality and inequality comparisons.
* lib/forlan.h (forlan_opcode_eq)
(forlan_opcode_ne): New opcodes.
(FORLAN_NTYPES): New constants.
* lib/forlangrm.y: Add equality and inequality productions.
* lib/forlanlex.l: New tokens: == and !=
* src/dscrsecgrps-cl.opt: New file.
* src/dscrsecgrps.c: New file.
* src/Makefile.am: Add new files.
* src/eclat.c: Implement describe-security-groups
* src/eclat.h (eclat_describe_security_groups): New proto.
* src/cretags.c: Fix memory leaks.
* src/deltags.c: Likewise.
* src/dscrtags.c: Likewise.
* tests/describe-security-groups.at: New test case.
* tests/testsuite.at: Include new test case.
* tests/Makefile.am: Add new test case.
Diffstat (limited to 'lib/forlangrm.y')
-rw-r--r-- | lib/forlangrm.y | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/forlangrm.y b/lib/forlangrm.y index eb7fc6f..5c91f1a 100644 --- a/lib/forlangrm.y +++ b/lib/forlangrm.y @@ -64,6 +64,7 @@ free_comp(void *p) %left OR %left AND +%nonassoc EQ NE %left NOT %type <node> stmt stmt_cond stmt_expr stmt_blk cond bool node funcall arg rval @@ -152,6 +153,20 @@ bool : node $$->expr.opcode = forlan_opcode_not; $$->expr.arg[0] = $2; } + | node EQ node + { + $$ = forlan_node_create(forlan_type_expr); + $$->expr.opcode = forlan_opcode_eq; + $$->expr.arg[0] = $1; + $$->expr.arg[1] = $3; + } + | node NE node + { + $$ = forlan_node_create(forlan_type_expr); + $$->expr.opcode = forlan_opcode_ne; + $$->expr.arg[0] = $1; + $$->expr.arg[1] = $3; + } | '(' bool ')' { $$ = $2; |