-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare example gate project with tranceducer pipeline
Example project contains jape grammars and some gazetteers. Works on #7.
- Loading branch information
Showing
11 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,15 @@ | ||
/** | ||
* This is example file to provide syntax colorize support | ||
* Author: Sergiy Samborskiy <[email protected]> | ||
* | ||
*/ | ||
Phase: Basic | ||
Input: Lookup Token | ||
|
||
Rule: IngredientName | ||
Priority: 1 | ||
( | ||
{ Lookup.majorType == "ingredient" } | ||
): label | ||
--> | ||
:labe.IngredientName = { rule = "IngredientName", value = :label@string } |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* This is example file to provide syntax colorize support | ||
* Author: Sergiy Samborskiy <[email protected]> | ||
* | ||
* // Some lines here | ||
*/ | ||
Phase: Example | ||
Input: Lookup Token | ||
Input: Go | ||
// begin first rule | ||
|
||
Macro: sd | ||
( | ||
{Token} | ||
): a | ||
|
||
Rule: Prime | ||
Priority: 1 | ||
( | ||
(sd) | ||
{ Lookup.majorType == "number", Token.string == "one" } | | ||
{ Lookup.majorType == "number", Token.string == "two" } | | ||
{ Lookup.majorType == "number", Token.string == "tree" } | ||
): label2 | ||
--> | ||
:label.PrimeNumber = { rule = "Number" } | ||
|
||
Rule: NonPrime | ||
( | ||
( { Lookup.majorType == "number", Token.string == "four" } ): fourLabel | ||
| { Lookup.majorType == "number", Token.string == "five" } | ||
): label2 | ||
--> | ||
:label2.NotPrimeNumber = { rule = "Number", value = :label.Lookup.string }, | ||
:fourLabel.ItsFour = { rule = "Number", value = "4" } |
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,4 @@ | ||
MultiPhase: Ingredients | ||
|
||
Phases: | ||
ingredients1 |
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,18 @@ | ||
|
||
Phase: BasicIngredients | ||
Input: Quantity IngredientName | ||
|
||
Rule: Ingredient1 | ||
( | ||
({ Quantity }): qty | ||
({ IngredientName }): ingredient | ||
): label | ||
--> | ||
:labe.Ingredient = { rule = "Ingredient", qty = :qty.Quantity.value, name = :ingredient.IngredientName.value } | ||
|
||
Rule: Ingredient2 | ||
( | ||
({ IngredientName }): ingredient | ||
): label | ||
--> | ||
:labe.Ingredient = { rule = "Ingredient", qty = "", name = :ingredient.IngredientName.value } |
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,9 @@ | ||
MultiPhase: Main | ||
|
||
Phases: | ||
basic | ||
|
||
quantity/index | ||
ingredients/index | ||
|
||
result |
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,4 @@ | ||
MultiPhase: Quantity | ||
|
||
Phases: | ||
quantity1 |
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,13 @@ | ||
|
||
Phase: BasicQuantity | ||
Input: Lookup Token | ||
|
||
Rule: Quantity1 | ||
Priority: 1 | ||
( | ||
({ Token.type == "number" }): value | ||
({ Lookup.majorType == "measure_unit" }): unit | ||
): label | ||
--> | ||
:labe.Quantity = { rule = "Quantity", value = :value@string, unit = :unit@string } | ||
|
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,9 @@ | ||
Phase: ResultMatcher | ||
Input: Ingredient | ||
|
||
Rule: Result | ||
( | ||
({ Ingredient }): ingredient | ||
): label | ||
--> | ||
:labe.Result = { rule = "Ingredient", qty = :ingredient.Ingredient.qty, name = :ingredient.IngredientName.value } |