question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

While 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Dec 30, 2016

@tunnckoCore you could write much better tokenizer for JSON only format 😃.

0reactions
aicommented, Apr 14, 2017

Done in orias branch

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found