Skip to content

petru-braha/YP-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YP compiler

You can find the romanian version of this document here. Test-driven development principles were considered in this project.

Usage

  • for improved redability, we recommand VS Code and the "Better Comments" extension
  • commands to be passed in project root terminal:
  1. "./setup.sh" - checks for bison and flex installation and builds our compiler
  2. "./build.sh" - builds the custom compiler
  3. "./src/discard.sh" - delete the additional files
  4. "./run.out <file_path>" - compiles and runs the source code

Technologies

  1. C++
  2. Flex
  3. Yacc/Bison

Features

  • All variables/parameters/objects have:

    • explicit value(s)
    • implicit value(s) if there is no given definiton
      • e. g. 0, 0.0, '0', "", true
    • no container will ever be "undefined"
  • x-dimensional arrays, where x could be any natural value not NULL. the same is assured for the size of each dimension.

  • Each file from examples directory is responsable of one grammar rule.

  • See implementation details for more.

  • Default parameters for functions

Limitations

  • No type qualifiers
  • No pointers, refferences
  • No struct, union
  • No inheritence of classes