| 93 | public static HashMap<String, Type> TYPES = new HashMap<>(); |
| 94 | |
| 95 | public Parser(String source, TypeInteger arg) { |
| 96 | Node.reset(); |
| 97 | IterPeeps.reset(); |
| 98 | TYPES.clear(); |
| 99 | TYPES.put("bool",TypeInteger.U1 ); |
| 100 | TYPES.put("byte",TypeInteger.U8 ); |
| 101 | TYPES.put("f32" ,TypeFloat .B32); |
| 102 | TYPES.put("f64" ,TypeFloat .BOT); |
| 103 | TYPES.put("flt" ,TypeFloat .BOT); |
| 104 | TYPES.put("i16" ,TypeInteger.I16); |
| 105 | TYPES.put("i32" ,TypeInteger.I32); |
| 106 | TYPES.put("i64" ,TypeInteger.BOT); |
| 107 | TYPES.put("i8" ,TypeInteger.I8 ); |
| 108 | TYPES.put("int" ,TypeInteger.BOT); |
| 109 | TYPES.put("u1" ,TypeInteger.U1 ); |
| 110 | TYPES.put("u16" ,TypeInteger.U16); |
| 111 | TYPES.put("u32" ,TypeInteger.U32); |
| 112 | TYPES.put("u8" ,TypeInteger.U8 ); |
| 113 | SCHEDULED = false; |
| 114 | _lexer = new Lexer(source); |
| 115 | _scope = new ScopeNode(); |
| 116 | _continueScope = _breakScope = null; |
| 117 | START = new StartNode(new Type[]{ Type.CONTROL, arg }); |
| 118 | STOP = new StopNode(source); |
| 119 | ZERO = new ConstantNode(TypeInteger.constant(0)).peephole().keep(); |
| 120 | XCTRL= new XCtrlNode().peephole().keep(); |
| 121 | } |
| 122 | |
| 123 | public Parser(String source) { |
| 124 | this(source, TypeInteger.BOT); |