A man is fighting hard. I haven't written a blog for a long time since I turned my attention to the compiler. In fact, there are still a lot of GAINS and feelings in the next day. Maybe I forced myself to be too tight, so that I got to the point of "mean" time. It has been a week since the compiler was used. (I prefer to use the word "tossing" to describe professional learning ~), The progress seems to be slow. One reason is that the Java skills are not good, and the other is that it is difficult to switch from the abstract compilation Theory to the actual implementation of the project. So far as I write this blog, I only have a clear idea of implementing the first simple simpleminijool language interpreter. However, I have to work hard to implement it, especially for AST operations. Speaking of AST, it hurts. If it wasn't blocked, now I can make a lexical analyzer, Khan ~ In the past few days of "tossing", the harvest is still quite big. First, I have a better understanding of Java inheritance, abstract classes, interfaces, and polymorphism. Secondly, I learned two common design models: simple factory and visitor. A few weeks ago, I once learned about their power in the book "big talk Design Patterns". Now I can hardly remember the example of "Big Bird" giving me a little dish, find a time to see the remaining 21 modes. Finally, I understand the concept and simple implementation method of component-based programming. Today's harvest is the only simple operation that can be expressed by a program is hashmap ~ The hardships of a person's battle will not be mentioned first. After finishing this road, I will find another time for good mood... It should be more beautiful than there are more complaints. Well, write it here...
Import java. util .*; Class myhash { Public static void main (string ARGs []) { // Create a hash map. Hashmap <string, integer> Hm = new hashmap <string, integer> (); // Put elements to the map String mum = "John Doe "; Hm. Put (mum, new integers (343 )); Hm. Put ("Tom Smith", new INTEGER (123 )); System. Out. println (Hm. Get ("Tom Smith ")); System. Out. println (Hm. Get ("John Doe ")); Hm. Put ("John Doe", new INTEGER (0x02 )); System. Out. println ("John Doe's New Balance:" + Hm. Get ("John Doe ")); } } |
|