Skip to content

Commit

Permalink
Quoted Strings now work in file format. Need to fix file output though.
Browse files Browse the repository at this point in the history
  • Loading branch information
aparent committed Jan 20, 2013
1 parent 70753e5 commit 159c888
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/QCViewer/QCLib/QCLexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ Authors: Alex Parent, Jacob Parker
#include "QCLib/utility.h"
#include <iostream>
#define SAVE_TOKEN {/*std::cout << yytext << std::endl;*/ QC_lval.string = strdup(yytext);}
#define REMOVE_QUOTES_SAVE_TOKEN {std::string s = yytext; s.erase(s.begin()); s.erase(s.end()-1); QC_lval.string = strdup(s.c_str());}
#define TOKEN(t) (QC_lval.token = t)
#define printok(t) std::cout<<t<<" "<<std::endl
%}

word [[:alnum:]\*]+
string \"([^\\\"]|\\.)*\"
digit [0-9]
int {digit}+
float {int}\.{int}
Expand Down Expand Up @@ -68,6 +70,7 @@ comment #.*
"|" return TOKEN(BAR);
"/" return TOKEN(DIV);
{num} SAVE_TOKEN; return NUM;
{string} REMOVE_QUOTES_SAVE_TOKEN; return WORD;
{word} SAVE_TOKEN; return WORD;

{whitespace}
Expand Down

0 comments on commit 159c888

Please sign in to comment.