diff --git a/src/olm.cpp b/src/olm.cpp index 04a083c36d26f7b0c09682af6e8aae11f8467252..a0d9926d4728600920bc89681d775e58363ab09c 100644 --- a/src/olm.cpp +++ b/src/olm.cpp @@ -8,9 +8,6 @@ #include <stdlib.h> #include <stdio.h> #include <iostream> - -#include <string> -#include <vector> #include <algorithm> using namespace std; diff --git a/src/opr.cpp b/src/opr.cpp index 0d9957faa4c7b4240a495d324f0c7a9f0ab81a0f..0604b730151d4a1fe9c15e7d24f7c1f57bbc06b7 100644 --- a/src/opr.cpp +++ b/src/opr.cpp @@ -7,8 +7,6 @@ #include <math.h> #include <stdlib.h> -#include <string> -#include <vector> using namespace std; #include "mystd.h" diff --git a/src/r-temp.cpp b/src/r-temp.cpp index 36a88b225a78f4471921d99915cda34ec0e8774e..f87534bf06cadffd8d48e33b1aea71f497ffe650 100644 --- a/src/r-temp.cpp +++ b/src/r-temp.cpp @@ -1,8 +1,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <string> -#include <vector> #include <algorithm> #include "mystd.h" diff --git a/src/rssm.cpp b/src/rssm.cpp index ac14ff54f919f561c1bfce1d150d69841ddb596e..b046d30f25241da0824c6eb1ac3a5e8e3daa1552 100644 --- a/src/rssm.cpp +++ b/src/rssm.cpp @@ -9,8 +9,6 @@ #include <stdio.h> #include <time.h> -#include <string> -#include <vector> #include <algorithm> #include <libxml/xmlmemory.h> diff --git a/src/scan.cpp b/src/scan.cpp index a1fcfb94a2018e0305d95dd0a98159adc3d686b0..a319b0ead993d2e281c9892f2dcd042f45c7f04c 100644 --- a/src/scan.cpp +++ b/src/scan.cpp @@ -10,8 +10,6 @@ #include <string.h> #include <math.h> #include <iostream> -#include <string> -#include <vector> #include "mystd.h" #include "range.h" diff --git a/src/xax.l b/src/xax.l index 7597911b99a950f10fc4c7fce843577c29b7049b..ea476bdd7fa6b2bcbb266efcbb1c40fa69f00f95 100644 --- a/src/xax.l +++ b/src/xax.l @@ -64,7 +64,6 @@ e { "mod" { return BOP_MOD; } /* man 3 fmod */ "div" { return BOP_DIV; } /* integer division */ "over" { return BOP_OVER; } /* binomial coefficient: n over k */ -"in" { return BOP_IN; } {ID} { // printf( "lex: An identifier: %s\n", xaxtext ); diff --git a/src/xax.y b/src/xax.y index d0ea5ca6ab42489417e072d5271a2efabfc3c88d..f9b7b77367ef15460f660e1ba660b1f635034908 100644 --- a/src/xax.y +++ b/src/xax.y @@ -9,7 +9,7 @@ using namespace std; #include <string.h> #include <stdlib.h> #include <string> -#include <vector> +#include <vector> // for expr.h #include "coord.h" #include "func.h" #include "expr.h" @@ -23,7 +23,6 @@ double val; void* ptr; CTree* tree; CRef* ref; -vector<CTree*>* vtree; } %pure-parser @@ -38,11 +37,10 @@ int xaxlex(YYSTYPE *xaxlval); /* created by lex.l */ /* tokens created by lex.l: */ %token <val> NUM -%token <ptr> REF ARG FRF FNCT END BOP_EQ BOP_NE BOP_GT BOP_GE BOP_LT BOP_LE BOP_AND BOP_OR BOP_XOR BOP_OVER BOP_IN +%token <ptr> REF ARG FRF FNCT END BOP_EQ BOP_NE BOP_GT BOP_GE BOP_LT BOP_LE BOP_AND BOP_OR BOP_XOR BOP_OVER /* tokens created here: */ %type <tree> exp rex -%type <vtree> arr list %type <ref> iva ifu /* {indexed} variable|function */ /* Operator precedence */ @@ -98,23 +96,12 @@ exp: /* double-valued expression */ | exp BOP_MOD exp { $$ = new CTree(NFunctions::find("mod"), $1, $3); } | exp BOP_DIV exp { $$ = new CTree(NFunctions::find("idiv"),$1, $3); } | exp BOP_OVER exp { $$ = new CTree(NFunctions::find("over"),$1, $3); } - | exp BOP_IN arr { $$ = new CTree(NFunctions::find("in"), $1, $3); } | '!' exp { $$ = new CTree(NFunctions::find("!"), $2); } | exp '?' exp ':' exp { $$ = new CTree(NFunctions::find("?:"), $1, $3, $5); } | '(' exp ')' { $$ = $2; } ; -arr: - '[' list ']' { $$ = $2; } -; - -list: - exp { $$ = new vector<CTree*>; $$->push_back($1); } - | list ',' exp { $$ = $1; $$->push_back($3); } -; - - iva: /* indexed variable */ REF { $$ = new CRef(string((const char*)$1)); } | REF '[' rex ']' { $$ = new CRef(string((const char*)$1), $3); }