Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81319 / golang2html_code_fold / lexer.lex
diff options
context:
space:
mode:
Commitaeb0d4f887a0c18c36b59acc7b5df08e62020c50 (patch)
Author
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2020-10-11 21:32:48 +0300
Committer
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2020-10-11 21:33:38 +0300
Filesb6abdc6e1810326b587f2a160f39570f1f568f27 /homework/81319/golang2html_code_fold/lexer.lex
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.tar
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.tar.gz
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.zip
Parent154b7cd30f21af1554ca26986ff1643e28857727 (diff)
Removed old homeworks
1 files changed, 0 insertions, 100 deletions
-rw-r--r--homework/81319/golang2html_code_fold/lexer.lex100
diff --git a/homework/81319/golang2html_code_fold/lexer.lex b/homework/81319/golang2html_code_fold/lexer.lex
deleted file mode 100644
index 33f27c9..0000000
--- a/homework/81319/golang2html_code_fold/lexer.lex
+++ /dev/null
@@ -1,100 +0,0 @@
-
-%{
-#include "parser.tab.h"
-#include <stdlib.h>
-int current_line = 0;
-#define YY_NO_UNISTD_H
-%}
-
-
-digit [0-9]
-id [a-zA-Z_][a-zA-Z0-9_]*
-strq '([^\']|(\\\'))*'
-strdq \"([^\"]|(\\\"))*\"
-number [1-9]{number}*
-fnumber {digit}+"."{digit}*
-
-
-%%
-
-
-{digit}+|{digit}+"."{digit}* {
- yylval.strval = yytext;
- return NUMBER;
-}
-
-break|default|func|interface|select|case|defer|go|map|struct {
- yylval.strval = yytext;
- return KEYWORD;
-}
-
-chan|else|goto|package|switch|const|fallthrough|if|range|type|continue|for|import|return|var {
- yylval.strval = yytext;
- return KEYWORD;
-}
-
-{id} {
- yylval.strval = yytext;
- return IDENTIFIER;
-}
-
-{strq} {
- yylval.strval = yytext;
- return STRING;
-}
-
-{strdq} {
- yylval.strval = yytext;
- return STRING_DQ;
-}
-
-
-"+"|"&"|"+="|"&="|"&&"|"=="|"!="|"-"|"|"|"-="|"|="|"||"|"<" {
- yylval.strval = yytext;
- return OPERATOR;
-}
-
-"<="|"["|"]"|"*"|"^"|"*="|"^="|"<-"|">"|">="|"/"|"<<"|"/=" {
- yylval.strval = yytext;
- return OPERATOR;
-}
-
-"<<="|"++"|"="|":="|","|";"|"%"|">>"|"%="|">>="|"--"|"!"|"..."|"."|":"|"&^"|"&^=" {
- yylval.strval = yytext;
- return OPERATOR;
-}
-
-[;()? \t]+ {
- yylval.strval = yytext;
- return MISC;
-}
-
-"{" {
- yylval.strval = yytext;
- return LCURLY;
-}
-
-"}" {
- yylval.strval = yytext;
- return RCURLY;
-}
-
-\n {
- ++current_line;
- yylval.strval = yytext;
- return MISC;
-}
-
-. {
- yylval.strval = yytext;
- return UNRECOGNIZED;
-}
-
-
-%%
-
-int yywrap()
-{
- return 1;
-}
-