##// END OF EJS Templates
PCB Viewer is working but still WIP.
PCB Viewer is working but still WIP.

File last commit:

r6:442ac78a55ba default
r7:f3cd68e05582 default
Show More
lispLike.l
75 lines | 1.7 KiB | text/plain | TextLexer
First Init, kicad lisp-like files abstract parser done.
r0 %{
/* 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
%}
Some work on PCB parser.
r6 /*%option debug*/
First Init, kicad lisp-like files abstract parser done.
r0 %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 );
}
Sync
r3 \([a-zA-Z0-9\_]+ {
First Init, kicad lisp-like files abstract parser done.
r0 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 {}
%%