Skip to content

Commit 40f9da0

Browse files
committed
initial commit - work in progress
0 parents  commit 40f9da0

36 files changed

+3276
-0
lines changed

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
CC = gcc
2+
CFLAGS = -g
3+
4+
LDFLAGS=-lfl -lm
5+
6+
all: bison flex tinyruby
7+
8+
tinyruby: y.tab.o lex.yy.o ast.o types.o eval.o scope.o heap.o vtable.o
9+
$(CC) -o $@ y.tab.o lex.yy.o ast.o types.o eval.o scope.o heap.o vtable.o $(LDFLAGS)
10+
11+
bison:
12+
bison -yd tinyruby_parse.y
13+
14+
flex:
15+
flex tinyruby.lex
16+
17+
y.tab.o: y.tab.c y.tab.h
18+
$(CC) $(CFLAGS) -c -o $@ $<
19+
20+
lex.yy.o: lex.yy.c
21+
$(CC) $(CFLAGS) -c -o $@ $<
22+
23+
ast.o: ast.c ast.h error.h types.h tinyruby.h vtable.h
24+
$(CC) $(CFLAGS) -c -o $@ $<
25+
26+
types.o: types.c types.h tinyruby.h
27+
$(CC) $(CFLAGS) -c -o $@ $<
28+
29+
eval.o: eval.c eval.h tinyruby.h types.h ast.h vtable.h
30+
$(CC) $(CFLAGS) -c -o $@ $<
31+
32+
scope.o: scope.c scope.h
33+
$(CC) $(CFLAGS) -c -o $@ $<
34+
35+
heap.o: heap.c heap.h tinyruby.h
36+
$(CC) $(CFLAGS) -c -o $@ $<
37+
38+
vtable.o: vtable.c vtable.h
39+
$(CC) $(CFLAGS) -c -o $@ $<
40+
41+
clean:
42+
rm -f *.o tinyruby y.tab.* lex.yy.*

README

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Tinyruby
2+
========
3+
4+
For a course in the University we have as a homework the task to implement
5+
a small subset of the Ruby language with support of the most typical features
6+
of imperative languages plus some additionals features of OOP (like classes
7+
defintion and object creation but no inheritance, neither polimorfism).
8+
9+
Tinyruby borns there, a very small and not finished (yet) ruby interpreter.
10+
11+
Probably FAQ
12+
============
13+
14+
* If not finished and also fails in some cases, why you bother to upload it here?
15+
I've decided to upload it to github because I think there are lot's of people
16+
that can or wants to create a interpreter and I think our code can be a good start.
17+
18+
* The code is ugly and you use don't know a piece of C, why you show us that?
19+
Probably you're right, the code is not so elegant and should have many errors.
20+
I know more C than my team mate, so difficult to get used in a few weeks.
21+
I think the same reason above is valid here, I think and I believe show what you
22+
do is better than don't, it's just a matter of principles.
23+
24+
* Will this project continue or just will be another dead one?
25+
I really have a lot of fun doing it, but working full time and taking care of a
26+
family give me very little time to play with. Anyway, I hope to add time to time
27+
a new feature, at least, fix all the bugs and improve what we reached.
28+
29+
30+
Authors
31+
=======
32+
33+
* Andrés Moreira
34+
* Fernando Carriquiry

0 commit comments

Comments
 (0)