-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from dhakehurst/performance
Performance
- Loading branch information
Showing
326 changed files
with
1,396 additions
and
1,652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"kotlin": "1.3.71", | ||
"net.akehurst.language-agl-processor": "file:../../../net.akehurst.language/.gradle-build/agl-processor/libs/agl-processor-js-3.5.0" | ||
"net.akehurst.language-agl-processor": "file:../../../net.akehurst.language/.gradle-build/agl-processor/productionLibrary" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
kotlin("multiplatform") version ("1.4.32") | ||
kotlin("multiplatform") version ("1.5.20") | ||
} | ||
|
||
kotlin { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
net.akehurst.language/agl-processor/src/commonMain/kotlin/agl/ast/GrammarVisitorAbstract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (C) 2021 Dr. David H. Akehurst (http://dr.david.h.akehurst.net) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.akehurst.language.agl.ast | ||
|
||
import net.akehurst.language.api.grammar.* | ||
|
||
internal abstract class GrammarVisitorAbstract<R, A> : GrammarVisitor<R, A> { | ||
|
||
protected fun visitConcatenationItem(target: ConcatenationItem, arg: A): R = when (target) { | ||
is Multi -> this.visitMulti(target, arg) | ||
is SeparatedList -> this.visitSeparatedList(target, arg) | ||
is SimpleItem -> this.visitSimpleItem(target, arg) | ||
else -> error("${target::class} is not a supported subtype of ConcatenationItem") | ||
} | ||
|
||
protected fun visitChoice(target: Choice, arg: A): R = when (target) { | ||
is ChoiceEqual -> this.visitChoiceEqual(target, arg) | ||
is ChoicePriority -> this.visitChoicePriority(target, arg) | ||
is ChoiceAmbiguous -> this.visitChoiceAmbiguous(target, arg) | ||
else -> error("${target::class} is not a supported subtype of Choice") | ||
} | ||
|
||
protected fun visitSimpleItem(target: SimpleItem, arg: A): R = when (target) { | ||
is Group -> this.visitGroup(target, arg) | ||
is TangibleItem -> this.visitTangibleItem(target, arg) | ||
else -> error("${target::class} is not a supported subtype of SimpleItem") | ||
} | ||
|
||
protected fun visitTangibleItem(target: TangibleItem, arg: A): R = when (target) { | ||
is EmptyRule -> this.visitEmptyRule(target, arg) | ||
is NonTerminal -> this.visitNonTerminal(target, arg) | ||
is Terminal -> this.visitTerminal(target, arg) | ||
else -> error("${target::class} is not a supported subtype of TangibleItem") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.