##// END OF EJS Templates
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete tree mapping. Next step -> PCB file parsing and loading.

File last commit:

r0:bd5e6825bd26 default
r2:096591f9de09 default
Show More
lispLike.l
75 lines | 1.7 KiB | text/plain | TextLexer
%{
/* C++ string header, for string ops below */
#include <string>
#include <QString>
/* Implementation of yyFlexScanner */
#include "lispLike_scanner.h"
#include "lispLike.hpp"
/* typedef to make the returns for the tokens shorter */
typedef QIlib::lispLike_Parser::token token;
/* define to keep from re-typing the same code over and over */
#define STOKEN( x ) ( new QString( x ) )
/* define yyterminate as this instead of NULL */
//#define yyterminate() return( token::END )
/* msvc2010 requires that we exclude this header file. */
#define YY_NO_UNISTD_H
%}
%option debug
%option nodefault
%option yyclass="lispLike_Scanner"
%option noyywrap
%option c++
/* . { return yytext[0]; }*/
%%
[ \t\n]+ { }
\"[a-zA-Z0-9\-\/\(\)\. \:]+\" {
yylval->sval = STOKEN( yytext );
return( token::VALUE );
}
\([a-zA-Z0-9]+ {
yylval->sval = STOKEN( yytext );
return( token::NODE );
}
\) {
return( token::CLOSENODE );
}
[a-zA-Z0-9\-\/\.\_\~\?\*]+ {
yylval->sval = STOKEN( yytext );
return( token::VALUE );
}
\"\" {
yylval->sval = STOKEN( yytext );
return( token::VALUE );
}
.|\n {}
%%