Skip to content

Commit

Permalink
ahahahahaha
Browse files Browse the repository at this point in the history
  • Loading branch information
smoothie30 committed May 9, 2012
1 parent ed0317b commit 2b4dc0b
Show file tree
Hide file tree
Showing 72 changed files with 1,253 additions and 1,248 deletions.
Binary file added SHANNONTEST/.sample1.chr.swp
Binary file not shown.
Binary file modified SHANNONTEST/CVal.class
Binary file not shown.
10 changes: 7 additions & 3 deletions SHANNONTEST/CVal.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ public class CVal implements Comparable<CVal> {
private Object value;

public CVal(Object v) {
if (v == null) {
/*if (v == null) {
throw new RuntimeException("v == null");
}
}*/
value = v;
// only accept one of our datetypes
if (!(isNumber() || isDayblock() || isTime() || isTimeblock()
|| isDatetime() || isString() || isCourse() || isCourselist()
|| isSchedule() || isFunction() )) {
|| isSchedule() || isFunction() || isBoolean() )) {
throw new RuntimeException("invalid type: " + v + " ("
+ v.getClass() + ")");
}
Expand Down Expand Up @@ -174,6 +174,10 @@ public boolean isBool(){
return false;
}
}

public boolean isBoolean() {
return value instanceof Boolean;
}

public boolean getBool(){
if (this.isBool()){
Expand Down
7 changes: 4 additions & 3 deletions SHANNONTEST/Chronos.g
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ stmt: expr ('='^ expr)? ';'!
;
selection_stmt
// matches if and if/else statements
: IF_T expr '{' (a=line)* '}' else_stmt? -> ^(COND expr ^(THEN $a*) else_stmt)
: IF_T expr '{' line* '}' else_stmt? -> ^( COND expr ^(THEN line*) else_stmt? )
//-> line*
;
then_stmt
/*then_stmt
: IF_T expr '{'(a=line)* '}' -> ^(THEN $a*)
;
;*/
else_stmt
: ELSE_T '{' (b=line)* '}' -> ^(ELSE_T $b*)
;
Expand Down
Binary file modified SHANNONTEST/ChronosLexer$DFA8.class
Binary file not shown.
Loading

0 comments on commit 2b4dc0b

Please sign in to comment.