#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include "q.h"
+#include "../lib/q.h"
#include "parser.h"
//RVALUE {NUMBER}|{PERCENT}|{NAME}|\"{STRING}\"|{DIM}
}
prefix = 0;
break;
- case LABEL:
- string_set2(&tmp, text, length-1);
+ case RAWDATA:
+ string_set2(&tmp, text+1/*:*/, length-5/*.end*/);
token.text = (char*)mem_putstring(&strings, tmp);
break;
case COMMAND:
%x BINARY
NAME [a-zA-Z_./](-*[a-zA-Z0-9_./])*
-TWIP ([0-9]+(\.([0-9]([05])?)?)?)
-NUMBER [0-9]+(\.[0-9]*)?
+TWIP (-?[0-9]+(\.([0-9]([05])?)?)?)
+NUMBER -?[0-9]+(\.[0-9]*)?
PERCENT {NUMBER}%
STRING (\\.|[^\\"\n])*
S [ \n\r\t]
{NAME}{S}*-= {s(ASSIGNMENT);prefix="<minus>";c();BEGIN(R);}
{NAME}{S}*= {s(ASSIGNMENT);c();BEGIN(R);}
<R>{ /* values which appear only on the right-hand side of assignments, like: x=50% */
- [^ \n\t\r]* {s(IDENTIFIER);c();BEGIN(0);}
+ [^ :\n\t\r]* {s(IDENTIFIER);c();BEGIN(0);}
}
\.include{S}.*\n {handleInclude(yytext, yyleng);}
\.{NAME} {s(COMMAND);c();}
-{NAME}{S}*: {s(LABEL);c();}
+:([^.]|\.[^e]|\.e[^n]|\.en[^d]|[ \n\r\t])*\.end {s(RAWDATA);c();}
{NAME} {s(IDENTIFIER);c();}
"[" {c();BEGIN(BINARY);}
{S} {c();}