#+ TITLE: b2llvm notes
BXML: {structure}: <Struct>{field}*</Struct> {field}: <Record_Item label={name}>{type}</Record_Item>
AST: {structure}: Structure > elements : seq Field {field}: Field > id: {name} > type : {type}
BXML: {record}: <Record><Attributes><TypeInfo>{type}</TypeInfo></Attributes>{rec_field}*</Record> {type}: see {structure} {rec_field}: <Record_Item label={name}>{expression}</Record_Item>
AST: {record}: Record > type:{structure} > values: seq {expression}
BXML: {select}: <Binary_Expression operator=”'”>{base}{elem}</Binary_Expression> {base}: {expression} (of type structure) {elem}: <Identifier value={name}></Identifier>
AST: {select}: RecField > base:{expression} (of type structure) > elem:{name}
Artifacts: DOCUMENTATION/specification.tex
- record: i.e. the type of data for records
- struct: i.e. the actual records
- field selection
- record assignment: assignment of full record
examples in C with struct. Artifacts: C/pg5.c, C/pg5.llvm, possibly new C and LLVM files.
Artifacts: DOCUMENTATION/specification.tex
- record: aggregate type
- struct: aggregate value
- field selection: combination of getelementptr and load
- record assignment: beware of atomicity issue:
r := struct(x_1: e_1; … x_n: v_n) is essentially
LET v_1 = e_1 and … e_n = v_n IN r’x1 := v_1; …; r’x_n := v_n END
- update Makefile and coverage script to include the examples
- ast.py: implement new families of AST nodes
- printer.py: implement pretty-printer for the new nodes
- loadbxml.py: extend BXML loader to include new constructs
- translate.py: implement code generation rules