* This file must be processed with flex. */
/*
- * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2003 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
[ \t\n]+ /* skip whitespace */
\\$ /* skip line continuations */
"//".* /* skip comments starting with "//" */
+^"#".* /* skip lines starting with "#" */
^"!".* system(yytext + 1); /* execute shell command */
/* special values */
warranty return T_WARRANTY;
print return T_PRINT;
iprint return T_IPRINT;
+print_latex return T_PRINTLATEX;
+print_csrc return T_PRINTCSRC;
time return T_TIME;
xyzzy return T_XYZZY;
inventory return T_INVENTORY;
">=" return T_GREATEREQ;
/* last 1..3 expressions */
-\" return T_QUOTE;
-\"\" return T_QUOTE2;
-\"\"\" return T_QUOTE3;
-
- /* matrix delimiters */
-\[\[ return T_MATRIX_BEGIN;
-\]\] return T_MATRIX_END;
+\% return T_QUOTE;
+\%\% return T_QUOTE2;
+\%\%\% return T_QUOTE3;
/* numbers */
{D}+ |
return T_SYMBOL;
}
+ /* wildcards */
+\${D}+ yylval = wild(atoi(yytext + 1)); return T_LITERAL;
+
/* everything else */
. return *yytext;
static int ginsh_input(char *buf, int max_size)
{
int result;
+#if defined(YY_CURRENT_BUFFER)
+ if (YY_CURRENT_BUFFER->yy_is_interactive) {
+#else
if (yy_current_buffer->yy_is_interactive) {
+#endif
#ifdef HAVE_LIBREADLINE
// Do we need to read a new line?
int actual;