-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v1][WIP] Replicate partiqlparser default with v1 AST
- Loading branch information
Showing
7 changed files
with
2,405 additions
and
4 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
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
39 changes: 39 additions & 0 deletions
39
partiql-parser/src/main/kotlin/org/partiql/parser/V1PartiQLParser.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,39 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at: | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file 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 org.partiql.parser | ||
|
||
import org.partiql.ast.v1.Statement | ||
import org.partiql.parser.internal.V1PartiQLParserDefault | ||
|
||
public interface V1PartiQLParser { | ||
|
||
@Throws(PartiQLSyntaxException::class, InterruptedException::class) | ||
public fun parse(source: String): Result | ||
|
||
public data class Result( | ||
val source: String, | ||
val root: Statement, | ||
val locations: SourceLocations, | ||
) | ||
|
||
public companion object { | ||
|
||
@JvmStatic | ||
public fun builder(): V1PartiQLParserBuilder = V1PartiQLParserBuilder() | ||
|
||
@JvmStatic | ||
public fun standard(): V1PartiQLParser = V1PartiQLParserDefault() | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
partiql-parser/src/main/kotlin/org/partiql/parser/V1PartiQLParserBuilder.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,27 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at: | ||
* | ||
* http://aws.amazon.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file 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 org.partiql.parser | ||
|
||
import org.partiql.parser.internal.V1PartiQLParserDefault | ||
|
||
/** | ||
* A builder class to instantiate a [V1PartiQLParser]. | ||
*/ | ||
public class V1PartiQLParserBuilder { | ||
|
||
public fun build(): V1PartiQLParser { | ||
return V1PartiQLParserDefault() | ||
} | ||
} |
Oops, something went wrong.