Skip to content

ZubinGou/pas2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                  
                  &&&&&&&&&&&    &&&&&&&      &&&&&&&&(    %%%%%%%%%    %%%%%%%%#                   
                   &&&&&&&&&&&%  &&&&&&&    &&&&&&&&&&&& %%%%%%%%%%%% /%%%%%%%%%#                   
                   &&&.    &&&%  &&&.&&&(   &&&&    /&&& %%%%     %%% /%%%                          
                   &&&.    &&&% &&&& &&&&   &&&&    /&&& %&&%     %%% /%%%                          
                   &&&.    &&&% &&&& &&&&   (&&&&               %%%%% /%%%                          
                   &&&&&&&&&&&% &&&(  &&&,    /&&&&           &&%%%   /%%%                          
                   &&&&&&&&&&& #&&&   &&&&      *&&&&.      &&&&%     /%%%                          
                   &&&.        &&&&   &&&&        ,&&&&.  &&&&&       /%%%                          
                   &&&.        &&&&%%%%&&&          /&&& %&&&         /&%%                          
                   &&&.       ,&&&&&&&&&&&&         /&&& %&&&         /&%&                          
                   &&&.       &&&&     &&&& &&&&&&&&&&&& %&&&&&&&&&&& /&&&&&&%%%#                   
                   &&&.       &&&&     (&&&  &&&&&&&&&&  &&&&&&&&&&&   &&&&&&&&&#                   
                                                                                                    
                  ...............................................................                   
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    

Pas2c

All Contributors

Yet Another Pascal to C Compiler.

Requirements

  • GCC
  • CMake
  • PyQt5

Features ✨

  • Multi-platform compatibility: Linux, Windows, Mac
  • Extended Pascal grammar: eg. record
  • Custom Pascal grammar with json
  • Error handling and recovery
  • Global log module
  • CLI (just like gcc)
  • GUI with editer

Roadmap

  1. Lexer & Parser
  2. Semantic Analyse
  3. Code Generate

CLI Usage

  • build:
mkdir build && cd build
cmake .. && cmake --build .
  • run (in folder build):
    • linux / mac: ./p2c ../example/gcd.pas
    • win:.\Debug\p2c.exe ..\example\gcd.pas

please specify the path of grammar.json with -g if not running in build.

  • test: ctest
> for more info: ctset -VV
  • release: cpack

GUI

Future Work

  • Syntax tree visualization
  • CLI: more portable
  • GUI: robustness

Contributors


Brandon Zhang

💻 ⚠️ 📖

ZubinGou

💻 ⚠️ 🎨

Jason Zhang

💻 ⚠️ 🎨

Oneal

🤔 💻 📖 📢

Eric Wang

💻 ⚠️ 📖

Terence Deng

💻 ⚠️ 📖