MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / Parser

Method Parser

chapter15/src/main/java/com/seaofnodes/simple/Parser.java:100–127  ·  view source on GitHub ↗
(String source, TypeInteger arg)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

resetMethod · 0.95
resetMethod · 0.95
conMethod · 0.95
clearMethod · 0.45
putMethod · 0.45
keepMethod · 0.45
peepholeMethod · 0.45

Tested by

no test coverage detected