3

Is there a simple lexer/parser for C language or a subset of it which is based on Flex/Bison?

I have found some open source parsers for C (TCC, LCC, ...) but none of them are based on bison.

1
  • Adding a comment stating the reason of downvote would be much more useful for me. Commented Feb 10, 2016 at 7:40

2 Answers 2

5

There is a C11 grammar for YACC (a predecessor of Bison), it should work with Bison (maybe some tweaks will be needed).

GCC used to be based on Bison a long ago. GCC 3.4 source code contains a file with C grammar.

Sign up to request clarification or add additional context in comments.

Comments

4

This is an implementation of a compiler for a subset of C using bison/flex.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.