Skip to content

korepanov/cari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler of integer arithmetic expressions into assembler code of AT&T syntax

Get started

  1. To make AST:
./cari -i example.cari -ast
start
   ├─ *
   │  ├─ +
   │  │  ├─ *
   │  │  │  ├─ -25
   │  │  │  └─ 10
   │  │  └─ *
   │  │     ├─ -1
   │  │     └─ -7
   │  └─ -100
   ├─ -
   │  ├─ 10
   │  └─ 7
   └─ +
      ├─ /
      │  ├─ -
      │  │  ├─ +
      │  │  │  ├─ 512
      │  │  │  └─ 421
      │  │  └─ +
      │  │     ├─ 3321
      │  │     └─ 70
      │  └─ -
      │     ├─ 900
      │     └─ +
      │        ├─ 30
      │        └─ 78
      └─ -
         ├─ +
         │  ├─ 32
         │  └─ 7
         └─ 90
  1. To compile to the assembler code:
./cari -i example.cari -o example.s
  1. Now you can build your program:
as example.s -o example.o
ld example.o -o example
  1. Run the program.
./example
24300
3
-54

Build

From cmd folder:

go build -o cari main.go

Limits

The minimum number: -9223372036854775808
The maximum number: 9223372036854775807

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages