Warning, /kdevelop/kdevelop-pg-qt/examples/foolisp/foolisp.g is written in an unsupported language. File is not indexed.

0001 %token_stream Lexer ;
0002 
0003 %token LPAREN, RPAREN, FOO, BAR, BAZ, NUMBER, SHEBANG, STRING, IDENTIFIER ;
0004 %lexer_bits_header "QDebug"
0005 %parser_bits_header "QDebug"
0006 %input_encoding "utf32"
0007 -- %table_lexer
0008 %input_stream "KDevPG::QUtf8ToUcs4Iterator"
0009 
0010 %lexer ->
0011      
0012   "("                           LPAREN ;
0013   ")"                           RPAREN ;
0014   foo                           FOO ;
0015   bar                           BAR ;
0016   baz                           BAZ ;
0017   qux                           FOO ;
0018   quux                          BAR ;
0019   corge                         BAZ ;
0020   grault                        FOO ;
0021   garply                        BAR ;
0022   waldo                         BAZ ;
0023   fred                          FOO ;
0024   plugh                         BAR ;
0025   xyzzy                         BAZ ;
0026   thud                          FOO ;
0027   FOOBAR                        FOO ;
0028 
0029 --   "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9" -> digit ; -- Should be predefined with unicode character classes
0030   "0" | ( {digit}&{basic_latin}^"0" ) {digit}*    NUMBER ;
0031 
0032 (([({alphabetic}&{basic_latin}){greek_and_coptic}]^[a-z \x3b1-\x3b3])&{basic_latin})+        IDENTIFIER ; -- kinda exotic limitations for identifiers ;)
0033 
0034 
0035   "#!foolisp"                   SHEBANG ;
0036   [\ \n\t]+                     [: /* blank */ :] ;
0037   \" [.(\\.)^\"]* \"             STRING ;
0038   ;
0039 
0040    ?SHEBANG sexp=sexp -> start ;
0041   
0042    LPAREN #sexp=sexp* RPAREN
0043  | foo=FOO | bar=BAR | baz=BAZ | number=NUMBER | string=STRING | identifier=IDENTIFIER
0044 -> sexp ;
0045 
0046 [:
0047 void FooLisp::Parser::expectedSymbol(int /*expectedSymbol*/, const QString& name)
0048 {
0049   qDebug() << "Expected: " << name;
0050 }
0051 void FooLisp::Parser::expectedToken(int /*expected*/, qint64 /*where*/, const QString& name)
0052 {
0053   qDebug() << "Expected token: " << name;
0054 }
0055 :]