[
  {
    "path": ".idea/inspectionProfiles/Project_Default.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <profile version=\"1.0\">\n    <option name=\"myName\" value=\"Project Default\" />\n    <inspection_tool class=\"JavaDoc\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">\n      <option name=\"TOP_LEVEL_CLASS_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"INNER_CLASS_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"METHOD_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"@return@param@throws or @exception\" />\n        </value>\n      </option>\n      <option name=\"FIELD_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"IGNORE_DEPRECATED\" value=\"false\" />\n      <option name=\"IGNORE_JAVADOC_PERIOD\" value=\"true\" />\n      <option name=\"IGNORE_DUPLICATED_THROWS\" value=\"false\" />\n      <option name=\"IGNORE_POINT_TO_ITSELF\" value=\"false\" />\n      <option name=\"myAdditionalJavadocTags\" value=\"date\" />\n    </inspection_tool>\n  </profile>\n</component>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_11\" default=\"true\" project-jdk-name=\"11\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/out\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/LiXinCompiler.iml\" filepath=\"$PROJECT_DIR$/LiXinCompiler.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/uiDesigner.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Palette2\">\n    <group name=\"Swing\">\n      <item class=\"com.intellij.uiDesigner.HSpacer\" tooltip-text=\"Horizontal Spacer\" icon=\"/com/intellij/uiDesigner/icons/hspacer.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"1\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\" />\n      </item>\n      <item class=\"com.intellij.uiDesigner.VSpacer\" tooltip-text=\"Vertical Spacer\" icon=\"/com/intellij/uiDesigner/icons/vspacer.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"1\" anchor=\"0\" fill=\"2\" />\n      </item>\n      <item class=\"javax.swing.JPanel\" icon=\"/com/intellij/uiDesigner/icons/panel.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\" />\n      </item>\n      <item class=\"javax.swing.JScrollPane\" icon=\"/com/intellij/uiDesigner/icons/scrollPane.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"7\" hsize-policy=\"7\" anchor=\"0\" fill=\"3\" />\n      </item>\n      <item class=\"javax.swing.JButton\" icon=\"/com/intellij/uiDesigner/icons/button.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"0\" fill=\"1\" />\n        <initial-values>\n          <property name=\"text\" value=\"Button\" />\n        </initial-values>\n      </item>\n      <item class=\"javax.swing.JRadioButton\" icon=\"/com/intellij/uiDesigner/icons/radioButton.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"8\" fill=\"0\" />\n        <initial-values>\n          <property name=\"text\" value=\"RadioButton\" />\n        </initial-values>\n      </item>\n      <item class=\"javax.swing.JCheckBox\" icon=\"/com/intellij/uiDesigner/icons/checkBox.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"8\" fill=\"0\" />\n        <initial-values>\n          <property name=\"text\" value=\"CheckBox\" />\n        </initial-values>\n      </item>\n      <item class=\"javax.swing.JLabel\" icon=\"/com/intellij/uiDesigner/icons/label.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"0\" anchor=\"8\" fill=\"0\" />\n        <initial-values>\n          <property name=\"text\" value=\"Label\" />\n        </initial-values>\n      </item>\n      <item class=\"javax.swing.JTextField\" icon=\"/com/intellij/uiDesigner/icons/textField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n          <preferred-size width=\"150\" height=\"-1\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JPasswordField\" icon=\"/com/intellij/uiDesigner/icons/passwordField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n          <preferred-size width=\"150\" height=\"-1\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JFormattedTextField\" icon=\"/com/intellij/uiDesigner/icons/formattedTextField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n          <preferred-size width=\"150\" height=\"-1\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JTextArea\" icon=\"/com/intellij/uiDesigner/icons/textArea.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JTextPane\" icon=\"/com/intellij/uiDesigner/icons/textPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JEditorPane\" icon=\"/com/intellij/uiDesigner/icons/editorPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JComboBox\" icon=\"/com/intellij/uiDesigner/icons/comboBox.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"2\" anchor=\"8\" fill=\"1\" />\n      </item>\n      <item class=\"javax.swing.JTable\" icon=\"/com/intellij/uiDesigner/icons/table.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JList\" icon=\"/com/intellij/uiDesigner/icons/list.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"2\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JTree\" icon=\"/com/intellij/uiDesigner/icons/tree.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"150\" height=\"50\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JTabbedPane\" icon=\"/com/intellij/uiDesigner/icons/tabbedPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"200\" height=\"200\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JSplitPane\" icon=\"/com/intellij/uiDesigner/icons/splitPane.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\">\n          <preferred-size width=\"200\" height=\"200\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JSpinner\" icon=\"/com/intellij/uiDesigner/icons/spinner.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\" />\n      </item>\n      <item class=\"javax.swing.JSlider\" icon=\"/com/intellij/uiDesigner/icons/slider.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\" />\n      </item>\n      <item class=\"javax.swing.JSeparator\" icon=\"/com/intellij/uiDesigner/icons/separator.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\" />\n      </item>\n      <item class=\"javax.swing.JProgressBar\" icon=\"/com/intellij/uiDesigner/icons/progressbar.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\" />\n      </item>\n      <item class=\"javax.swing.JToolBar\" icon=\"/com/intellij/uiDesigner/icons/toolbar.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\">\n          <preferred-size width=\"-1\" height=\"20\" />\n        </default-constraints>\n      </item>\n      <item class=\"javax.swing.JToolBar$Separator\" icon=\"/com/intellij/uiDesigner/icons/toolbarSeparator.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"0\" hsize-policy=\"0\" anchor=\"0\" fill=\"1\" />\n      </item>\n      <item class=\"javax.swing.JScrollBar\" icon=\"/com/intellij/uiDesigner/icons/scrollbar.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n        <default-constraints vsize-policy=\"6\" hsize-policy=\"0\" anchor=\"0\" fill=\"2\" />\n      </item>\n    </group>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/workspace.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ChangeListManager\">\n    <list default=\"true\" id=\"b0f6b19a-54cb-47c6-bec5-1b7298521fee\" name=\"Default\" comment=\"\">\n      <change beforePath=\"$PROJECT_DIR$/.idea/misc.xml\" beforeDir=\"false\" afterPath=\"$PROJECT_DIR$/.idea/misc.xml\" afterDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/.idea/workspace.xml\" beforeDir=\"false\" afterPath=\"$PROJECT_DIR$/.idea/workspace.xml\" afterDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Access.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/And.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Arithmetic.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Break.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Constant.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Do.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Else.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Expression.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Identifier.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/If.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Logical.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Node.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Not.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Operator.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Or.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Relation.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Sequence.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Set.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/SetElem.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Statement.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Temp.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/Unary.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/interpreter/While.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Lexer.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Numeric.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Real.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Tag.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Token.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/lexer/Word.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/main/Compiler.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/main/CompilerTestDriver.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/main/Main.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/parser/Parser.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/symbols/Array.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/symbols/Environment.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/out/production/LiXinCompiler/com/lixin/symbols/Type.class\" beforeDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/src/com/lixin/main/Compiler.java\" beforeDir=\"false\" afterPath=\"$PROJECT_DIR$/src/com/lixin/main/Compiler.java\" afterDir=\"false\" />\n      <change beforePath=\"$PROJECT_DIR$/src/com/lixin/main/CompilerTestDriver.java\" beforeDir=\"false\" afterPath=\"$PROJECT_DIR$/src/com/lixin/main/CompilerTestDriver.java\" afterDir=\"false\" />\n    </list>\n    <ignored path=\"$PROJECT_DIR$/out/\" />\n    <option name=\"EXCLUDED_CONVERTED_TO_IGNORED\" value=\"true\" />\n    <option name=\"SHOW_DIALOG\" value=\"false\" />\n    <option name=\"HIGHLIGHT_CONFLICTS\" value=\"true\" />\n    <option name=\"HIGHLIGHT_NON_ACTIVE_CHANGELIST\" value=\"false\" />\n    <option name=\"LAST_RESOLUTION\" value=\"IGNORE\" />\n  </component>\n  <component name=\"FileEditorManager\">\n    <leaf SIDE_TABS_SIZE_LIMIT_KEY=\"300\">\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/Main.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"285\">\n              <caret line=\"15\" column=\"25\" lean-forward=\"true\" selection-start-line=\"15\" selection-start-column=\"25\" selection-end-line=\"15\" selection-end-column=\"25\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Break.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"95\">\n              <caret line=\"5\" column=\"13\" selection-start-line=\"5\" selection-start-column=\"13\" selection-end-line=\"5\" selection-end-column=\"13\" />\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Constant.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"38\">\n              <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Type.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"38\">\n              <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Environment.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"399\">\n              <caret line=\"23\" column=\"39\" lean-forward=\"true\" selection-start-line=\"23\" selection-start-column=\"39\" selection-end-line=\"23\" selection-end-column=\"39\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/parser/Parser.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"-3531\">\n              <caret line=\"104\" column=\"22\" lean-forward=\"true\" selection-start-line=\"104\" selection-start-column=\"22\" selection-end-line=\"104\" selection-end-column=\"22\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Array.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"133\">\n              <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"true\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/CompilerTestDriver.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"285\">\n              <caret line=\"15\" column=\"23\" lean-forward=\"true\" selection-start-line=\"15\" selection-start-column=\"23\" selection-end-line=\"15\" selection-end-column=\"23\" />\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Do.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"133\">\n              <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n            </state>\n          </provider>\n        </entry>\n      </file>\n      <file pinned=\"false\" current-in-tab=\"false\">\n        <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/Compiler.java\">\n          <provider selected=\"true\" editor-type-id=\"text-editor\">\n            <state relative-caret-position=\"178\">\n              <caret line=\"15\" selection-start-line=\"15\" selection-end-line=\"15\" />\n              <folding>\n                <element signature=\"imports\" expanded=\"true\" />\n              </folding>\n            </state>\n          </provider>\n        </entry>\n      </file>\n    </leaf>\n  </component>\n  <component name=\"FileTemplateManagerImpl\">\n    <option name=\"RECENT_TEMPLATES\">\n      <list>\n        <option value=\"Class\" />\n      </list>\n    </option>\n  </component>\n  <component name=\"FindInProjectRecents\">\n    <findStrings>\n      <find>Temp</find>\n      <find>\\n</find>\n    </findStrings>\n    <replaceStrings>\n      <replace>\\r\\n</replace>\n    </replaceStrings>\n  </component>\n  <component name=\"Git.Settings\">\n    <option name=\"RECENT_GIT_ROOT_PATH\" value=\"$PROJECT_DIR$\" />\n  </component>\n  <component name=\"IdeDocumentHistory\">\n    <option name=\"CHANGED_PATHS\">\n      <list>\n        <option value=\"$PROJECT_DIR$/../Great-Li-Xin.github.io/source/_posts/LiXinCompiler.md\" />\n        <option value=\"$PROJECT_DIR$/src/com/lixin/main/in.txt\" />\n        <option value=\"$PROJECT_DIR$/src/com/lixin/main/Test.java\" />\n        <option value=\"$PROJECT_DIR$/src/com/lixin/lexer/Lexer.java\" />\n        <option value=\"$PROJECT_DIR$/src/com/lixin/main/Compiler.java\" />\n        <option value=\"$PROJECT_DIR$/src/com/lixin/main/CompilerTestDriver.java\" />\n      </list>\n    </option>\n  </component>\n  <component name=\"ProjectFrameBounds\" extendedState=\"6\">\n    <option name=\"y\" value=\"22\" />\n    <option name=\"width\" value=\"1680\" />\n    <option name=\"height\" value=\"960\" />\n  </component>\n  <component name=\"ProjectView\">\n    <navigator proportions=\"\" version=\"1\">\n      <foldersAlwaysOnTop value=\"true\" />\n    </navigator>\n    <panes>\n      <pane id=\"ProjectPane\">\n        <subPane>\n          <expand>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"interpreter\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lexer\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"main\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"parser\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n            <path>\n              <item name=\"LiXinCompiler\" type=\"b2602c69:ProjectViewProjectNode\" />\n              <item name=\"LiXinCompiler\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"src\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"lixin\" type=\"462c0819:PsiDirectoryNode\" />\n              <item name=\"symbols\" type=\"462c0819:PsiDirectoryNode\" />\n            </path>\n          </expand>\n          <select />\n        </subPane>\n      </pane>\n      <pane id=\"PackagesPane\" />\n      <pane id=\"Scope\" />\n    </panes>\n  </component>\n  <component name=\"PropertiesComponent\">\n    <property name=\"SearchEverywhereHistoryKey\" value=\"Temp&#9;PSI&#9;JAVA://com.lixin.lexer.Tag#TEMP&#10;emit&#9;PSI&#9;JAVA://com.lixin.interpreter.Node#emit\" />\n    <property name=\"WebServerToolWindowFactoryState\" value=\"false\" />\n    <property name=\"aspect.path.notification.shown\" value=\"true\" />\n    <property name=\"com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp\" value=\"1538548992947\" />\n    <property name=\"last_opened_file_path\" value=\"$PROJECT_DIR$\" />\n    <property name=\"nodejs_interpreter_path.stuck_in_default_project\" value=\"undefined stuck path\" />\n    <property name=\"nodejs_npm_path_reset_for_default_project\" value=\"true\" />\n    <property name=\"project.structure.last.edited\" value=\"Modules\" />\n    <property name=\"project.structure.proportion\" value=\"0.0\" />\n    <property name=\"project.structure.side.proportion\" value=\"0.0\" />\n  </component>\n  <component name=\"RunDashboard\">\n    <option name=\"ruleStates\">\n      <list>\n        <RuleState>\n          <option name=\"name\" value=\"ConfigurationTypeDashboardGroupingRule\" />\n        </RuleState>\n        <RuleState>\n          <option name=\"name\" value=\"StatusDashboardGroupingRule\" />\n        </RuleState>\n      </list>\n    </option>\n  </component>\n  <component name=\"RunManager\" selected=\"Application.CompilerTestDriver\">\n    <configuration default=\"true\" type=\"AndroidRunConfigurationType\" factoryName=\"Android App\" singleton=\"true\">\n      <module name=\"\" />\n      <option name=\"DEPLOY\" value=\"true\" />\n      <option name=\"ARTIFACT_NAME\" value=\"\" />\n      <option name=\"PM_INSTALL_OPTIONS\" value=\"\" />\n      <option name=\"ACTIVITY_EXTRA_FLAGS\" value=\"\" />\n      <option name=\"MODE\" value=\"default_activity\" />\n      <option name=\"CLEAR_LOGCAT\" value=\"false\" />\n      <option name=\"SHOW_LOGCAT_AUTOMATICALLY\" value=\"false\" />\n      <option name=\"SKIP_NOOP_APK_INSTALLATIONS\" value=\"true\" />\n      <option name=\"FORCE_STOP_RUNNING_APP\" value=\"true\" />\n      <option name=\"TARGET_SELECTION_MODE\" value=\"SHOW_DIALOG\" />\n      <option name=\"USE_LAST_SELECTED_DEVICE\" value=\"false\" />\n      <option name=\"PREFERRED_AVD\" value=\"\" />\n      <option name=\"DEBUGGER_TYPE\" value=\"Java\" />\n      <Java />\n      <Profilers>\n        <option name=\"ADVANCED_PROFILING_ENABLED\" value=\"false\" />\n      </Profilers>\n      <option name=\"DEEP_LINK\" value=\"\" />\n      <option name=\"ACTIVITY_CLASS\" value=\"\" />\n      <method v=\"2\">\n        <option name=\"Android.Gradle.BeforeRunTask\" enabled=\"true\" />\n        <option name=\"com.android.instantApps.provision.BeforeRunTask\" enabled=\"true\" clearCache=\"false\" clearProvisionedDevices=\"false\" />\n      </method>\n    </configuration>\n    <configuration default=\"true\" type=\"AndroidTestRunConfigurationType\" factoryName=\"Android Instrumented Tests\" singleton=\"true\">\n      <module name=\"\" />\n      <option name=\"TESTING_TYPE\" value=\"0\" />\n      <option name=\"INSTRUMENTATION_RUNNER_CLASS\" value=\"\" />\n      <option name=\"METHOD_NAME\" value=\"\" />\n      <option name=\"CLASS_NAME\" value=\"\" />\n      <option name=\"PACKAGE_NAME\" value=\"\" />\n      <option name=\"EXTRA_OPTIONS\" value=\"\" />\n      <option name=\"CLEAR_LOGCAT\" value=\"false\" />\n      <option name=\"SHOW_LOGCAT_AUTOMATICALLY\" value=\"false\" />\n      <option name=\"SKIP_NOOP_APK_INSTALLATIONS\" value=\"true\" />\n      <option name=\"FORCE_STOP_RUNNING_APP\" value=\"true\" />\n      <option name=\"TARGET_SELECTION_MODE\" value=\"SHOW_DIALOG\" />\n      <option name=\"USE_LAST_SELECTED_DEVICE\" value=\"false\" />\n      <option name=\"PREFERRED_AVD\" value=\"\" />\n      <option name=\"DEBUGGER_TYPE\" value=\"Java\" />\n      <Java />\n      <Profilers>\n        <option name=\"ADVANCED_PROFILING_ENABLED\" value=\"false\" />\n      </Profilers>\n      <method v=\"2\">\n        <option name=\"Android.Gradle.BeforeRunTask\" enabled=\"true\" />\n        <option name=\"com.android.instantApps.provision.BeforeRunTask\" enabled=\"true\" clearCache=\"false\" clearProvisionedDevices=\"false\" />\n      </method>\n    </configuration>\n    <configuration name=\"Compiler\" type=\"Application\" factoryName=\"Application\" temporary=\"true\" nameIsGenerated=\"true\">\n      <option name=\"MAIN_CLASS_NAME\" value=\"com.lixin.main.Compiler\" />\n      <module name=\"LiXinCompiler\" />\n      <extension name=\"coverage\">\n        <pattern>\n          <option name=\"PATTERN\" value=\"com.lixin.main.*\" />\n          <option name=\"ENABLED\" value=\"true\" />\n        </pattern>\n      </extension>\n      <method v=\"2\">\n        <option name=\"Make\" enabled=\"true\" />\n      </method>\n    </configuration>\n    <configuration name=\"CompilerTestDriver\" type=\"Application\" factoryName=\"Application\" temporary=\"true\" nameIsGenerated=\"true\">\n      <option name=\"MAIN_CLASS_NAME\" value=\"com.lixin.main.CompilerTestDriver\" />\n      <module name=\"LiXinCompiler\" />\n      <extension name=\"coverage\">\n        <pattern>\n          <option name=\"PATTERN\" value=\"com.lixin.main.*\" />\n          <option name=\"ENABLED\" value=\"true\" />\n        </pattern>\n      </extension>\n      <method v=\"2\">\n        <option name=\"Make\" enabled=\"true\" />\n      </method>\n    </configuration>\n    <configuration name=\"Main\" type=\"Application\" factoryName=\"Application\" temporary=\"true\" nameIsGenerated=\"true\">\n      <option name=\"MAIN_CLASS_NAME\" value=\"com.lixin.main.Main\" />\n      <module name=\"LiXinCompiler\" />\n      <extension name=\"coverage\">\n        <pattern>\n          <option name=\"PATTERN\" value=\"com.lixin.main.*\" />\n          <option name=\"ENABLED\" value=\"true\" />\n        </pattern>\n      </extension>\n      <method v=\"2\">\n        <option name=\"Make\" enabled=\"true\" />\n      </method>\n    </configuration>\n    <list>\n      <item itemvalue=\"Application.Main\" />\n      <item itemvalue=\"Application.Compiler\" />\n      <item itemvalue=\"Application.CompilerTestDriver\" />\n    </list>\n    <recent_temporary>\n      <list>\n        <item itemvalue=\"Application.CompilerTestDriver\" />\n        <item itemvalue=\"Application.Compiler\" />\n        <item itemvalue=\"Application.Main\" />\n      </list>\n    </recent_temporary>\n  </component>\n  <component name=\"SvnConfiguration\">\n    <configuration />\n  </component>\n  <component name=\"TaskManager\">\n    <task active=\"true\" id=\"Default\" summary=\"Default task\">\n      <changelist id=\"b0f6b19a-54cb-47c6-bec5-1b7298521fee\" name=\"Default\" comment=\"\" />\n      <created>1527577851234</created>\n      <option name=\"number\" value=\"Default\" />\n      <option name=\"presentableId\" value=\"Default\" />\n      <updated>1527577851234</updated>\n      <workItem from=\"1527577852995\" duration=\"9000\" />\n      <workItem from=\"1527577894873\" duration=\"465000\" />\n      <workItem from=\"1527583157860\" duration=\"116000\" />\n      <workItem from=\"1527683150744\" duration=\"5472000\" />\n      <workItem from=\"1527727096029\" duration=\"258000\" />\n      <workItem from=\"1527728096063\" duration=\"486000\" />\n      <workItem from=\"1538548506950\" duration=\"465000\" />\n    </task>\n    <servers />\n  </component>\n  <component name=\"TimeTrackingManager\">\n    <option name=\"totallyTimeSpent\" value=\"7271000\" />\n  </component>\n  <component name=\"ToolWindowManager\">\n    <frame x=\"0\" y=\"23\" width=\"1680\" height=\"959\" extended-state=\"6\" />\n    <editor active=\"true\" />\n    <layout>\n      <window_info content_ui=\"combo\" id=\"Project\" order=\"0\" visible=\"true\" weight=\"0.26800978\" />\n      <window_info id=\"Structure\" order=\"1\" side_tool=\"true\" weight=\"0.25\" />\n      <window_info id=\"Designer\" order=\"2\" />\n      <window_info id=\"Image Layers\" order=\"3\" />\n      <window_info id=\"Capture Tool\" order=\"4\" />\n      <window_info id=\"UI Designer\" order=\"5\" />\n      <window_info id=\"Learn\" order=\"6\" />\n      <window_info id=\"Favorites\" order=\"7\" side_tool=\"true\" />\n      <window_info anchor=\"bottom\" id=\"Duplicate detector\" weight=\"0.3298731\" />\n      <window_info anchor=\"bottom\" id=\"Message\" order=\"0\" />\n      <window_info anchor=\"bottom\" id=\"Find\" order=\"1\" weight=\"0.32949308\" />\n      <window_info anchor=\"bottom\" id=\"Run\" order=\"2\" weight=\"0.32871974\" />\n      <window_info anchor=\"bottom\" id=\"Debug\" order=\"3\" weight=\"0.4\" />\n      <window_info anchor=\"bottom\" id=\"Cvs\" order=\"4\" weight=\"0.25\" />\n      <window_info anchor=\"bottom\" id=\"Inspection\" order=\"5\" weight=\"0.4\" />\n      <window_info anchor=\"bottom\" id=\"TODO\" order=\"6\" />\n      <window_info anchor=\"bottom\" id=\"Version Control\" order=\"7\" />\n      <window_info anchor=\"bottom\" id=\"Database Changes\" order=\"8\" show_stripe_button=\"false\" />\n      <window_info anchor=\"bottom\" id=\"Terminal\" order=\"9\" />\n      <window_info anchor=\"bottom\" id=\"Event Log\" order=\"10\" side_tool=\"true\" />\n      <window_info anchor=\"bottom\" id=\"Messages\" order=\"11\" weight=\"0.32871974\" />\n      <window_info anchor=\"right\" id=\"Maven\" />\n      <window_info anchor=\"right\" id=\"Commander\" internal_type=\"SLIDING\" order=\"0\" type=\"SLIDING\" weight=\"0.4\" />\n      <window_info anchor=\"right\" id=\"Ant Build\" order=\"1\" weight=\"0.25\" />\n      <window_info anchor=\"right\" content_ui=\"combo\" id=\"Hierarchy\" order=\"2\" weight=\"0.25\" />\n      <window_info anchor=\"right\" id=\"Palette\" order=\"3\" />\n      <window_info anchor=\"right\" id=\"Capture Analysis\" order=\"4\" />\n      <window_info anchor=\"right\" id=\"Theme Preview\" order=\"5\" />\n      <window_info anchor=\"right\" id=\"Palette&#9;\" order=\"6\" />\n      <window_info anchor=\"right\" id=\"Database\" order=\"7\" />\n      <window_info anchor=\"right\" id=\"Maven Projects\" order=\"8\" />\n    </layout>\n  </component>\n  <component name=\"TypeScriptGeneratedFilesManager\">\n    <option name=\"version\" value=\"1\" />\n  </component>\n  <component name=\"editorHistoryManager\">\n    <entry file=\"file://$PROJECT_DIR$/../Great-Li-Xin.github.io/source/_posts/LiXinCompiler.md\">\n      <provider selected=\"true\" editor-type-id=\"split-provider[text-editor;markdown-preview-editor]\">\n        <state split_layout=\"SPLIT\">\n          <first_editor relative-caret-position=\"19\">\n            <caret line=\"59\" column=\"9\" selection-start-line=\"59\" selection-start-column=\"9\" selection-end-line=\"59\" selection-end-column=\"9\" />\n          </first_editor>\n          <second_editor />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Not.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/in.txt\" />\n    <entry file=\"jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/src.zip!/java/io/ByteArrayOutputStream.java\" />\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Logical.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"8\" column=\"13\" selection-start-line=\"8\" selection-start-column=\"13\" selection-end-line=\"8\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Node.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"304\">\n          <caret line=\"22\" column=\"5\" lean-forward=\"true\" selection-start-line=\"22\" selection-start-column=\"5\" selection-end-line=\"22\" selection-end-column=\"5\" />\n          <folding>\n            <element signature=\"e#419#420#0\" expanded=\"true\" />\n            <element signature=\"e#466#467#0\" expanded=\"true\" />\n            <element signature=\"e#505#506#0\" expanded=\"true\" />\n            <element signature=\"e#554#555#0\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/If.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Identifier.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"8\" column=\"13\" selection-start-line=\"8\" selection-start-column=\"13\" selection-end-line=\"8\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Else.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"-73\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Expression.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"193\">\n          <caret line=\"31\" column=\"14\" selection-start-line=\"31\" selection-start-column=\"14\" selection-end-line=\"31\" selection-end-column=\"14\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Operator.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"247\">\n          <caret line=\"16\" column=\"9\" lean-forward=\"true\" selection-start-line=\"16\" selection-start-column=\"9\" selection-end-line=\"16\" selection-end-column=\"9\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/LiXinCompiler.iml\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\" />\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/README.md\">\n      <provider selected=\"true\" editor-type-id=\"split-provider[text-editor;markdown-preview-editor]\">\n        <state split_layout=\"SPLIT\">\n          <first_editor relative-caret-position=\"4161\">\n            <caret line=\"219\" selection-start-line=\"219\" selection-end-line=\"227\" selection-end-column=\"1\" />\n          </first_editor>\n          <second_editor />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Temp.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"323\">\n          <caret line=\"20\" column=\"5\" selection-start-line=\"20\" selection-start-column=\"5\" selection-end-line=\"20\" selection-end-column=\"5\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/lexer/Lexer.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"2280\">\n          <caret line=\"125\" column=\"25\" selection-start-line=\"125\" selection-start-column=\"25\" selection-end-line=\"125\" selection-end-column=\"25\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/lexer/Tag.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"323\">\n          <caret line=\"17\" column=\"24\" selection-start-line=\"17\" selection-start-column=\"24\" selection-end-line=\"17\" selection-end-column=\"24\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/While.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Access.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"38\">\n          <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/And.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Arithmetic.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"38\">\n          <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Break.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"95\">\n          <caret line=\"5\" column=\"13\" selection-start-line=\"5\" selection-start-column=\"13\" selection-end-line=\"5\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Do.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/interpreter/Constant.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"38\">\n          <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Type.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"38\">\n          <caret line=\"2\" column=\"7\" lean-forward=\"true\" selection-start-line=\"2\" selection-start-column=\"7\" selection-end-line=\"2\" selection-end-column=\"7\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Environment.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"399\">\n          <caret line=\"23\" column=\"39\" lean-forward=\"true\" selection-start-line=\"23\" selection-start-column=\"39\" selection-end-line=\"23\" selection-end-column=\"39\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/symbols/Array.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"133\">\n          <caret line=\"7\" column=\"13\" selection-start-line=\"7\" selection-start-column=\"13\" selection-end-line=\"7\" selection-end-column=\"13\" />\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/parser/Parser.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"-3531\">\n          <caret line=\"104\" column=\"22\" lean-forward=\"true\" selection-start-line=\"104\" selection-start-column=\"22\" selection-end-line=\"104\" selection-end-column=\"22\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/Compiler.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"178\">\n          <caret line=\"15\" selection-start-line=\"15\" selection-end-line=\"15\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/Main.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"285\">\n          <caret line=\"15\" column=\"25\" lean-forward=\"true\" selection-start-line=\"15\" selection-start-column=\"25\" selection-end-line=\"15\" selection-end-column=\"25\" />\n          <folding>\n            <element signature=\"imports\" expanded=\"true\" />\n          </folding>\n        </state>\n      </provider>\n    </entry>\n    <entry file=\"file://$PROJECT_DIR$/src/com/lixin/main/CompilerTestDriver.java\">\n      <provider selected=\"true\" editor-type-id=\"text-editor\">\n        <state relative-caret-position=\"285\">\n          <caret line=\"15\" column=\"23\" lean-forward=\"true\" selection-start-line=\"15\" selection-start-column=\"23\" selection-end-line=\"15\" selection-end-column=\"23\" />\n        </state>\n      </provider>\n    </entry>\n  </component>\n  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ArtifactsStructureConfigurable.UI\">\n        <settings>\n          <artifact-editor />\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"FacetStructureConfigurable.UI\">\n        <settings>\n          <last-edited>No facets are configured</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"GlobalLibrariesConfigurable.UI\">\n        <settings>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"JdkListConfigurable.UI\">\n        <settings>\n          <last-edited>1.8</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"ModuleStructureConfigurable.UI\">\n        <settings>\n          <last-edited>LiXinCompiler</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n                <option value=\"0.6\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>11</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n      <state key=\"ProjectLibrariesConfigurable.UI\">\n        <settings>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 李欣\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "LiXinCompiler.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/src\" isTestSource=\"false\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>"
  },
  {
    "path": "README.md",
    "content": "# LiXinCompiler\nReferenced from the dragon-book, just a little implementation of the dragon-book language.\n\n参考自龙书上的语言，自己实现了一个编译器的前端。\n\n## GitHub链接\n- [LiXinCompiler](https://github.com/realJustinLee/LiXinCompiler)\n\n## 源语言\n这个语言由一个程序和一个块组成，该块中包含可选的声名和语句。语法符号```basic```表示基本类型。\n\n```\nprogram     ->  block\nblock       ->  { declause statemets }\ndeclause    ->  decaluse debracket | ϵ\ndebrcket    ->  type identity ;\ntype        ->  type [ num ] | basic\nstatements  ->  statements statement | ϵ\n```\n为了简化翻译工作，我们把赋值当成了一个语句.\n```\nstatement   ->  location = bool ;\n            |   if ( bool ) statement\n            |   if ( bool ) stetement else statement\n            |   while ( bool ) statement\n            |   do statement while ( bool ) ;\n            |   break ;\n            |   block\nlocation    ->  location [ bool ] | identity\n```\n表达式的产生式处理了运算符的结合性和优先级。它们对每个优先级都使用了一个非终结符号，而非终结符号```factor```用来表示括号中的表达式、标识符、数组引用和常量.\n```\nbool        ->  bool || join | join\njoin        ->  join && equality | equality\nequality    ->  equality == relation | equality != relation | relation\nrelation    ->  expression < expression | expressoion <= expression | \n                expressoion >= expression | expressoion > expression | expression\nexpression  ->  expression + term | expression - term | term\nterm        ->  term * unary | term / unary | unary\nfactor      ->  ( bool ) | location | numeric | real | true | false\n```\n## 测试样例\n### block:\n输入\n```\nlxc>\n{\n\tint a; int b; a = 0; b = 0;\n\t{\n\t\tint b; b = 1;\n\t\t{\n\t\t\tint a; a = 2;\n\t\t}\n\t\t{\n\t\t\tint b; b = 3;\n\t\t}\n\t\ta = a + 1; b = b + 1;\n\t}\n\ta = a + 1; b = b + 1;\n}\n```\n输出\n```\nL1:\ta = 0\nL3:\tb = 0\nL4:\tb = 1\nL6:\ta = 2\nL7:\tb = 3\nL8:\ta = a + 1\nL9:\tb = b + 1\nL5:\ta = a + 1\nL10:    b = b + 1\nL2:\n```\n### expression:\n输入\n```\nlxc>\n{\n\tint i; float x; bool b;\n\ti = 0;\n\ti = 365;\n\tx = 0.0;\n\tx = 3.14159;\n\tb = true;\n\tb = false;\n\ti = x;\n\tx = i;\n}\n```\n输出\n```\nL1:\ti = 0\nL3:\ti = 365\nL4:\tx = 0.0\nL5:\tx = 3.1415896\nL6:\tb = true\nL7:\tb = false\nL8:\ti = x\nL9:\tx = i\nL2:\n```\n### identity:\n输入\n```\nlxc>\n{\n\tint i; int j; float[10][10] a;\n\ti = 0;\n\twhile ( i < 10 ) {\n\t\tj = 0;\n\t\twhile ( j < 10 ) {\n\t\t\ta[i][j] = 0.0;\n\t\t\tj = j + 1;\n\t\t}\n\t\ti = i + 1;\n\t}\n\ti = 0;\n\twhile ( i < 10 ) {\n\t\ta[i][i] = 1.0;\n\t\ti = i + 1;\n\t}\n}\n```\n输出\n```\nL1:\ti = 0\nL3:\tif not i < 10 goto L4\nL5:\tj = 0\nL6:\tif not j < 10 goto L7\nL8:\tt1 = i * 80\n\tt2 = j * 8\n\tt3 = t1 + t2\n\ta [ t3 ] = 0.0\nL9:\tj = j + 1\n\tgoto L6\nL7:\ti = i + 1\n\tgoto L3\nL4:\ti = 0\nL10:\tif not i < 10 goto L2\nL11:\tt4 = i * 80\n\tt5 = i * 8\n\tt6 = t4 + t5\n\ta [ t6 ] = 1.0\nL12:\ti = i + 1\n\tgoto L10\nL2:\n```\n### jump:\n输入\n```\nlxc>\n{\n    int x; int y; int a; int b;\n\tif( true ) a = 0;\n\tif( false ) x = 0;\n\tif ( a < b ) a = b;\n\tif ( x <= y ) x = y;\n\tif ( a == b ) a = b;\n\tif ( x != y ) x = y;\n\tif ( a >= b ) b = a;\n\tif ( x > y ) y = x;\n\tif ( a == b );\n\tif( x < 100 || x > 200 ) x = 0;\n\tif( a < 100 && a > 200 ) b = 0;\n\tif( x < 100 || (x > 200 && x != y) ) x = 0;\n\tif( a < 100 || (a > 200 && a != 150) || a != 0 ) a = 0;\n\tif( x > 200 && x != b || x < 100 ) x = 0;\n\tif( a < 100 || a > 200 && a != b ) a = 0;\n}\n```\n输出\n```\nL1:L4:\ta = 0\nL3:\tgoto L5\nL6:\tx = 0\nL5:\tif not a < b goto L7\nL8:\ta = b\nL7:\tif not x <= y goto L9\nL10:\tx = y\nL9:\tif not a == b goto L11\nL12:\ta = b\nL11:\tif not x != y goto L13\nL14:\tx = y\nL13:\tif not a >= b goto L15\nL16:\tb = a\nL15:\tif not x > y goto L17\nL18:\ty = x\nL17:\tif not a == b goto L19\nL20:L19:\tif x < 100 goto L23\n\tif not x > 200 goto L21\nL23:L22:\tx = 0\nL21:\tif not a < 100 goto L24\n\tif not a > 200 goto L24\nL25:\tb = 0\nL24:\tif x < 100 goto L28\n\tif not x > 200 goto L26\n\tif not x != y goto L26\nL28:L27:\tx = 0\nL26:\tif a < 100 goto L31\n\tif a != 150 goto L31\nL32:\tif not a != 0 goto L29\nL31:L30:\ta = 0\nL29:\tif x != b goto L35\nL36:\tif not x < 100 goto L33\nL35:L34:\tx = 0\nL33:\tif a < 100 goto L38\n\tif not a > 200 goto L2\n\tif not a != b goto L2\nL38:L37:\ta = 0\nL2:\n```\n### program:\n输入\n```\nlxc>\n{\n\tint i; int j; float v; float x; float[100] a;\n\twhile( true ) {\n\t\tdo i = i+1; while( a[i] < v);\n\t\tdo j = j-1; while( a[j] > v);\n\t\tif( i >= j ) break;\n\t\tx = a[i]; a[i] = a[j]; a[j] = x;\n\t}\n}\n```\n输出\n```\nL1:L3:\ti = i + 1\nL5:\tt1 = i * 8\n\tt2 = a [ t1 ]\n\tif t2 < v goto L3\nL4:\tj = j - 1\nL7:\tt3 = j * 8\n\tt4 = a [ t3 ]\n\tif t4 > v goto L4\nL6:\tif not i >= j goto L8\nL9:\tgoto L2\nL8:\tt5 = i * 8\n\tx = a [ t5 ]\nL10:\tt6 = i * 8\n\tt7 = j * 8\n\tt8 = a [ t7 ]\n\ta [ t6 ] = t8\nL11:\tt9 = j * 8\n\ta [ t9 ] = x\n\tgoto L1\nL2:\n```\n# 关于BUG、建议与意见\n请在[GitHub](https://github.com/realJustinLee/LiXinCompiler)中提[issue](https://github.com/realJustinLee/LiXinCompiler/issues/new)\n\n我会尽快回答\n"
  },
  {
    "path": "src/com/lixin/interpreter/Access.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Tag;\nimport com.lixin.lexer.Word;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Access extends Operator {\n    Identifier array;\n    Expression index;\n\n    /**\n     * @param array 数组\n     * @param index 下标\n     * @param type  数组元素类型\n     */\n    public Access(Identifier array, Expression index, Type type) {\n        super(new Word(\"[]\", Tag.INDEX), type);\n        this.array = array;\n        this.index = index;\n    }\n\n    @Override\n    public Expression generate() {\n        return new Access(array, index.reduce(), type);\n    }\n\n    @Override\n    public void jumping(int positive, int negative) {\n        emitJumps(reduce().toString(), positive, negative);\n    }\n\n    @Override\n    public String toString() {\n        return array.toString() + \" [ \" + index.toString() + \" ]\";\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/And.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\n\n/**\n * @author lixin\n */\npublic class And extends Logical {\n    public And(Token token, Expression expression1, Expression expression2) {\n        super(token, expression1, expression2);\n    }\n\n    @Override\n    public void jumping(int positive, int negative) {\n        int label = negative != 0 ? negative : newLabel();\n        expression1.jumping(0, negative);\n        expression2.jumping(positive, negative);\n        if (negative == 0) {\n            emitLabel(label);\n        }\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Arithmetic.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Arithmetic extends Operator {\n    private Expression expression1, expression2;\n\n    public Arithmetic(Token token, Expression expression1, Expression expression2) {\n        super(token, null);\n        this.expression1 = expression1;\n        this.expression2 = expression2;\n        type = Type.max(expression1.type, expression2.type);\n        if (type == null) {\n            error(\"type error\");\n        }\n    }\n\n    @Override\n    public Expression generate() {\n        return new Arithmetic(operator, expression1.reduce(), expression2.reduce());\n    }\n\n    @Override\n    public String toString() {\n        return expression1.toString() + \" \" + operator.toString() + \" \" + expression2.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Break.java",
    "content": "package com.lixin.interpreter;\n\n/**\n * @author lixin\n */\npublic class Break extends Statement {\n    private Statement statement;\n\n    public Break() {\n        if (Statement.ENCLOSING == Statement.NULL) {\n            error(\"unenclosed break\");\n        }\n        statement = Statement.ENCLOSING;\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        emit(\"goto L\" + statement.after);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Constant.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Numeric;\nimport com.lixin.lexer.Token;\nimport com.lixin.lexer.Word;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Constant extends Expression {\n    public Constant(Token token, Type type) {\n        super(token, type);\n    }\n\n    public Constant(int input) {\n        super(new Numeric(input), Type.INT);\n    }\n\n    public static final Constant\n            TRUE = new Constant(Word.TRUE, Type.BOOL),\n            FALSE = new Constant(Word.FALSE, Type.BOOL);\n\n    @Override\n    public void jumping(int positive, int negative) {\n        if (this == TRUE && positive != 0) {\n            emit(\"goto L\" + positive);\n        } else if (this == FALSE && negative != 0) {\n            emit(\"goto L\" + negative);\n        }\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Do.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Do extends Statement {\n    private Expression expression;\n    private Statement statement;\n\n    public Do() {\n        expression = null;\n        statement = null;\n    }\n\n    //  public void init(Expression expression1, Statement statement)\n\n    public void init(Statement statement, Expression expression) {\n        this.statement = statement;\n        this.expression = expression;\n        if (expression.type != Type.BOOL) {\n            expression.error(\"boolean required in do\");\n        }\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        after = first;\n        int label = newLabel();\n        statement.generate(begin, label);\n        emitLabel(label);\n        expression.jumping(begin, 0);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Else.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Else extends Statement {\n    private Expression expression;\n    private Statement statement1;\n    private Statement statement2;\n\n    public Else(Expression expression, Statement statement1, Statement statement2) {\n        this.expression = expression;\n        this.statement1 = statement1;\n        this.statement2 = statement2;\n        if (expression.type != Type.BOOL) {\n            expression.error(\"boolean required in if\");\n        }\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        int label1 = newLabel();\n        int label2 = newLabel();\n        expression.jumping(0, label2);\n        emitLabel(label1);\n        statement1.generate(label1, first);\n        emit(\"goto L\" + first);\n        emitLabel(label2);\n        statement2.generate(label2, first);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Expression.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Expression extends Node {\n    Token operator;\n    public Type type;\n\n    Expression(Token operator, Type type) {\n        this.operator = operator;\n        this.type = type;\n    }\n\n    public Expression generate() {\n        return this;\n    }\n\n    public Expression reduce() {\n        return this;\n    }\n\n    public void jumping(int positive, int negative) {\n        emitJumps(toString(), positive, negative);\n    }\n\n    void emitJumps(String condition, int positive, int negative) {\n        if (positive != 0 && negative != 0) {\n            emit(\"if \" + condition + \" goto L\" + positive);\n            emit(\"goto L\" + negative);\n        } else if (positive != 0) {\n            emit(\"if \" + condition + \" goto L\" + positive);\n        } else if (negative != 0) {\n            emit(\"if not \" + condition + \" goto L\" + negative);\n        }\n    }\n\n    @Override\n    public String toString() {\n        return operator.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Identifier.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Word;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Identifier extends Expression {\n    private int offset;\n\n    public Identifier(Word identifier, Type type, int offset) {\n        super(identifier, type);\n        this.offset = offset;\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/If.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class If extends Statement {\n    private Expression expression;\n    private Statement statement;\n\n    public If(Expression expression, Statement statement) {\n        this.expression = expression;\n        this.statement = statement;\n        if (expression.type != Type.BOOL) {\n            expression.error(\"boolean required in if\");\n        }\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        // statement 的代码标号\n        int label = newLabel();\n        expression.jumping(0, first);\n        emitLabel(label);\n        statement.generate(label, first);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Logical.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Logical extends Expression {\n    Expression expression1, expression2;\n\n    Logical(Token token, Expression expression1, Expression expression2) {\n        super(token, null);\n        this.expression1 = expression1;\n        this.expression2 = expression2;\n        type = check(expression1.type, expression2.type);\n        if (type == null) {\n            error(\"type error\");\n        }\n    }\n\n    public Type check(Type type1, Type type2) {\n        return type1 == Type.BOOL && type2 == Type.BOOL ? Type.BOOL : null;\n    }\n\n    @Override\n    public Expression generate() {\n        int negative = newLabel();\n        int after = newLabel();\n        Temp temp = new Temp(type);\n        this.jumping(0, negative);\n        emit(temp.toString() + \" = true\");\n        emit(\"goto L\" + after);\n        emitLabel(negative);\n        emit(temp.toString() + \" = false\");\n        emitLabel(after);\n        return temp;\n    }\n\n    @Override\n    public String toString() {\n        return expression1.toString() + \" \" + operator.toString() + \" \" + expression2.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Node.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Lexer;\n\n/**\n * @author lixin\n */\npublic class Node {\n    private int lexLine;\n\n    Node() {\n        lexLine = Lexer.line;\n    }\n\n    void error(String message) {\n        throw new Error(\"near line \" + lexLine + \": \" + message);\n    }\n\n    private static int labels = 0;\n\n    public int newLabel() {\n        return ++labels;\n    }\n\n    public void emitLabel(int i) {\n        System.out.print(\"L\" + i + \":\");\n    }\n\n    public void emit(String string) {\n        System.out.println(\"\\t\" + string);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Not.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\n\n/**\n * @author lixin\n */\npublic class Not extends Logical {\n    public Not(Token token, Expression expression2) {\n        super(token, expression2, expression2);\n    }\n\n    @Override\n    public void jumping(int positive, int negative) {\n        expression2.jumping(negative, positive);\n    }\n\n    @Override\n    public String toString() {\n        return operator.toString() + \" \" + expression2.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Operator.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Operator extends Expression {\n    Operator(Token token, Type type) {\n        super(token, type);\n    }\n\n    @Override\n    public Expression reduce() {\n        Expression expression = generate();\n        Temp temp = new Temp(type);\n        emit(temp.toString() + \" = \" + expression.toString());\n        return temp;\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Or.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\n\n/**\n * @author lixin\n */\npublic class Or extends Logical {\n    public Or(Token token, Expression expression1, Expression expression2) {\n        super(token, expression1, expression2);\n    }\n\n    @Override\n    public void jumping(int positive, int negative) {\n        int label = positive != 0 ? positive : newLabel();\n        expression1.jumping(label, 0);\n        expression2.jumping(positive, negative);\n        if (positive == 0) {\n            emitLabel(label);\n        }\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Relation.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Array;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Relation extends Logical {\n    public Relation(Token token, Expression expression1, Expression expression2) {\n        super(token, expression1, expression2);\n    }\n\n    @Override\n    public Type check(Type type1, Type type2) {\n        /*if (type1 instanceof Array || type2 instanceof Array) {\n            return null;\n        } else if (type1 == type2) {\n            return Type.BOOL;\n        } else {\n            return null;\n        }*/\n        return type1 instanceof Array || type2 instanceof Array ? null : type1 == type2 ? Type.BOOL : null;\n    }\n\n    @Override\n    public void jumping(int positive, int negative) {\n        Expression expressionA = expression1.reduce();\n        Expression expressionB = expression2.reduce();\n        String condition = expressionA.toString() + \" \" + operator.toString() + \" \" + expressionB.toString();\n        emitJumps(condition, positive, negative);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Sequence.java",
    "content": "package com.lixin.interpreter;\n\n/**\n * @author lixin\n */\npublic class Sequence extends Statement {\n    private Statement statement1;\n    private Statement statement2;\n\n    public Sequence(Statement statement1, Statement statement2) {\n        this.statement1 = statement1;\n        this.statement2 = statement2;\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        if (statement1 == Statement.NULL) {\n            statement2.generate(begin, first);\n        } else if (statement2 == Statement.NULL) {\n            statement1.generate(begin, first);\n        } else {\n            int label = newLabel();\n            statement1.generate(begin, label);\n            emitLabel(label);\n            statement2.generate(label, first);\n        }\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Set.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Set extends Statement {\n    private Identifier identifier;\n    private Expression expression;\n\n    public Set(Identifier identifier, Expression expression) {\n        this.identifier = identifier;\n        this.expression = expression;\n        if (check(identifier.type, expression.type) == null) {\n            error(\"type error\");\n        }\n    }\n\n    private Type check(Type type1, Type type2) {\n        /*if (Type.numeric(type1) && Type.numeric(type2)) {\n            return type2;\n        } else if (type1 == Type.BOOL && type2 == Type.BOOL) {\n            return type2;\n        } else {\n            return null;\n        }*/\n        return Type.numeric(type1) && Type.numeric(type2) || type1 == Type.BOOL && type2 == Type.BOOL ? type2 : null;\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        emit(identifier.toString() + \" = \" + expression.generate().toString());\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/SetElem.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Array;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class SetElem extends Statement {\n    private Identifier array;\n    private Expression index;\n    private Expression expression;\n\n    public SetElem(Access access, Expression expression) {\n        array = access.array;\n        index = access.index;\n        this.expression = expression;\n        if (check(access.type, expression.type) == null) {\n            error(\"type error\");\n        }\n    }\n\n    private Type check(Type type1, Type type2) {\n        /*if (type1 instanceof Array || type2 instanceof Array) {\n            return null;\n        } else if (type1 == type2) {\n            return type2;\n        } else if (Type.numeric(type1) && Type.numeric(type2)) {\n            return type2;\n        } else {\n            return null;\n        }*/\n        return type1 instanceof Array || type2 instanceof Array ? null : (type1 == type2) || (Type.numeric(type1) && Type.numeric(type2)) ? type2 : null;\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        String stringIndex = index.reduce().toString();\n        String stringExpression = expression.reduce().toString();\n        emit(array.toString() + \" [ \" + stringIndex + \" ] = \" + stringExpression);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Statement.java",
    "content": "package com.lixin.interpreter;\n\n/**\n * @author lixin\n */\npublic class Statement extends Node {\n    public Statement() {\n    }\n\n    public static Statement NULL = new Statement();\n\n    /**\n     * @param begin 语句代码的开始处\n     * @param first 语句代码之后的第一条指令\n     */\n    public void generate(int begin, int first) {\n    }\n\n    /**\n     * 保存语句的下一条指令的标号\n     */\n    int after = 0;\n\n    /**\n     * 用于 break 语句\n     */\n    public static Statement ENCLOSING = Statement.NULL;\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Temp.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Word;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Temp extends Expression {\n    private static int count = 0;\n    private int number;\n\n    Temp(Type type) {\n        super(Word.TEMP, type);\n        number = ++count;\n    }\n\n    @Override\n    public String toString() {\n        return \"t\" + number;\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/Unary.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.lexer.Token;\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class Unary extends Operator {\n    public Expression expression;\n\n    public Unary(Token token, Expression expression) {\n        super(token, null);\n        this.expression = expression;\n        type = Type.max(Type.INT, expression.type);\n        if (type == null) {\n            error(\"type error\");\n        }\n    }\n\n    @Override\n    public Expression generate() {\n        return new Unary(operator, expression.reduce());\n    }\n\n    @Override\n    public String toString() {\n        return operator.toString() + \" \" + expression.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/interpreter/While.java",
    "content": "package com.lixin.interpreter;\n\nimport com.lixin.symbols.Type;\n\n/**\n * @author lixin\n */\npublic class While extends Statement {\n    private Expression expression;\n    private Statement statement;\n\n    public While() {\n        expression = null;\n        statement = null;\n    }\n\n    public void init(Expression expression, Statement statement) {\n        this.expression = expression;\n        this.statement = statement;\n        if (expression.type != Type.BOOL) {\n            expression.error(\"boolean required in while\");\n        }\n    }\n\n    @Override\n    public void generate(int begin, int first) {\n        after = first;\n        expression.jumping(0, first);\n        int label = newLabel();\n        emitLabel(label);\n        statement.generate(label, begin);\n        emit(\"goto L\" + begin);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Lexer.java",
    "content": "package com.lixin.lexer;\n\nimport com.lixin.symbols.Type;\n\nimport java.io.IOException;\nimport java.util.Hashtable;\n\n/**\n * @author lixin\n */\npublic class Lexer {\n    public static int line = 1;\n    private char peek = ' ';\n    private Hashtable<String, Word> words = new Hashtable<>();\n\n    private void reserve(Word word) {\n        words.put(word.lexeme, word);\n    }\n\n    public Lexer() {\n        reserve(new Word(\"if\", Tag.IF));\n        reserve(new Word(\"else\", Tag.ELSE));\n        reserve(new Word(\"while\", Tag.WHILE));\n        reserve(new Word(\"do\", Tag.DO));\n        reserve(new Word(\"break\", Tag.BREAK));\n        reserve(Word.TRUE);\n        reserve(Word.FALSE);\n        reserve(Type.INT);\n        reserve(Type.CHAR);\n        reserve(Type.BOOL);\n        reserve(Type.FLOAT);\n    }\n\n    private void readChar() throws IOException {\n        peek = (char) System.in.read();\n    }\n\n    private boolean readChar(char c) throws IOException {\n        readChar();\n        if (peek != c) {\n            return false;\n        } else {\n            peek = ' ';\n            return true;\n        }\n    }\n\n    public Token scan() throws IOException {\n        /*\n        for (; ; readChar()) {\n            if (peek == ' ' || peek == '\\t'|| peek == '\\r') {\n                continue;\n            } else if (peek == '\\n') {\n                line++;\n            } else {\n                break;\n            }\n        }\n        */\n\n        outerLoop:\n        while (true) {\n            switch (peek) {\n                case ' ':\n                case '\\t':\n                case '\\r':\n                    readChar();\n                    continue;\n                case '\\n':\n                    line++;\n                    break;\n                default:\n                    break outerLoop;\n            }\n            readChar();\n        }\n\n        switch (peek) {\n            case '&':\n                return readChar('&') ? Word.AND : new Token('&');\n            case '|':\n                return readChar('|') ? Word.OR : new Token('|');\n            case '=':\n                return readChar('=') ? Word.EQUAL : new Token('=');\n            case '!':\n                return readChar('=') ? Word.NOT_EQUAL : new Token('!');\n            case '<':\n                return readChar('=') ? Word.LESS_EQUAL : new Token('<');\n            case '>':\n                return readChar('=') ? Word.GREATER_EQUAL : new Token('>');\n            default:\n                break;\n        }\n\n        if (Character.isDigit(peek)) {\n            int value = 0;\n            do {\n                value = 10 * value + Character.digit(peek, 10);\n                readChar();\n            } while (Character.isDigit(peek));\n            if (peek != '.') {\n                return new Numeric(value);\n            }\n\n\n            // float preciseValue = value;\n            float preciseValue;\n            // Base Multiplier 默认 Decimal\n            float baseMultiplier = 10;\n            /*\n            while (true) {\n                readChar();\n                if (!Character.isDigit(peek)) {\n                    break;\n                }\n                preciseValue += Character.digit(peek, 10) / baseMultiplier;\n                baseMultiplier *= 10;\n            }\n            */\n            // 若删除下句则float会解析错误\n            readChar();\n            for (preciseValue = value; Character.isDigit(peek); readChar()) {\n                preciseValue += Character.digit(peek, 10) / baseMultiplier;\n                baseMultiplier *= 10;\n            }\n            return new Real(preciseValue);\n        }\n        if (Character.isLetter(peek)) {\n            StringBuilder builder = new StringBuilder();\n            do {\n                builder.append(peek);\n                readChar();\n            } while (Character.isLetterOrDigit(peek));\n            String string = builder.toString();\n            Word word = words.get(string);\n            if (word != null) {\n                return word;\n            }\n            word = new Word(string, Tag.IDENTIFIER);\n            words.put(string, word);\n            return word;\n        }\n        Token token = new Token(peek);\n        peek = ' ';\n        return token;\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Numeric.java",
    "content": "package com.lixin.lexer;\n\n/**\n * @author lixin\n */\npublic class Numeric extends Token {\n    public final int value;\n\n    public Numeric(int value) {\n        super(Tag.NUM);\n        this.value = value;\n    }\n\n    @Override\n    public String toString() {\n        return String.valueOf(value);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Real.java",
    "content": "package com.lixin.lexer;\n\n/**\n * @author lixin\n */\npublic class Real extends Token {\n    private final float value;\n\n    public Real(float value) {\n        super(Tag.REAL);\n        this.value = value;\n    }\n\n    @Override\n    public String toString() {\n        return String.valueOf(value);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Tag.java",
    "content": "package com.lixin.lexer;\n\n/**\n * @author lixin\n */\npublic class Tag {\n    public final static int\n            AND = 256,\n            BASIC = 257,\n            BREAK = 258,\n            DO = 259,\n            ELSE = 260,\n            EQUAL = 261,\n            FALSE = 262,\n            GREATER_EQUAL = 263,\n            IDENTIFIER = 264,\n            IF = 265,\n            INDEX = 266,\n            LESS_EQUAL = 267,\n            MINUS = 268,\n            NOT_EQUAL = 269,\n            NUM = 270,\n            OR = 271,\n            REAL = 272,\n            TEMP = 273,\n            TRUE = 274,\n            WHILE = 275;\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Token.java",
    "content": "package com.lixin.lexer;\n\n/**\n * @author lixin\n */\npublic class Token {\n    public final int tag;\n\n    public Token(int tag) {\n        this.tag = tag;\n    }\n\n    @Override\n    public String toString() {\n        return String.valueOf((char) tag);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/lexer/Word.java",
    "content": "package com.lixin.lexer;\n\n/**\n * @author lixin\n */\npublic class Word extends Token {\n    String lexeme;\n\n    public Word(String lexeme, int tag) {\n        super(tag);\n        this.lexeme = lexeme;\n    }\n\n    @Override\n    public String toString() {\n        return lexeme;\n    }\n\n    public static final Word\n            AND = new Word(\"&&\", Tag.AND),\n            OR = new Word(\"||\", Tag.OR),\n            EQUAL = new Word(\"==\", Tag.EQUAL),\n            NOT_EQUAL = new Word(\"!=\", Tag.NOT_EQUAL),\n            LESS_EQUAL = new Word(\"<=\", Tag.LESS_EQUAL),\n            GREATER_EQUAL = new Word(\">=\", Tag.GREATER_EQUAL),\n            MINUS = new Word(\"-\", Tag.MINUS),\n            TRUE = new Word(\"true\", Tag.TRUE),\n            FALSE = new Word(\"false\", Tag.FALSE),\n            TEMP = new Word(\"t\", Tag.TEMP);\n}\n"
  },
  {
    "path": "src/com/lixin/main/Compiler.java",
    "content": "package com.lixin.main;\n\nimport com.lixin.lexer.Lexer;\nimport com.lixin.parser.Parser;\n\nimport java.io.*;\n\n/**\n * @author lixin\n */\nclass Compiler {\n    void compile(File in, File out) {\n        InputStream sysIn = System.in;\n        PrintStream sysOut = System.out;\n        try {\n            FileInputStream fileInputStream = new FileInputStream(in);\n            System.setIn(fileInputStream);\n            FileOutputStream fileOutputStream = new FileOutputStream(out);\n            PrintStream printStream = new PrintStream(fileOutputStream);\n            System.setOut(printStream);\n            System.out.println(\"lxc>\");\n            Lexer lexer = new Lexer();\n            Parser parser = new Parser(lexer);\n            parser.program();\n            System.out.println();\n        } catch (Exception e) {\n            e.printStackTrace();\n        } finally {\n            System.setIn(sysIn);\n            System.setOut(sysOut);\n        }\n    }\n\n    String compile(String in) {\n        InputStream sysIn = System.in;\n        PrintStream sysOut = System.out;\n        try {\n            ByteArrayInputStream inputStream = new ByteArrayInputStream(in.getBytes());\n            System.setIn(inputStream);\n            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n            PrintStream printStream = new PrintStream(outputStream);\n            System.setOut(printStream);\n            System.out.println(\"lxc>\");\n            Lexer lexer = new Lexer();\n            Parser parser = new Parser(lexer);\n            parser.program();\n            System.out.println();\n            return outputStream.toString();\n        } catch (Exception e) {\n            e.printStackTrace();\n            return null;\n        } finally {\n            System.setIn(sysIn);\n            System.setOut(sysOut);\n        }\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/main/CompilerTestDriver.java",
    "content": "package com.lixin.main;\n\nimport java.io.File;\n\n/**\n * @author lixin\n */\npublic class CompilerTestDriver {\n    public static void main(String[] args) {\n        Compiler compiler = new Compiler();\n        // 文件方法\n        File fileIn = new File(\"/Users/lixin/Downloads/in.txt\");\n        File fileOut = new File(\"/Users/lixin/Downloads/out.txt\");\n        compiler.compile(fileIn, fileOut);\n        // String 参数方法\n        String in = \"{\" +\n                \"\\tint i; int j; float v; float x; float[100] a;\\r\\n\" +\n                \"\\twhile( true ) {\\r\\n\" +\n                \"\\t\\tdo i = i+1; while( a[i] < v);\\r\\n\" +\n                \"\\t\\tdo j = j-1; while( a[j] > v);\\r\\n\" +\n                \"\\t\\tif( i >= j ) break;\\r\\n\" +\n                \"\\t\\tx = a[i]; a[i] = a[j]; a[j] = x;\\r\\n\" +\n                \"\\t}\\r\\n\" +\n                \"}\\r\\n\" +\n                \"{}\";\n        String out = compiler.compile(in);\n        System.out.print(out);\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/main/Main.java",
    "content": "package com.lixin.main;\n\nimport com.lixin.lexer.Lexer;\nimport com.lixin.parser.Parser;\n\nimport java.io.IOException;\n\n/**\n * @author lixin\n */\npublic class Main {\n    public static void main(String[] args) throws IOException {\n        System.out.print(\"lxc>\");\n        Lexer lexer = new Lexer();\n        Parser parser = new Parser(lexer);\n        parser.program();\n        System.out.println();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/parser/Parser.java",
    "content": "package com.lixin.parser;\n\nimport com.lixin.interpreter.*;\nimport com.lixin.lexer.*;\nimport com.lixin.symbols.Array;\nimport com.lixin.symbols.Environment;\nimport com.lixin.symbols.Type;\n\nimport java.io.IOException;\n\n/**\n * @author lixin\n */\npublic class Parser {\n    private Lexer lexer;\n    private Token look;\n    private Environment top = null;\n    private int used = 0;\n\n    public Parser(Lexer lexer) throws IOException {\n        this.lexer = lexer;\n        move();\n    }\n\n    private void move() throws IOException {\n        look = lexer.scan();\n    }\n\n    private void error(String message) {\n        throw new Error(\"near line \" + Lexer.line + \": \" + message);\n    }\n\n    private void match(int tag) throws IOException {\n        if (look.tag == tag) {\n            move();\n        } else {\n            error(\"syntax error\");\n        }\n    }\n\n    public void program() throws IOException {\n        Statement statement = block();\n        int begin = statement.newLabel();\n        int after = statement.newLabel();\n        statement.emitLabel(begin);\n        statement.generate(begin, after);\n        statement.emitLabel(after);\n    }\n\n    private Statement block() throws IOException {\n        match('{');\n        Environment savedEnvironment = top;\n        top = new Environment(top);\n        deClause();\n        Statement statement = statements();\n        match('}');\n        top = savedEnvironment;\n        return statement;\n    }\n\n    private void deClause() throws IOException {\n        while (look.tag == Tag.BASIC) {\n            Type type = type();\n            Token token = look;\n            match(Tag.IDENTIFIER);\n            match(';');\n            Identifier identifier = new Identifier((Word) token, type, used);\n            top.put(token, identifier);\n            used += type.width;\n        }\n    }\n\n    private Type type() throws IOException {\n        Type type = (Type) look;\n        match(Tag.BASIC);\n        if (look.tag != '[') {\n            return type;\n        } else {\n            return deBracket(type);\n        }\n    }\n\n    /**\n     * Original Name: dims\n     */\n    private Type deBracket(Type type) throws IOException {\n        match('[');\n        Token token = look;\n        match(Tag.NUM);\n        match(']');\n        if (look.tag == '[') {\n            type = deBracket(type);\n        }\n        return new Array(((Numeric) token).value, type);\n    }\n\n    private Statement statements() throws IOException {\n        if (look.tag == '}') {\n            return Statement.NULL;\n        } else {\n            return new Sequence(statement(), statements());\n        }\n    }\n\n    private Statement statement() throws IOException {\n        Expression expression;\n        // Statement statement;\n        Statement statement1, statement2;\n        Statement savedStatement;\n        switch (look.tag) {\n            case ';':\n                move();\n                return Statement.NULL;\n            case Tag.IF:\n                match(Tag.IF);\n                match('(');\n                expression = bool();\n                match(')');\n                statement1 = statement();\n                if (look.tag != Tag.FALSE) {\n                    return new If(expression, statement1);\n                }\n                match(Tag.FALSE);\n                statement2 = statement();\n                return new Else(expression, statement1, statement2);\n            case Tag.WHILE:\n                While whileNode = new While();\n                savedStatement = Statement.ENCLOSING;\n                Statement.ENCLOSING = whileNode;\n                match(Tag.WHILE);\n                match('(');\n                expression = bool();\n                match(')');\n                statement1 = statement();\n                whileNode.init(expression, statement1);\n                Statement.ENCLOSING = savedStatement;\n                return whileNode;\n            case Tag.DO:\n                Do doNode = new Do();\n                savedStatement = Statement.ENCLOSING;\n                Statement.ENCLOSING = doNode;\n                match(Tag.DO);\n                statement1 = statement();\n                match(Tag.WHILE);\n                match('(');\n                expression = bool();\n                match(')');\n                match(';');\n                doNode.init(statement1, expression);\n                Statement.ENCLOSING = savedStatement;\n                return doNode;\n            case Tag.BREAK:\n                match(Tag.BREAK);\n                match(';');\n                return new Break();\n            case '{':\n                return block();\n            default:\n                return assign();\n        }\n    }\n\n    private Statement assign() throws IOException {\n        Statement statement;\n        Token token = look;\n        match(Tag.IDENTIFIER);\n        Identifier identifier = top.get(token);\n        if (identifier == null) {\n            error(token.toString() + \" undeclared\");\n        }\n        if (look.tag == '=') {\n            move();\n            statement = new Set(identifier, bool());\n        } else {\n            Access access = offset(identifier);\n            match('=');\n            statement = new SetElem(access, bool());\n        }\n        match(';');\n        return statement;\n    }\n\n    private Expression bool() throws IOException {\n        Expression expression = join();\n        while (look.tag == Tag.OR) {\n            Token token = look;\n            move();\n            expression = new Or(token, expression, join());\n        }\n        return expression;\n    }\n\n    private Expression join() throws IOException {\n        Expression expression = equality();\n        while (look.tag == Tag.AND) {\n            Token token = look;\n            move();\n            expression = new And(token, expression, equality());\n        }\n        return expression;\n    }\n\n    private Expression equality() throws IOException {\n        Expression expression = relation();\n        while (look.tag == Tag.EQUAL || look.tag == Tag.NOT_EQUAL) {\n            Token token = look;\n            move();\n            return new Relation(token, expression, relation());\n        }\n        return expression;\n    }\n\n    private Expression relation() throws IOException {\n        Expression expression = expression();\n        switch (look.tag) {\n            case '<':\n            case Tag.LESS_EQUAL:\n            case Tag.GREATER_EQUAL:\n            case '>':\n                Token token = look;\n                move();\n                return new Relation(token, expression, expression());\n            default:\n                return expression;\n        }\n    }\n\n    private Expression expression() throws IOException {\n        Expression expression = term();\n        while (look.tag == '+' || look.tag == '-') {\n            Token token = look;\n            move();\n            return new Arithmetic(token, expression, term());\n        }\n        return expression;\n    }\n\n    private Expression term() throws IOException {\n        Expression expression = unary();\n        while (look.tag == '*' || look.tag == '/') {\n            Token token = look;\n            move();\n            return new Arithmetic(token, expression, unary());\n        }\n        return expression;\n    }\n\n    private Expression unary() throws IOException {\n        if (look.tag == '-') {\n            move();\n            return new Unary(Word.MINUS, unary());\n        } else if (look.tag == '!') {\n            Token token = look;\n            move();\n            return new Not(token, unary());\n        } else {\n            return factor();\n        }\n    }\n\n    private Expression factor() throws IOException {\n        Expression expression = null;\n        switch (look.tag) {\n            case '(':\n                move();\n                expression = bool();\n                match(')');\n                return expression;\n            case Tag.NUM:\n                expression = new Constant(look, Type.INT);\n                move();\n                return expression;\n            case Tag.REAL:\n                expression = new Constant(look, Type.FLOAT);\n                move();\n                return expression;\n            case Tag.TRUE:\n                expression = Constant.TRUE;\n                move();\n                return expression;\n            case Tag.FALSE:\n                expression = Constant.FALSE;\n                move();\n                return expression;\n            case Tag.IDENTIFIER:\n                // String stringLook = look.toString(); 没用\n                Identifier identifier = top.get(look);\n                if (identifier == null) {\n                    error(look.toString() + \" undeclared\");\n                }\n                move();\n                if (look.tag != '[') {\n                    return identifier;\n                } else {\n                    return offset(identifier);\n                }\n            default:\n                error(\"syntax error\");\n                return expression;\n        }\n    }\n\n    private Access offset(Identifier array) throws IOException {\n        Expression index;\n        Expression width;\n        Expression token1, token2;\n        Expression location;\n        Type type = array.type;\n        match('[');\n        index = bool();\n        match(']');\n        type = ((Array) type).of;\n        width = new Constant(type.width);\n        token1 = new Arithmetic(new Token('*'), index, width);\n        location = token1;\n        while (look.tag == '[') {\n            match('[');\n            index = bool();\n            match(']');\n            type = ((Array) type).of;\n            width = new Constant(type.width);\n            token1 = new Arithmetic(new Token('*'), index, width);\n            token2 = new Arithmetic(new Token('+'), location, token1);\n            location = token2;\n        }\n        return new Access(array, location, type);\n    }\n}"
  },
  {
    "path": "src/com/lixin/symbols/Array.java",
    "content": "package com.lixin.symbols;\n\nimport com.lixin.lexer.Tag;\n\n/**\n * @author lixin\n */\npublic class Array extends Type {\n    public Type of;\n    private int size;\n\n    public Array(int size, Type type) {\n        super(\"[]\", Tag.INDEX, size * type.width);\n        this.size = size;\n        of = type;\n    }\n\n    @Override\n    public String toString() {\n        return \"[\" + size + \"]\" + of.toString();\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/symbols/Environment.java",
    "content": "package com.lixin.symbols;\n\nimport com.lixin.interpreter.Identifier;\nimport com.lixin.lexer.Token;\n\nimport java.util.Hashtable;\n\n/**\n * @author lixin\n */\npublic class Environment {\n    private Hashtable<Token, Identifier> table;\n    private Environment previousEnvironment;\n\n    public Environment(Environment environment) {\n        table = new Hashtable<>();\n        previousEnvironment = environment;\n    }\n\n    public void put(Token word, Identifier identifier) {\n        table.put(word, identifier);\n    }\n\n    public Identifier get(Token word) {\n        for (Environment environment = this; environment != null; environment = environment.previousEnvironment) {\n            Identifier found = (environment.table.get(word));\n            if (found != null) {\n                return found;\n            }\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "src/com/lixin/symbols/Type.java",
    "content": "package com.lixin.symbols;\n\nimport com.lixin.lexer.Tag;\nimport com.lixin.lexer.Word;\n\nimport java.util.Arrays;\n\n/**\n * @author lixin\n */\npublic class Type extends Word {\n    public int width;\n\n    public Type(String lexeme, int tag, int width) {\n        super(lexeme, tag);\n        this.width = width;\n    }\n\n    public static final Type\n            INT = new Type(\"int\", Tag.BASIC, 4),\n            FLOAT = new Type(\"float\", Tag.BASIC, 8),\n            CHAR = new Type(\"char\", Tag.BASIC, 1),\n            BOOL = new Type(\"bool\", Tag.BASIC, 1);\n\n    public static boolean numeric(Type type) {\n        return Arrays.asList(new Type[]{FLOAT, INT, FLOAT}).contains(type);\n    }\n\n    public static Type max(Type type1, Type type2) {\n        /*The explanation of the working codes.\n\n        if (!numeric(type1) || !numeric(type2)) {\n            return null;\n        } else if (type1 == Type.FLOAT || type2 == FLOAT) {\n            return Type.FLOAT;\n        } else if (type1 == Type.INT || type2 == Type.INT) {\n            return Type.INT;\n        } else {\n            return Type.CHAR;\n        }*/\n        return numeric(type1) && numeric(type2) ? type1 == FLOAT || type2 == FLOAT ? FLOAT : type1 == INT || type2 == INT ? INT : CHAR : null;\n    }\n}\n"
  }
]