Necas209 / Naive-C-Parser

Naive C Parser developed for Compilers class.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parser for naive C

Naive C Parser developed for Compilers class.

Project comprised of two components:

  • A lexical analyzer, written in Flex, which can be found here: mycc.l
  • A syntax analyzer, or parser, written in Bison, which can be found here: mycc.y

Objective

The main purpose of this parser is to parse through and detect errors in small snippets of C code.

The reasoning behind the naming is the parser only analyzes a small subset of C, aka naive C, containing everything from:

  • types, such as int and char
  • variable, structure and function declarations
  • arithmetic and conditional operators
  • if/else statements
  • while and do/while statements
  • for statements
  • return statements
  • printf syntax specification

About

Naive C Parser developed for Compilers class.

License:MIT License


Languages

Language:TeX 68.9%Language:Yacc 18.2%Language:Lex 8.6%Language:C 2.6%Language:Makefile 1.7%