Difference: RochesterCCompiler (1 vs. 3)

Revision 32009-02-12 - BinBao

Line: 1 to 1
 
META TOPICPARENT name="CompilerRepository"

URCC: Rochester C Compiler

Introduction

URCC is an experimental C compiler written in Ruby. A major goal is to see how small the intermediate language can be. The current version includes 2 modules and 22 classes.

Changed:
<
<
To access documentation in html format, download the repository (/p/compiler/repos/urcc under svn), go to ast directory, run rdoc *.rb, and point your browser to file ast/doc/index.html.
>
>
To access documentation in html format, download the repository (file:///p/compiler/repos/urcc under svn), go to ast directory, run rdoc *.rb, and point your browser to file ast/doc/index.html.
  Ruby rdoc does not organize classes by inheritance relations. A manually constructed class hierarchy is shown next (which may become out of date if not maintained).

Revision 22009-02-09 - ChenDing

Line: 1 to 1
 
META TOPICPARENT name="CompilerRepository"

URCC: Rochester C Compiler

Introduction

URCC is an experimental C compiler written in Ruby. A major goal is to see how small the intermediate language can be. The current version includes 2 modules and 22 classes.

Changed:
<
<
To access documentation in html format, download the repository, go to ast directory, run rdoc *.rb, and point your browser to file ast/doc/index.html.
>
>
To access documentation in html format, download the repository (/p/compiler/repos/urcc under svn), go to ast directory, run rdoc *.rb, and point your browser to file ast/doc/index.html.
  Ruby rdoc does not organize classes by inheritance relations. A manually constructed class hierarchy is shown next (which may become out of date if not maintained).

Revision 12009-02-09 - ChenDing

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CompilerRepository"

URCC: Rochester C Compiler

Introduction

URCC is an experimental C compiler written in Ruby. A major goal is to see how small the intermediate language can be. The current version includes 2 modules and 22 classes.

To access documentation in html format, download the repository, go to ast directory, run rdoc *.rb, and point your browser to file ast/doc/index.html.

Ruby rdoc does not organize classes by inheritance relations. A manually constructed class hierarchy is shown next (which may become out of date if not maintained).

Class Hierarchy

Ast module

  • Ast::Node: can have one parent and any number of chidren
    • Ast::Scope: representing program and file, with symbol table
      • Ast::Block: code block and function body
      • Ast::Func: function
    • Ast::Stat: statement, i.e. anything that ends with ;
      • Ast::AssignStat: assignment or just an expression (no LHS, e.g. a function call)
      • Ast::GotoStat: go-to or conditional go-to
      • Ast::LabelStat: target of go-to
      • Ast::ReturnStat: return expression
    • Ast::Expr: expression
      • Ast::OpExpr: unary or binary
      • Ast::Call: function call
      • Ast::VarAcc: variable access
      • Ast::Const: divided into Ast::NumConst and Ast::StrConst

Decl module

  • Decl::Type: base type, with any number of indirection
    • Decl::PrimType: primitive types
    • Decl::StructType: to be implemented
    • Decl::ArrayType:
    • Decl::FuncType:
  • Decl::Var: variable declaration, name plus Decl::Type
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback