From 7427ff02b74ae54c07422cf6c78256da3abb566d Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Mon, 25 May 2020 09:44:46 +0800 Subject: [PATCH] build: split scriptt --- grammars/typescript/TypeScriptLexer.tokens | 247 --------------------- scripts/compile-antlr.sh | 7 - scripts/compile-typescript.sh | 6 + 3 files changed, 6 insertions(+), 254 deletions(-) delete mode 100644 grammars/typescript/TypeScriptLexer.tokens create mode 100755 scripts/compile-typescript.sh diff --git a/grammars/typescript/TypeScriptLexer.tokens b/grammars/typescript/TypeScriptLexer.tokens deleted file mode 100644 index 4d363e15..00000000 --- a/grammars/typescript/TypeScriptLexer.tokens +++ /dev/null @@ -1,247 +0,0 @@ -MultiLineComment=1 -SingleLineComment=2 -RegularExpressionLiteral=3 -OpenBracket=4 -CloseBracket=5 -OpenParen=6 -CloseParen=7 -OpenBrace=8 -CloseBrace=9 -SemiColon=10 -Comma=11 -Assign=12 -QuestionMark=13 -Colon=14 -Ellipsis=15 -Dot=16 -PlusPlus=17 -MinusMinus=18 -Plus=19 -Minus=20 -BitNot=21 -Not=22 -Multiply=23 -Divide=24 -Modulus=25 -RightShiftArithmetic=26 -LeftShiftArithmetic=27 -RightShiftLogical=28 -LessThan=29 -MoreThan=30 -LessThanEquals=31 -GreaterThanEquals=32 -Equals_=33 -NotEquals=34 -IdentityEquals=35 -IdentityNotEquals=36 -BitAnd=37 -BitXOr=38 -BitOr=39 -And=40 -Or=41 -MultiplyAssign=42 -DivideAssign=43 -ModulusAssign=44 -PlusAssign=45 -MinusAssign=46 -LeftShiftArithmeticAssign=47 -RightShiftArithmeticAssign=48 -RightShiftLogicalAssign=49 -BitAndAssign=50 -BitXorAssign=51 -BitOrAssign=52 -ARROW=53 -Lodash=54 -Dollar=55 -NullLiteral=56 -BooleanLiteral=57 -DecimalLiteral=58 -HexIntegerLiteral=59 -OctalIntegerLiteral=60 -OctalIntegerLiteral2=61 -BinaryIntegerLiteral=62 -Break=63 -Do=64 -Instanceof=65 -Typeof=66 -Case=67 -Else=68 -New=69 -Var=70 -Catch=71 -Finally=72 -Return=73 -Void=74 -Continue=75 -For=76 -Switch=77 -While=78 -Debugger=79 -Function=80 -This=81 -With=82 -Default=83 -If=84 -Throw=85 -Delete=86 -In=87 -Try=88 -As=89 -From=90 -ReadOnly=91 -Async=92 -Class=93 -Enum=94 -Extends=95 -Super=96 -Const=97 -Export=98 -Import=99 -Implements=100 -Let=101 -Private=102 -Public=103 -Interface=104 -Package=105 -Protected=106 -Static=107 -Yield=108 -Any=109 -Number=110 -Boolean=111 -String=112 -Symbol=113 -Type=114 -Get=115 -Set=116 -Constructor=117 -Namespace=118 -Require=119 -Module=120 -Declare=121 -Abstract=122 -Is=123 -At=124 -Identifier=125 -StringLiteral=126 -TemplateStringLiteral=127 -WhiteSpaces=128 -LineTerminator=129 -HtmlComment=130 -CDataComment=131 -UnexpectedCharacter=132 -'['=4 -']'=5 -'('=6 -')'=7 -'{'=8 -'}'=9 -';'=10 -','=11 -'='=12 -'?'=13 -':'=14 -'...'=15 -'.'=16 -'++'=17 -'--'=18 -'+'=19 -'-'=20 -'~'=21 -'!'=22 -'*'=23 -'/'=24 -'%'=25 -'>>'=26 -'<<'=27 -'>>>'=28 -'<'=29 -'>'=30 -'<='=31 -'>='=32 -'=='=33 -'!='=34 -'==='=35 -'!=='=36 -'&'=37 -'^'=38 -'|'=39 -'&&'=40 -'||'=41 -'*='=42 -'/='=43 -'%='=44 -'+='=45 -'-='=46 -'<<='=47 -'>>='=48 -'>>>='=49 -'&='=50 -'^='=51 -'|='=52 -'=>'=53 -'_'=54 -'$'=55 -'null'=56 -'break'=63 -'do'=64 -'instanceof'=65 -'typeof'=66 -'case'=67 -'else'=68 -'new'=69 -'var'=70 -'catch'=71 -'finally'=72 -'return'=73 -'void'=74 -'continue'=75 -'for'=76 -'switch'=77 -'while'=78 -'debugger'=79 -'function'=80 -'this'=81 -'with'=82 -'default'=83 -'if'=84 -'throw'=85 -'delete'=86 -'in'=87 -'try'=88 -'as'=89 -'from'=90 -'readonly'=91 -'async'=92 -'class'=93 -'enum'=94 -'extends'=95 -'super'=96 -'const'=97 -'export'=98 -'import'=99 -'implements'=100 -'let'=101 -'private'=102 -'public'=103 -'interface'=104 -'package'=105 -'protected'=106 -'static'=107 -'yield'=108 -'any'=109 -'number'=110 -'boolean'=111 -'string'=112 -'symbol'=113 -'type'=114 -'get '=115 -'set '=116 -'constructor'=117 -'namespace'=118 -'require'=119 -'module'=120 -'declare'=121 -'abstract'=122 -'is'=123 -'@'=124 diff --git a/scripts/compile-antlr.sh b/scripts/compile-antlr.sh index c30c477a..8ce9d355 100755 --- a/scripts/compile-antlr.sh +++ b/scripts/compile-antlr.sh @@ -7,13 +7,6 @@ antlr -Dlanguage=Java -listener -visitor JavaParser.g4 -o ../../chapi-ast-java/s cd ../.. -cd grammars/typescript - -antlr -Dlanguage=Java -listener -visitor TypeScriptLexer.g4 -o ../../chapi-ast-typescript/src/main/java/chapi/ast/antlr -package chapi.ast.antlr -antlr -Dlanguage=Java -listener -visitor TypeScriptParser.g4 -o ../../chapi-ast-typescript/src/main/java/chapi/ast/antlr -package chapi.ast.antlr - -cd ../.. - cd grammars/go antlr -Dlanguage=Java -listener -visitor GoLexer.g4 -o ../../chapi-ast-go/src/main/java/chapi/ast/antlr -package chapi.ast.antlr diff --git a/scripts/compile-typescript.sh b/scripts/compile-typescript.sh new file mode 100755 index 00000000..461ff90b --- /dev/null +++ b/scripts/compile-typescript.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +cd grammars/typescript + +antlr -Dlanguage=Java -listener -visitor TypeScriptLexer.g4 -o ../../chapi-ast-typescript/src/main/java/chapi/ast/antlr -package chapi.ast.antlr +antlr -Dlanguage=Java -listener -visitor TypeScriptParser.g4 -o ../../chapi-ast-typescript/src/main/java/chapi/ast/antlr -package chapi.ast.antlr