Skip to content

Commit

Permalink
feat: <scala> init for function programming
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 13, 2020
1 parent 217d040 commit 6733a89
Show file tree
Hide file tree
Showing 21 changed files with 16,211 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {
jacocoReports(project(":chapi-ast-kotlin"))
jacocoReports(project(":chapi-ast-c"))
jacocoReports(project(":chapi-ast-csharp"))
jacocoReports(project(":chapi-ast-scala"))

// subprojects.forEach {
// archives(it)
Expand Down
46 changes: 46 additions & 0 deletions chapi-ast-scala/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
java
kotlin("jvm")
kotlin("plugin.serialization") version "1.3.61"

`jacoco-conventions`
}

repositories {
mavenCentral()
mavenLocal()
jcenter()
}

dependencies {
// project deps
implementation(project(":chapi-domain"))
implementation(project(":chapi-testing"))

implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0") // JVM dependency

implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
// Kotlin reflection.
implementation(kotlin("test"))
implementation(kotlin("test-junit"))

// JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
testRuntimeOnly("org.junit.platform:junit-platform-console:1.6.0")

implementation("org.antlr:antlr4:4.8-1")
implementation("org.antlr:antlr4-runtime:4.8-1")
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
272 changes: 272 additions & 0 deletions chapi-ast-scala/src/main/java/chapi/ast/antlr/Scala.interp

Large diffs are not rendered by default.

139 changes: 139 additions & 0 deletions chapi-ast-scala/src/main/java/chapi/ast/antlr/Scala.tokens
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
T__0=1
T__1=2
T__2=3
T__3=4
T__4=5
T__5=6
T__6=7
T__7=8
T__8=9
T__9=10
T__10=11
T__11=12
T__12=13
T__13=14
T__14=15
T__15=16
T__16=17
T__17=18
T__18=19
T__19=20
T__20=21
T__21=22
T__22=23
T__23=24
T__24=25
T__25=26
T__26=27
T__27=28
T__28=29
T__29=30
T__30=31
T__31=32
T__32=33
T__33=34
T__34=35
T__35=36
T__36=37
T__37=38
T__38=39
T__39=40
T__40=41
T__41=42
T__42=43
T__43=44
T__44=45
T__45=46
T__46=47
T__47=48
T__48=49
T__49=50
T__50=51
T__51=52
T__52=53
T__53=54
T__54=55
T__55=56
T__56=57
T__57=58
T__58=59
T__59=60
T__60=61
Id=62
BooleanLiteral=63
CharacterLiteral=64
SymbolLiteral=65
IntegerLiteral=66
StringLiteral=67
FloatingPointLiteral=68
Varid=69
BoundVarid=70
Paren=71
Delim=72
Semi=73
NL=74
NEWLINE=75
WS=76
COMMENT=77
LINE_COMMENT=78
'-'=1
'null'=2
'.'=3
','=4
'this'=5
'super'=6
'['=7
']'=8
'=>'=9
'('=10
')'=11
'forSome'=12
'{'=13
'}'=14
'type'=15
'val'=16
'with'=17
'#'=18
':'=19
'_'=20
'*'=21
'implicit'=22
'if'=23
'else'=24
'while'=25
'try'=26
'catch'=27
'finally'=28
'do'=29
'for'=30
'yield'=31
'throw'=32
'return'=33
'='=34
'match'=35
'+'=36
'~'=37
'!'=38
'new'=39
'lazy'=40
'<-'=41
'case'=42
'|'=43
'@'=44
'>:'=45
'<:'=46
'<%'=47
'var'=48
'override'=49
'abstract'=50
'final'=51
'sealed'=52
'private'=53
'protected'=54
'import'=55
'def'=56
'class'=57
'object'=58
'trait'=59
'extends'=60
'package'=61
Loading

0 comments on commit 6733a89

Please # to comment.