TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Carburetta – C/C++ Fused Scanner and Parser Generator

3 pointsby quincunxabout 4 years ago

2 comments

fjfaaseabout 4 years ago
The distinction between a scanner and a parser is somewhat arbitrary. One could use one and the same formalism for it. The scanner usually deals with things that are considered &#x27;atomic&#x27; elements in the language, while grammar is used for &#x27;compound&#x27; elements consisting of one or more other elements. If there are seen as one and the same, than it naturally flows that the scanner is called from the parser, and not how it is traditionally done, that the scanner acts as a first pass. This seems a logical approach, but in practices, when scanning is context sensitive, requires the implementation of all kinds of hacks. Also, the treatment of keywords (where it is possible that they are case insensitive) it is better to have a grammar for parsing a keyword &#x27;identifier&#x27; and a check whether the result matches the keyword. For pure performance this would not be the best solution, but I understand that Carburetta is not design for that. I have been developing a parser that makes no distinction between scanning and parsing in C, which I called RawParser: <a href="https:&#x2F;&#x2F;github.com&#x2F;FransFaase&#x2F;RawParser" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FransFaase&#x2F;RawParser</a> . It also offers more powerful grammar constructs and gives examples on how to implement memory management in a uniform way.
评论 #26751025 未加载
HelloNurseabout 4 years ago
Come on, the seventies have ended...<p>&gt; Note that the above implies there is currently no support for features like:<p>&gt; UTF-8 (or other unicode) input, input characters are all deemed to be in the range 0 to 255.
评论 #26751780 未加载