X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginsh%2Fginsh_lexer.ll;h=896c28d34a3ae38eb91fce11cd2b95eb619dfda9;hp=4194f94337af97e8ecfa155cee9c34a3c892ac61;hb=c030e24444ef604e7343bda6e88b79bbfbfe6138;hpb=646d0ad9d3f64b2437f2f55fbc007fad1cbedf86 diff --git a/ginsh/ginsh_lexer.ll b/ginsh/ginsh_lexer.ll index 4194f943..896c28d3 100644 --- a/ginsh/ginsh_lexer.ll +++ b/ginsh/ginsh_lexer.ll @@ -4,7 +4,7 @@ * This file must be processed with flex. */ /* - * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,9 @@ // Table of all used symbols sym_tab syms; +// Type of symbols to generate (real or complex) +unsigned symboltype = symbol_options::complex; + // lex input function static int ginsh_input(char *buf, int max_size); %} @@ -79,6 +82,8 @@ xyzzy return T_XYZZY; inventory return T_INVENTORY; look return T_LOOK; score return T_SCORE; +complex_symbols return T_COMPLEX_SYMBOLS; +real_symbols return T_REAL_SYMBOLS; /* comparison */ "==" return T_EQUAL; @@ -105,7 +110,11 @@ score return T_SCORE; {A}{AN}* { sym_tab::const_iterator i = syms.find(yytext); if (i == syms.end()) { - yylval = syms[yytext] = *(new symbol(yytext)); + if (symboltype == symbol_options::complex) { + yylval = syms[yytext] = *(new symbol(yytext)); + } else { + yylval = syms[yytext] = *(new symbol(yytext, symbol_options::real)); + } } else yylval = i->second; return T_SYMBOL;