Draft:Tunnel Grammar Studio
Review waiting, please be patient.
This may take 7 weeks or more, since drafts are reviewed in no specific order. There are 1,367 pending submissions waiting for review.
Where to get help
How to improve a draft
You can also browse Wikipedia:Featured articles and Wikipedia:Good articles to find examples of Wikipedia's best writing on topics similar to your proposed article. Improving your odds of a speedy review To improve your odds of a faster review, tag your draft with relevant WikiProject tags using the button below. This will let reviewers know a new draft has been submitted in their area of interest. For instance, if you wrote about a female astronomer, you would want to add the Biography, Astronomy, and Women scientists tags. Editor resources
Reviewer tools
|
Submission declined on 28 October 2018 by Curb Safe Charmer (talk).
Where to get help
How to improve a draft
You can also browse Wikipedia:Featured articles and Wikipedia:Good articles to find examples of Wikipedia's best writing on topics similar to your proposed article. Improving your odds of a speedy review To improve your odds of a faster review, tag your draft with relevant WikiProject tags using the button below. This will let reviewers know a new draft has been submitted in their area of interest. For instance, if you wrote about a female astronomer, you would want to add the Biography, Astronomy, and Women scientists tags. Editor resources
This draft has been resubmitted and is currently awaiting re-review. |
Written in | C++ |
---|---|
Operating system | Windows |
Available in | English |
License | proprietary |
Website | www |
The Tunnel Grammar Studio (TGS) is an Integrated Development Environment (IDE) for generating stand-alone parsing machines from given lexer and parser grammars. The accepted grammar syntax is based on the Augmented Backus–Naur form (ABNF) with an additional syntax for defining tokens with their lexemes. A graphical representation of the developed grammars is available directly into the IDE, which also includes a visual debugger that builds a syntax tree for a given input in forward and backward steps.
The parsers generated by TGS work with an optimized version of the tunnel parsing algorithm[1]. The algorithm can parse an input linearly and deterministically on the basis of some types of ambiguous grammars[2] and grammars that have a deterministic push-down automaton. The algorithm can accept a sequence of tokens based on the their names and on the characters in their lexemes, case-sensitively or case-insensitively[3].
The tunnel parsing algorithm uses an additional stack with integer counters[4] to be able to handle integer number of repetitions that can be defined for an element in an ABNF grammar. The output of the tunnel parsing algorithm is a sequence of syntax structure construction commands that can be used by the builder module of the automatically generated parsing machine, to build a concrete or an abstract syntax tree with different levels of abstraction[5].
Each parsing machine might have different modules, such as: supplier, scanner, lexer, parser, optimizer, and builder[6]. The parser module in a generated parsing machine by TGS does not use the thread dedicated stack to recurse into the parsing rules (to minimize the possibility of stack-overflow errors), but instead operates over the input in iterative steps due to the use of the tunnel parsing algorithm. The creation of the syntax trees, their traversal, the conversion of their nodes into a string, and the tree's release can also be performed with iterative steps[7].
Example
[edit]An input string "Hello World" can be processed by a TGS generated lexer using the following lexer grammar:
; using the TGS's addition to the ABNF standard
word = 1*('a'-'z' / 'A'-'Z')
; can also be written as "word = 1*(%x61-7A / %x41-5A)" by using the ABNF standard syntax
The result of the lexer's processing will be the following token sequence:
t-sequence("word", "Hello") t-character(' '} t-sequence("word", "World") t-eof
The tokens can be parsed successfully on the basis of the following parser grammar with the tunnel parsing algorithm:
text = {word, %s"Hello"} *(' ' 0*1 {word})
; where: {word, %s"Hello"} defines an element that can accept tokens named "word" with a lexeme that matches case-sensitively (the %s prefix) to the string "Hello", {word} defines an element that matches tokens named "word" with any lexeme, and the characters ' ' and ',' can be written as %x20 and %x2C respectively by using the ABNF standard syntax
One of the syntax trees that can be automatically build by the generated, compiled and executed parsing machine for the grammars and the input is shown in the following image:
References
[edit]- ^ Handzhiyski, Nikolay (2024). "An iterative parsing algorithm with application in the profiling of parsers". University of Plovdiv Paisii Hilendarski.
- ^ Handzhiyski, Nikolay; Somova, Elena (2023). "Tunnel Parsing with Ambigous Grammars". Cybernetics and Information Technologies. 23 (2): 34–53. doi:10.2478/cait-2023-0012.
- ^ Handzhiyski, Nikolay; Somova, Elena (2022). "Tunnel Parsing with the Token's Lexeme". Cybernetics and Information Technologies. 22 (2): 124–144. doi:10.2478/cait-2022-0021.
- ^ Handzhiyski, Nikolay; Somova, Elena (2020). "Tunnel Parsing with counted repetitions". Computer Science. 21 (4): 441–462. doi:10.7494/csci.2020.21.4.3753.
- ^ Handzhiyski, Nikolay; Somova, Elena (2021). "The Expressive Power of the Statically Typed Concrete Syntax Trees". Proceedings of the 14th International Conference Education and Research in the Information Society.
- ^ Handzhiyski, Nikolay; Somova, Elena (2021). "A Parsing Machine Architecture Encapsulating Different Parsing Approaches". International Journal on Information Technologies and Security (IJITS). 13 (3): 27–38.
- ^ Handzhiyski, Nikolay; Somova, Elena (2023). "Tunnel Parsing". Composability, Comprehensibility and Correctness of Working Software. Lecture Notes in Computer Science. Vol. 11950. pp. 325–343. doi:10.1007/978-3-031-42833-3_8. ISBN 978-3-031-42832-6.
- in-depth (not just passing mentions about the subject)
- reliable
- secondary
- independent of the subject
Make sure you add references that meet these criteria before resubmitting. Learn about mistakes to avoid when addressing this issue. If no additional references exist, the subject is not suitable for Wikipedia.