Skip to content

Commit

Permalink
yes
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlHejlesen committed May 28, 2024
1 parent fa61121 commit 87527bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public AstNode visitParameterList(CARLParser.ParameterListContext ctx) {
List<ParameterNode> parameters = new ArrayList<>();
if (ctx != null) {
for (int i = 0; i < Math.ceilDiv(ctx.getChildCount(), 4); i++) {
System.out.println(ctx.IDENTIFIER().size());
//System.out.println(ctx.IDENTIFIER().size());
IdentifierNode identifier = new IdentifierNode(ctx.IDENTIFIER(i).getText());
TypeNode type = (TypeNode) visit(ctx.type(i));
parameters.add(new ParameterNode(identifier, type));
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/dk/aau/cs_24_sw_4_16/carl/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,13 @@ public static void main(String... args) {

if (!typeChecker.thereWasAnError) {
EvaluatorExecutor inter = new EvaluatorExecutor();
inter.visit(astRoot);

inter.visit(astRoot);
}
// Interpreter is a class that can traverse the AST and interpret or execute the
// program based on the AST.

} catch (IOException e) {
System.out.println(e.toString());
} catch (Exception e) {
// Catches any exception that occurs within the try block.
// Prints the string representation of the exception to standard output.
System.out.println();
}
}
}
}
5 changes: 4 additions & 1 deletion test.carl
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
var carl:float = 2
print(carl)
fn carlersej (carlerSupersej:int) -> void{

}
carl =234234


var size : int = 20
var map : float[size][size]

map[2][2] =4.5
map[2][2] =4.5

0 comments on commit 87527bd

Please sign in to comment.