An ANTLR-Based Approach to Compiling the Programing Language of Insect Intelligent Building

I2 B(Insect Intelligent Building) platform is a new type of building intelligent system. Lattice is a specialized programming language for I2 B application development that we proposed earlier. Unfortunately, compiling Lattice codes into target codes running on the I2 B hardware platform is still an unsolved problem. This paper proposes a compilation framework for Lattice. The entire compilation process is divided into multiple levels, and each level performs a specific translation work. We design key compiling algorithms for special language elements in Lattice, i.e., neighborhood interactive variables and higher-order operators. We conduct an experiment using a network summation case program in I2 B. The experimental result shows our proposed compilation approach is effective.