Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81270 / js2html / js2html.flex
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/81270/js2html/js2html.flex
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.tar
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.tar.gz
IPL-aeb0d4f887a0c18c36b59acc7b5df08e62020c50.zip
Parent154b7cd30f21af1554ca26986ff1643e28857727 (diff)
Removed old homeworks
1 files changed, 0 insertions, 99 deletions
-rw-r--r--homework/81270/js2html/js2html.flex99
diff --git a/homework/81270/js2html/js2html.flex b/homework/81270/js2html/js2html.flex
deleted file mode 100644
index 7aef857..0000000
--- a/homework/81270/js2html/js2html.flex
+++ /dev/null
@@ -1,99 +0,0 @@
-%{
-#include "Common.h"
-#include "Token.h"
-#include "Highlighter.h"
-
-IPLVector<Token> tokens;
-%}
-
-LineTerminator \n|\r|\r\n
-
-Whitespace \t+
-
-SingleLineComment \/\/.*
-
-MultiLineComment \/\*{1,2}[^\*]+\*\/
-
-Comment {SingleLineComment}|{MultiLineComment}
-
-Keyword break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|function|if|import|in|of|instanceof|new|return|super|switch|this|throw|try|typeof|var|void|while|with|module
-
-BooleanLiteral true|false
-
-DecimalDigits [0-9]+
-
-SignedInteger {DecimalDigits}|\+{DecimalDigits}|\-{DecimalDigits}
-
-ExponentPart e{SignedInteger}|E{SignedInteger}
-
-DecimalLiteral {DecimalDigits}\.{DecimalDigits}?{ExponentPart}?|\.{DecimalDigits}{ExponentPart}?|{DecimalDigits}{ExponentPart}?
-
-NumericLiteral {DecimalLiteral}
-
-SingleQuoteString '([^\']|(\\\'))*'
-
-DoubleQuoteString \"([^\"]|(\\\"))*\"
-
-StringLiteral {SingleQuoteString}|{DoubleQuoteString}
-
-TemplateLiteral `([^`]|(\\`))*`
-
-Regex \/[^\/]+\/[gimuy]*
-
-Identifier [a-zA-Z_$][a-zA-Z0-9_$]*
-
-Global Infinity|NaN|undefined|null|eval|isNaN|parseFloat|parseInt|Object|Function|Boolean|Symbol|Error|Number|Math|Date|String|RegExp|Array|Map|Set|JSON|Promise|arguments
-
-%%
-
-{Whitespace} { tokens.emplace_back(Whitespace, yytext); }
-
-{LineTerminator} { tokens.emplace_back(NewLine, yytext); }
-
-{Comment} { tokens.emplace_back(Comment, yytext); }
-
-{Keyword} { tokens.emplace_back(Keyword, yytext); }
-
-{BooleanLiteral} { tokens.emplace_back(BooleanLiteral, yytext); }
-
-{NumericLiteral} { tokens.emplace_back(NumericLiteral, yytext); }
-
-{StringLiteral} { tokens.emplace_back(StringLiteral, yytext); }
-
-{TemplateLiteral} { tokens.emplace_back(TemplateLiteral, yytext); }
-
-{Regex} { tokens.emplace_back(Regex, yytext); }
-
-{Global} { tokens.emplace_back(Global, yytext); }
-
-{Identifier} { tokens.emplace_back(Identifier, yytext); }
-
-. { tokens.emplace_back(Raw, yytext); }
-
-
-%%
-
-int yywrap()
-{
- return 1;
-}
-
-int main(int argc, const char *argv[]) {
- ++argv, --argc;
- if ( argc > 0 )
- yyin = fopen( argv[0], "r" );
- else
- yyin = stdin;
-
- yylex();
-
- ++argv, --argc;
- const char *out = nullptr;
- if (argc > 0) {
- out = argv[0];
- }
-
- Highlighter hh(out);
- hh.highlight(tokens);
- return 0;
-} \ No newline at end of file