Parser structure
See original GitHub issueWhile was reading throught postcss
sources, found a moment that current parsing architecture looks
___________ __________
| | | |
| Tokenizer | -> List of Tokens -> | Parser | -> Parser eats them and produces AST
|___________| |__________|
While it works fine, I am really wondering if there are any reasons for not using tokens streaming
like babylon
do for example, where you plug tokenizer in parser, or expose something like readNextToken
?
In this manner you only scan source once, instead of scanning source and then iterating over tokens, that could provide significant performance boost.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:13 (12 by maintainers)
Top Results From Across the Web
Parsing - Wikipedia
Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data ......
Read more >Structure Parser transformation - Informatica Documentation
The Structure Parser transformation transforms your input data into a user-defined structured format based on an. intelligent structure model.
Read more >What is a Parser? Definition, Types and Examples - TechTarget
Parsers are used when there is a need to represent input data from source code abstractly as a data structure so that it...
Read more >Types of Parsers in Compiler Design - GeeksforGeeks
The parser is that phase of the compiler which takes a token string as input and with the help of existing grammar, converts...
Read more >What is a Parser? - Definition from Techopedia
A parser is the part of a compiler that breaks source code into small sections of character strings called tokens. The term has...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tunnckoCore you could write much better tokenizer for JSON only format 😃.
Done in
orias
branch