Skip to content
Snippets Groups Projects
Commit cdf3c0d2 authored by niklasBr's avatar niklasBr
Browse files

Deleted unnecessary file ast2

parent 5a3e3f53
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,7 @@ public class Parser {
toReturn.astDigitAfterComma = parseNumber(new ArrayList<> (decimalTokens.subList(positionOfDecimalPoint + 1, decimalTokens.size())));
}
......
......@@ -2,12 +2,12 @@ import java.util.Arrays;
public class main {
public static void main(String[] args){
public static void main(String[] args) {
// values above integer space will produce errors
String ausdruck = "3.5 * 2.5 + 2.1";
String ausdruck = "0032.00555 * 2.5 + 2.1";
Lexer lexer = new Lexer();
......@@ -23,9 +23,7 @@ public class main {
Parser p = new Parser();
AstExpression result = p.parse(lexer.lex(ausdruck));
AstExpression result = p.parse(lexer.lex(ausdruck));
do {
......@@ -41,7 +39,7 @@ public class main {
System.out.println(result.astBinaryOp.astOperator.astOperator);
if(result.astBinaryOp.astExpression2.astValue != null) {
if (result.astBinaryOp.astExpression2.astValue != null) {
try {
System.out.println(result.astBinaryOp.astExpression2.astValue.astNumber.astDigitWoz.astDigitWozContent);
......@@ -62,45 +60,7 @@ public class main {
}
} while ( true );
/*
System.out.println( ((AstValue) result.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent );
System.out.println( ((AstOperator) result.astBinaryOp.binaryOp[1]).astOperator );
//-------------------
AstExpression root = (AstExpression) result.astBinaryOp.binaryOp[2];
System.out.println( ((AstValue) root.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent );
System.out.println( ((AstOperator) root.astBinaryOp.binaryOp[1]).astOperator );
//---------------------
AstExpression root2 = (AstExpression) root.astBinaryOp.binaryOp[2];
System.out.println( ((AstValue) root2.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent );
System.out.println( ((AstOperator) root2.astBinaryOp.binaryOp[1]).astOperator );
System.out.println( ((AstValue) root2.astBinaryOp.binaryOp[2]).astNumber.astDigitWoz.astDigitWozContent );
*/
} while (true);
}
/*
void printAst (AstExpression astE) {
if(astE.)
}
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment