Skip to content

alan0502/Mini-LISP-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Mini-LISP-interpreter

實作項目:

  1. Syntax validation
  2. Print
  3. Numerical operations
  4. Logical operations
  5. if Expression
  6. Variable definition

編譯

compile bison

bison -d -o y.tab.c lisp.y gcc -c -g -I.. y.tab.c

compile flex

flex -o lex.yy.c lisp.l gcc -c -g -I.. lex.yy.c

compile and link bison and flex

gcc -o lisp y.tab.o lex.yy.o -ll

alan.sh

內容

file="lisp" // .l, .y 檔名

bison -d -o y.tab.c

gcc -c -g -

fl y.tab.c

flex -o lex.yy.c ${file}.l

gcc -c -g -I.. lex.yy.c

gcc -o {file} y.tab.o lex.yy.o -ll -lm

./${file} < input.txt // 測資檔名

實作

在終端機輸入 sh alan.sh即可編譯及執行。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published