添加项目文件。

This commit is contained in:
LiuYuanchi 2024-05-05 19:09:26 +08:00
parent 59313a5fda
commit 7a4a6ed0e8
67 changed files with 4890 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/encodings.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/main.cpp" charset="GBK" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/compile-grammar.iml" filepath="$PROJECT_DIR$/.idea/compile-grammar.iml" />
</modules>
</component>
</project>

48
.idea/workspace.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="7a8ab45a-331b-4244-8615-810eb13f5ee4" name="更改" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
</component>
<component name="ProjectId" id="2QHUZOezr9I70KxBtqPWtYQiZRt" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.cidr.known.project.marker": "true",
"WebServerToolWindowFactoryState": "false",
"cf.first.check.clang-format": "false",
"cidr.known.project.marker": "true",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="7a8ab45a-331b-4244-8615-810eb13f5ee4" name="更改" comment="" />
<created>1685010054732</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1685010054732</updated>
<workItem from="1685010055875" duration="63000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

351
LL1.cpp Normal file
View File

@ -0,0 +1,351 @@
#include <set>
#include <algorithm>
#include <stack>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include "LL1.h"
LL1::LL1()
{
read_grammar();
init_grammar_set();
}
LL1::~LL1()
{
}
bool LL1::IsLL1()
{
string symbol;
vector<string> right_first = vector<string>();
vector<string> left_follow;
for (int i = 0; i < grammar_rules.size(); i++) {
symbol.clear();
right_first.clear();
left_follow.clear();
symbol = grammar_rules[i].first;
// 计算 产生式左侧 FOLLOW 集
left_follow = follow[symbol];
// 计算 产生式右侧 FIRST 集
// 对 X1 的 非 $ 符号 加入
for (int j = 0; j < first[grammar_rules[i].second[0]].size(); j++) {
if (first[grammar_rules[i].second[0]][j] == "$") {
continue;
}
right_first.push_back(first[grammar_rules[i].second[0]][j]);
}
int cnt;
for (cnt = 1; cnt < grammar_rules[i].second.size(); cnt++) {
// 当且仅当 有 $ 符号时 继续加入
if (!infer_empty[grammar_rules[i].second[cnt - 1]]) {
break;
}
for (int j = 0; j < first[grammar_rules[i].second[cnt]].size(); j++) {
if (first[grammar_rules[i].second[cnt]][j] == "$") {
continue;
}
right_first.push_back(first[grammar_rules[i].second[cnt]][j]);
}
}
// 若都能推导至 $ 符号时 加入
if (cnt == grammar_rules[i].second.size() && infer_empty[grammar_rules[i].second[0]]) {
right_first.push_back("$");
}
// 对产生式右侧 FIRST 集 进行 去重
set<string> sright_first(right_first.begin(), right_first.end());
right_first.clear();
right_first.resize(sright_first.size());
right_first.assign(sright_first.begin(), sright_first.end());
vector<string> symbol_select;
// 若产生式右侧 FIRST 集为 {$} 时
if (right_first.size() == 1 && right_first[0] == "$") {
// SELECT 集为 产生式右侧 FOLLOW 集 与 {$} 的交集
symbol_select = left_follow;
if (find(left_follow.begin(), left_follow.end(), "$") == left_follow.end()) {
symbol_select.push_back("$");
}
}
else
{
// SELECT 集为 产生式左侧 FIRST 集
symbol_select = right_first;
}
// 对 SELECT 集 进行排序 方便接下来进行集合运算
sort(symbol_select.begin(), symbol_select.end());
vector<string> new_select = vector<string>();
// 判断 SELECT 表中有无现有数据
if (select.find(symbol) == select.end()) {
select[symbol] = symbol_select;
}
else {
// 判断两个相同产生式左侧 SELECT 集 是否相交
set_intersection(symbol_select.begin(), symbol_select.end(), select[symbol].begin(), select[symbol].end(), back_inserter(new_select));
if (new_select.size() == 0) {
// 不相交,继续运算,存入两者并集
set_union(symbol_select.begin(), symbol_select.end(), select[symbol].begin(), select[symbol].end(), back_inserter(new_select));
}
else
{
// 非 LL(1) 文法,退出
cout << "该文法不为 LL(1) 文法!" << endl;
return false;
}
}
}
// cout << "该文法为 LL(1) 文法!" << endl;
return true;
}
void LL1::build_LL1_predict()
{
// 对每一个 非终结符 进行初始化行
for (int i = 0; i < VNs.size(); i++) {
if (LL1_predict.find(VNs[i]) == LL1_predict.end()) {
LL1_predict[VNs[i]] = unordered_map<string, int>();
}
}
string symbol;
vector<string> right_first = vector<string>();
vector<string> left_follow;
// 遍历 产生式 构建 预测分析表
for (int i = 0; i < grammar_rules.size(); i++) {
symbol.clear();
right_first.clear();
left_follow.clear();
symbol = grammar_rules[i].first;
// 计算 产生式左侧 FOLLOW 集
left_follow = follow[symbol];
unordered_map<string, int> &symbol_predict = LL1_predict[symbol];
// 计算 产生式右侧 FIRST 集
// 对 X1 的 非 $ 符号 加入
for (int j = 0; j < first[grammar_rules[i].second[0]].size(); j++) {
if (first[grammar_rules[i].second[0]][j] == "$") {
continue;
}
right_first.push_back(first[grammar_rules[i].second[0]][j]);
}
int cnt;
for (cnt = 1; cnt < grammar_rules[i].second.size(); cnt++) {
// 当且仅当 有 $ 符号时 继续加入
if (!infer_empty[grammar_rules[i].second[cnt - 1]]) {
break;
}
for (int j = 0; j < first[grammar_rules[i].second[cnt]].size(); j++) {
if (first[grammar_rules[i].second[cnt]][j] == "$") {
continue;
}
right_first.push_back(first[grammar_rules[i].second[cnt]][j]);
}
}
// 若都能推导至 $ 符号时 加入
if (cnt == grammar_rules[i].second.size() && infer_empty[grammar_rules[i].second[0]]) {
right_first.push_back("$");
}
// 对产生式右侧 FIRST 集 进行 去重
set<string> sright_first(right_first.begin(), right_first.end());
right_first.clear();
right_first.resize(sright_first.size());
right_first.assign(sright_first.begin(), sright_first.end());
// 循环遍历 FIRST 集进行初始化
for (int j = 0; j < right_first.size(); j++) {
if (right_first[j] == "$") {
pair<string, vector<string>> new_rule (grammar_rules[i].first, vector<string>());
new_rule.second.push_back("$");
int rule_id = insert_rule(new_rule);
for (int k = 0; k < left_follow.size(); k++) {
symbol_predict[left_follow[k]] = rule_id;
}
}
symbol_predict[right_first[j]] = i;
}
}
}
void LL1::print_LL1_predict()
{
cout << "[LL1_predict]:" << endl;
for (auto iter = LL1_predict.begin(); iter != LL1_predict.end(); ++iter) {
cout << (*iter).first << " ";
for (auto j = (*iter).second.begin(); j != (*iter).second.end(); ++j) {
cout << (*j).first << "," << (*j).second << " ";
}
cout << endl;
}
cout << endl << endl;
}
void LL1::build_LL1_grammar()
{
// 符号栈
stack<string> stack;
int token_cnt = 0;
// 起始符 入栈
stack.push(start);
while (!stack.empty())
{
LL1_grammar_log.push_back(string());
// 栈顶符号
// 判断栈顶是否为 空符号
if (stack.top() == "$") {
// 栈空 以 EOF 表示
LL1_grammar_log.back() += "EOF";
}
else
{
LL1_grammar_log.back() += stack.top();
}
// 添加 # 分割
LL1_grammar_log.back() += "#";
// 面临输入的符号
string this_token;
if (token_cnt == token_strings.size()) {
// 栈空 以 EOF 表示
this_token = "$";
LL1_grammar_log.back() += "EOF";
}
else
{
this_token = token_strings[token_cnt];
LL1_grammar_log.back() += token_strings[token_cnt];
}
// 对栈顶元素与即将输入的符号进行比较
if (stack.top() == this_token) {
// 栈顶出栈 token 指向下一位
token_cnt++;
stack.pop();
if (this_token == "$") {
// 分析成功 结束分析
LL1_grammar_log.back() += "\taccept";
}
else
{
// 跳过
LL1_grammar_log.back() += "\tmove";
}
}
// 若为终结符
else if (find(VTs.begin(), VTs.end(), stack.top()) != VTs.end()) {
if (stack.top() == "$") {
stack.pop();
LL1_grammar_log.pop_back();
}
else {
LL1_grammar_log.back() += "\terror";
return;
}
}
else
{
auto tab = LL1_predict[stack.top()];
if (tab.find(this_token) == tab.end()) {
LL1_grammar_log.back() += "\terror";
return;
}
else
{
auto this_rule = grammar_rules[tab[this_token]];
stack.pop();
for (int i = this_rule.second.size() - 1; i >= 0; i--) {
stack.push(this_rule.second[i]);
}
LL1_grammar_log.back() += "\treduction";
}
}
}
}
void LL1::print_LL1_grammar_log()
{
for (int i = 0; i < LL1_grammar_log.size(); ++i) {
cout << LL1_grammar_log[i] << endl;
}
}
void LL1::fileout_LL1_grammar_log(string file_name)
{
//打开结果输出文件
ofstream outfile(file_name);
if (!outfile.is_open()) {
cout << "打开文件失败" << endl;
}
for (int i = 0; i < LL1_grammar_log.size(); ++i) {
outfile << LL1_grammar_log[i] << endl;
}
outfile.close();
}
int LL1::insert_rule(pair<string, vector<string>>& new_rule)
{
int cnt;
for (cnt = 0; cnt < grammar_rules.size(); cnt++) {
// 当 产生式规则 中存在这条产生式时 返回序号
if (grammar_rules[cnt].first == new_rule.first && grammar_rules[cnt].second == new_rule.second) {
return cnt;
}
}
// 若不存在 返回序号的同时加入
grammar_rules.push_back(new_rule);
return cnt;
}

32
LL1.h Normal file
View File

@ -0,0 +1,32 @@
// LL1 语法分析器
#ifndef LL1_H
#define LL1_H
#include "grammar.h"
using namespace std;
class LL1:public Grammar{
public:
LL1();
~LL1();
bool IsLL1(); // 判断该文法是否为 LL1 文法
void build_LL1_predict(); // 构建 LL1 的预测分析表
void print_LL1_predict(); // 打印 LL1 的预测分析表
void build_LL1_grammar(); // 构建规约序列
void print_LL1_grammar_log();
void fileout_LL1_grammar_log(string file_name);
private:
unordered_map<string, vector<string>> select; // 计算符号的 SELECT 集合
unordered_map<string, unordered_map<string, int>> LL1_predict; // LL1 的预测分析表
vector<string> LL1_grammar_log; // 规约序列
int insert_rule(pair<string, vector<string>>& new_rule); // 增加新的规则
};
#endif // !LL1_H

BIN
RCa19240 Normal file

Binary file not shown.

23
compare.py Normal file
View File

@ -0,0 +1,23 @@
import os
from filediff.diff import file_diff_compare
test_dirs = []
for root,dirs,files in os.walk("./tests"):
for dir in dirs:
# 获取文件所属目录
test_dirs.append(dir)
for dir in test_dirs:
path_dir = "./tests/"+dir+"/"
name = dir[:2]
true_grammar_name = path_dir+name+"_grammar.txt"
my_grammar_name = path_dir + name + "_my_grammar.txt"
file_diff_compare(true_grammar_name, my_grammar_name, diff_out=path_dir+'grammar_diff.html')
true_lexical_name = path_dir + name + "_lexical.txt"
my_lexical_name = path_dir + name + "_my_lexical.txt"
file_diff_compare(true_lexical_name, my_lexical_name, diff_out=path_dir + 'lexical_diff.html')
# if len(dir) == 2:
# true_var_defn2_name = path_dir + name + "_var_defn2.txt"
# my_var_defn2_name = path_dir + name + "_my_var_defn2.txt"
# file_diff_compare(true_var_defn2_name, my_var_defn2_name, diff_out=path_dir + 'var_defn2_diff.html')

31
compile-grammar.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compile-grammar", "compile-grammar.vcxproj", "{15F31207-1716-408B-8C54-24C5A38FAD6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Debug|x64.ActiveCfg = Debug|x64
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Debug|x64.Build.0 = Debug|x64
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Debug|x86.ActiveCfg = Debug|Win32
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Debug|x86.Build.0 = Debug|Win32
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Release|x64.ActiveCfg = Release|x64
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Release|x64.Build.0 = Release|x64
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Release|x86.ActiveCfg = Release|Win32
{15F31207-1716-408B-8C54-24C5A38FAD6F}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {929679B6-83A7-41FD-B7FE-06BDE17A5E5C}
EndGlobalSection
EndGlobal

149
compile-grammar.vcxproj Normal file
View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{15f31207-1716-408b-8c54-24c5a38fad6f}</ProjectGuid>
<RootNamespace>compilegrammar</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dfa.cpp" />
<ClCompile Include="grammar.cpp" />
<ClCompile Include="LL1.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="nfa.cpp" />
<ClCompile Include="tool.cpp" />
</ItemGroup>
<ItemGroup>
<Text Include="grammar.txt" />
<Text Include="nfa.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="grammar.h" />
<ClInclude Include="LL1.h" />
<ClInclude Include="nfa.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="grammar.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="LL1.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="dfa.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="nfa.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="tool.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="grammar.txt" />
<Text Include="nfa.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="grammar.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="LL1.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="nfa.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>

251
dfa.cpp Normal file
View File

@ -0,0 +1,251 @@
#include "nfa.h"
class Partition {
public:
set<State*, StatePtrCompare> states;
Partition(set<State*, StatePtrCompare> states) : states(states) {}
};
/*
N和A两个集合
S = {N,A}S中的状态集进行划分S仍然在扩大S不再扩大
c can split s这里s指的是S中的一个状态集
1.s中每个状态c之后到达的状态
2.S中现在有的状态集
3.s分割
s中分割出去s最后保留下来的是吃了字符c还在状态集s中的状态或者吃不了c字符的状态
*/
// split 函数用于将给定的状态集合group根据转移函数进一步细分。
// group: 要细分的状态集合
// input: 当前考虑的输入字符类型
// partitions: 存储所有分区的集合,如果需要细分,将在该集合中添加新分区
void split(const set<State*, StatePtrCompare>& group, InputCharType input, set<Partition*>& partitions) {
// 用于存储每个目标分区与对应新分组状态集合的映射
map<Partition*, set<State*, StatePtrCompare>> targetPartitionsMap;
for (State* state : group) {
auto it = state->transitions.find(input);
if (it != state->transitions.end()) {
State* targetState = *(it->second.begin());//DFA状态转移具有唯一性
// 在当前所有分区中查找包含目标状态的分区
for (Partition* partition : partitions) {
if (partition->states.find(targetState) != partition->states.end()) {
// 在映射表中将当前状态添加到对应的目标分区
targetPartitionsMap[partition].insert(state);
break;
}
}
}
}
// 经过上述操作将在group里的状态根据到达目标Partiset<State*, StatePtrCompare>分到不同set<State*>
// 遍历目标分区映射表检查是否需要进一步细分即将经过input输入状态转换后处于不同目标分区的集合内部拆分开
for (auto& entry : targetPartitionsMap) {
Partition* targetPartition = entry.first;
//到达该targetPartition的group部分状态合集如下
set<State*, StatePtrCompare>& newGroupStates = entry.second;
//等于的情况不拆分不会出现大于的情况将targetPartition拆分开来也可以将到达不同割集的源状态分割开来也可以分割目标状态总之是状态转移结果在现存割集即可
if (newGroupStates.size() < targetPartition->states.size()) {
for (State* state : newGroupStates) {
targetPartition->states.erase(state);
}
Partition* newGroup = new Partition(newGroupStates);
partitions.insert(newGroup);
}
}
}
DFA minimizeDFA(const DFA& dfa) {
set<Partition*> partitions;
// 将所有非终止状态分成一组,将所有终止状态按照 WordType 分组
/*
* WordType
* ,
*/
map<WordType, set<State*, StatePtrCompare>> endStateGroups; //初始终态集合
set<State*, StatePtrCompare> nonEndStates; //初始非终态集合
for (State* state : dfa.states) {
if (state->isFinalState) {
endStateGroups[state->wordType].insert(state);//使用wordType对终态集合进一步拆分
}
else {
nonEndStates.insert(state);
}
}
//构造初始分割,是对{N,A}中A的扩展即终态加快算法速度扩展原因见上
for (auto& entry : endStateGroups) {
Partition* endStateGroup = new Partition(entry.second);
partitions.insert(endStateGroup);
}
Partition* nonEndStateGroup = new Partition(nonEndStates);
partitions.insert(nonEndStateGroup);
//对现有分隔进行再分隔,以获得最小化分割
size_t oldSize;//分割集初始大小
do {
oldSize = partitions.size();
for (InputCharType input = static_cast<InputCharType>(0); input < EPSILON; input = static_cast<InputCharType>(input + 1)) {//类似于求Ia,Ib等
for (Partition* partition : set<Partition*>(partitions)) {//遍历现存分割的每一个割集,看是否可再分割
if (partition->states.size() > 1) {//为1的集合不可再分割
split(partition->states, input, partitions);//核心分割函数
}
}
}
} while (partitions.size() != oldSize);//当割集集合大小不再变化时停止
// 创建新的最小化 DFA即重新映射dfa重新编号状态
// 构造DFA参数为DFA(State* set<State*, StatePtrCompare> set<State*>set<State*, StatePtrCompare> set<State*> states)
set<State*, StatePtrCompare> minimizedStates;
set<State*, StatePtrCompare> minimizedEndStates;
State* minimizedStartState = nullptr;
map<State*, State*> stateMap;
for (Partition* partition : partitions) {//遍历获得的每个割集
State* newState = new State(minimizedStates.size());//编号
// 检查当前划分是否包含旧DFA的开始状态如果是则将新状态设置为最小化DFA的开始状态
if (partition->states.find(dfa.startState) != partition->states.end()) {
minimizedStartState = newState;
}
// 如果划分的状态集合不为空,选择一个代表状态
if (!partition->states.empty()) {
State* representative = *(partition->states.begin());//因为在前面终止状态都分到了不同割集且大小为1所以如果是终止状态begin已经可以代表了
//在分割状态集合的过程中,已经确保了一个划分中所有状态具有相同的属性,要么所有状态都是终止状态,要么都不是终止状态。所以我们只需要检查一个状态来确定新状态是否应该是终止状态。
// 如果代表状态是终止状态,则设置新状态为终止状态,并保留相应的单词类型
if (representative->isFinalState) {
newState->setFinalState(true, representative->wordType);
minimizedEndStates.insert(newState);
}
}
// 将集合里面所有旧状态映射到同一个新状态
for (State* state : partition->states)
{
stateMap[state] = newState;
}
// 将新状态插入到最小化DFA的状态集合中
minimizedStates.insert(newState);
}
// 遍历旧DFA中的所有状态
for (State* oldState : dfa.states) {
// 通过映射找到与旧状态对应的新状态
State* newState = stateMap[oldState];
for (const auto& transition : oldState->transitions) {
InputCharType input = transition.first;
State* oldTargetState = *(transition.second.begin());//dfa每个状态只有一个转移状态沿用了nfa的结构所以集合大小<=1
State* newTargetState = stateMap[oldTargetState];// 获取旧状态的目标状态
newState->addTransition(input, newTargetState);// 通过映射找到新的目标状态
}
}
// 清理并删除原始分区
for (Partition* partition : partitions) {
delete partition;
}
return DFA(minimizedStartState, minimizedEndStates, minimizedStates);
}
void removeUnreachableStates(DFA& dfa) {
set<State*> reachableStates; //可达状态集合
queue<State*> statesQueue; //状态队列
//将初始状态加入可达状态集合和队列
reachableStates.insert(dfa.startState);
statesQueue.push(dfa.startState);
// BFS 遍历 DFA找出所有可达状态
while (!statesQueue.empty()) {
State* currentState = statesQueue.front();
statesQueue.pop();
for (const auto& transition : currentState->transitions) {
State* targetState = *(transition.second.begin());//dfa每个状态只有一个转移状态沿用了nfa的结构所以集合大小<=1
if (reachableStates.find(targetState) == reachableStates.end()) {//若未访问
reachableStates.insert(targetState);
statesQueue.push(targetState);
}
}
}
// 删除所有不可达状态
for (auto it = dfa.states.begin(); it != dfa.states.end();) {
State* state = *it;
if (reachableStates.find(state) == reachableStates.end()) {//若当前状态不可达,删除
it = dfa.states.erase(it);
delete state;
}
else {
++it;
}
}
}
vector<string> recognize(const DFA& dfa, const string& input, const string& output) {
State* currentState = dfa.startState;
State* nextState = nullptr;
string buffer;
vector<string> tokens; // 用于收集识别到的Token
//打开结果输出文件
ofstream file(output);
if (!file.is_open()) {
std::cout << "Error opening file!" << std::endl;
return tokens;
}
for (size_t i = 0; i < input.length(); ++i) {
char c = input[i];
if (c == ' '||c=='\n'||c=='\r\n'||c==' ')// 如果是空格、换行等分隔符,则跳过
{continue; }
InputCharType inputCharType = getInputCharType(c);
auto it = currentState->transitions.find(inputCharType);
if (it != currentState->transitions.end()) {
nextState = *(it->second.begin());
buffer.push_back(c);
if (nextState->isFinalState && i + 1 < input.length()) {// 如果下一个状态是终止状态并且还有剩余字符
char nextChar = input[i + 1];
InputCharType nextInputCharType = getInputCharType(nextChar);
auto nextIt = nextState->transitions.find(nextInputCharType);// 查找下一个状态的转换表中是否有对应的输入字符类型
if (nextIt == nextState->transitions.end()) {// 如果没有更多匹配的转换
// 输出识别到的单词符号和对应的类型
cout << buffer << "\t<" << getWordTypeName(nextState->wordType,buffer) << ">" << endl;
file << buffer << "\t<" << getWordTypeName(nextState->wordType, buffer) << ">" << endl;
tokens.push_back(getGrammarName(nextState->wordType, buffer));
buffer.clear();
currentState = dfa.startState;
}
else {
currentState = nextState;// 更新当前状态为下一个状态
}
}
else {
currentState = nextState;// 更新当前状态为下一个状态
}
}
else {// 如果没有找到匹配的转换
if (currentState->isFinalState) {// 如果当前状态是终止状态
// 输出识别到的单词符号和对应的类型
cout << buffer << "\t<" << getWordTypeName(currentState->wordType,buffer) << ">" << endl;
file << buffer << "\t<" << getWordTypeName(currentState->wordType, buffer) << ">" << endl;
tokens.push_back(getGrammarName(currentState->wordType, buffer) );
buffer.clear();
}
else {
// 如果当前状态不是终止状态
// 输出无法识别的字符信息
cout << "无法识别的字符: " << c << endl;
file << "无法识别的字符: " << c << endl;
buffer.clear();
}
currentState = dfa.startState;// 回到起始状态
//--i;// 重新处理当前字符,还是跳过吧,这里可以添加错误处理
}
}
// 处理最后一个字符,如果缓冲区不为空且当前状态是终止状态,对应第一个if里面的else
if (!buffer.empty() && currentState->isFinalState) {
cout << buffer << "\t<" << getWordTypeName(currentState->wordType,buffer) << ">" << endl;
file << buffer << "\t<" << getWordTypeName(currentState->wordType, buffer) << ">" << endl;
tokens.push_back(getGrammarName(currentState->wordType, buffer));
}
file.close();//关闭文件
return tokens;
}

520
grammar.cpp Normal file
View File

@ -0,0 +1,520 @@
#include <deque>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <set>
#include "grammar.h"
Grammar::Grammar()
{
}
Grammar::~Grammar()
{
}
void Grammar::read_grammar() {
ifstream infile;
infile.open(grammar_file, ios::in);
if (!infile.is_open())
{
cout << "读取文件失败" << endl;
return;
}
string buf;
string arrow = "->";
string farrow;
bool start_flag = true;
string left;
string forms;
while (!infile.eof()) {
// 清理 string
buf.clear();
left.clear();
forms.clear();
farrow.clear();
grammar_rules.push_back(pair<string, vector<string>>());
getline(infile, buf);
stringstream ss(buf);
// 读取产生式左侧
ss >> left;
grammar_rules.back().first = left;
symbols.push_back(left);
VNs.push_back(left);
// 存储 start
if (start_flag) {
start = left;
start_flag = false;
}
// 读取 -> 符号 并保证合法
ss >> farrow;
if (farrow != arrow) {
cout << "语法读取出错" << endl;
}
// 读取产生式右侧
while (ss >> forms)
{
grammar_rules.back().second.push_back(forms);
symbols.push_back(forms);
forms.clear();
}
}
// 符号集 和 非终结符 去重
set<string> ssymbols(symbols.begin(), symbols.end());
symbols.clear();
symbols.resize(ssymbols.size());
symbols.assign(ssymbols.begin(), ssymbols.end());
set<string> sVNs(VNs.begin(), VNs.end());
VNs.clear();
VNs.resize(sVNs.size());
VNs.assign(sVNs.begin(), sVNs.end());
// 符号集 和 非终结符 排序 以保证差集的成功
sort(symbols.begin(), symbols.end());
sort(VNs.begin(), VNs.end());
// 取差集 得到终极符
set_difference(symbols.begin(), symbols.end(), VNs.begin(), VNs.end(), back_inserter(VTs));
infile.close();
}
void Grammar::print_grammar()
{
cout << "[start]: " << endl << start << endl << endl;
cout << "[VTs]:" << endl;
for (int i = 0; i < VTs.size(); i++) {
cout << VTs[i] << " ";
if (((i + 1) % 5) == 0)
cout << endl;
}
cout << endl << endl;
cout << "[VNs]:" << endl;
for (int i = 0; i < VNs.size(); i++) {
cout << VNs[i] << " ";
if (((i + 1) % 5) == 0)
cout << endl;
}
cout << endl << endl;
cout << "[symbols]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << symbols[i] << " ";
if (((i + 1) % 5) == 0)
cout << endl;
}
cout << endl << endl;
cout << "[grammar_rules]: " << grammar_rules.size() << endl;
for (int i = 0; i < grammar_rules.size(); ++i) {
cout << grammar_rules[i].first << " -> ";
for (int j = 0; j < grammar_rules[i].second.size(); ++j) {
cout << "\"" << grammar_rules[i].second[j] << "\" ";
}
cout << endl;
}
cout << endl << endl;
}
void Grammar::expand_grammar()
{
string new_start = start + "\'";
pair<string, vector<string>> new_rule = pair<string, vector<string>>(new_start, vector<string>());
new_rule.second.push_back(start);
VNs.push_back(new_start);
symbols.push_back(new_start);
grammar_rules.insert(grammar_rules.begin(), new_rule);
start = new_start;
// 符号集排序
sort(symbols.begin(), symbols.end());
}
void Grammar::init_grammar_set()
{
string symbol;
// 对符号集中各符号进行推导 是否可以到达 $ 空符号
for (int i = 0; i < symbols.size(); i++) {
symbol = symbols[i];
this->symbol_infer_empty(symbol);
symbol.clear();
}
// 初始化符号在产生式的 出现 依赖 情况
init_appears_depend();
// 对符号集中各符号进行推导 FIRST 集
for (int i = 0; i < symbols.size(); i++) {
symbol = symbols[i];
this->symbol_infer_first(symbol);
symbol.clear();
}
// 对符号集中各符号进行推导 FOLLOW 集
// 符号队列
deque<string> queue;
// 初次遍历所有符号 生成初始的 FOLLOW 集
// 构建 start 的 FOLLOW 集
follow[start] = this->symbol_infer_follow(start);
follow[start].push_back("$");
queue.push_back(start);
// 构建除 start 的 FOLLOW 集
for (int i = 0; i < symbols.size(); i++) {
symbol = symbols[i];
if (symbol == start) {
symbol.clear();
continue;
}
follow[symbol] = this->symbol_infer_follow(symbol);
queue.push_back(symbol);
symbol.clear();
}
// 对 符号队列 进行进一步生成
while (!queue.empty()) {
// 读取 符号队列 开头
symbol = queue.front();
queue.pop_front();
// 若 FOLLOW 集发生改变
vector<string> new_symbol_follow = this->symbol_infer_follow(symbol);
if (follow[symbol].size() < new_symbol_follow.size()) {
// 对依赖 该符号 的所有符号添加至 符号队列
vector<string> dep = depend[symbol];
for (int i = 0; i < dep.size(); i++) {
queue.push_back(dep[i]);
}
follow[symbol] = new_symbol_follow;
}
symbol.clear();
}
}
void Grammar::print_grammar_set()
{
// 打印符号在产生式的出现情况
cout << "[left_appears]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << "LEFT( " << symbols[i] << " ) = {";
for (int j = 0; j < left_appears[symbols[i]].size(); j++) {
cout << " " << left_appears[symbols[i]][j] << " ";
}
cout << "}" << endl;
}
cout << endl << endl;
cout << "[right_appears]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << "RIGHT( " << symbols[i] << " ) = {";
for (int j = 0; j < right_appears[symbols[i]].size(); j++) {
cout << " " << right_appears[symbols[i]][j] << " ";
}
cout << "}" << endl;
}
cout << endl << endl;
// 打印 FOLLOW 集的依赖关系
cout << "[depend]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << "DEPEND( " << symbols[i] << " ) = {";
for (int j = 0; j < depend[symbols[i]].size(); j++) {
cout << " " << depend[symbols[i]][j] << " ";
}
cout << "}" << endl;
}
cout << endl << endl;
// 打印是否可以推导出 $ 空符号
cout << "[infer_empty]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << symbols[i]<<" -> " << infer_empty[symbols[i]] << endl;
}
cout << endl << endl;
// 打印 FIRST 集
cout << "[FIRST]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << "FIRST( " << symbols[i] << " ) = {";
for (int j = 0; j < first[symbols[i]].size(); j++) {
cout << " " << first[symbols[i]][j] << " ";
}
cout << "}" << endl;
}
cout << endl << endl;
// 打印 FOLLOW 集
cout << "[FOLLOW]:" << endl;
for (int i = 0; i < symbols.size(); i++) {
cout << "FOLLOW( " << symbols[i] << " ) = {";
for (int j = 0; j < follow[symbols[i]].size(); j++) {
cout << " " << follow[symbols[i]][j] << " ";
}
cout << "}" << endl;
}
cout << endl << endl;
}
void Grammar::get_token_strings(vector<string>& my_token_strings)
{
token_strings.resize(my_token_strings.size());
token_strings.assign(my_token_strings.begin(), my_token_strings.end());
}
void Grammar::print_token_strings()
{
for (int i = 0; i < token_strings.size(); i++) {
cout << token_strings[i] << endl;
}
}
void Grammar::init_appears_depend()
{
for (int k = 0; k < symbols.size(); k++) {
left_appears[symbols[k]] = vector<int>();
right_appears[symbols[k]] = vector<int>();
depend[symbols[k]] = vector<string>();
for (int i = 0; i < grammar_rules.size(); i++) {
if (grammar_rules[i].first == symbols[k]) {
// 产生式左侧相等 存入 left
left_appears[symbols[k]].push_back(i);
// 对该产生式构建依赖关系
for (int m = 0; m < grammar_rules[i].second.size(); m++) {
int n;
// 判断该产生式右侧符号是否可以推导至 $ 空符号
for (n = m + 1; n < grammar_rules[i].second.size(); n++) {
if (!infer_empty[grammar_rules[i].second[n]]) {
break;
}
}
// 若可以推导 按照入栈的方式依次加入
if (n == grammar_rules[i].second.size()) {
if (symbols[k] != grammar_rules[i].second[m]) {
depend[symbols[k]].push_back(grammar_rules[i].second[m]);
}
}
}
}
for (int j = 0; j < grammar_rules[i].second.size(); j++) {
// 产生式右侧相等 存入 left
if (grammar_rules[i].second[j] == symbols[k]) {
right_appears[symbols[k]].push_back(i);
break;
}
}
}
}
}
bool Grammar::symbol_infer_empty(const string& symbol) {
// 已经进行推导过
if (infer_empty.find(symbol) != infer_empty.end()) {
return infer_empty[symbol];
}
// 当符号为终结符时,当且仅当为 $ 可以推导出 $
if (find(VTs.begin(), VTs.end(), symbol) != VTs.end()) {
infer_empty[symbol] = (symbol == "$") ;
return infer_empty[symbol];
}
// 当符号为非终结符时,通过产生式进行推导
for (int i = 0; i < grammar_rules.size(); i++) {
// 当该符号为产生式左侧时
if (grammar_rules[i].first == symbol) {
int j;
vector<string> rule_right = grammar_rules[i].second;
for (j = 0; j < rule_right.size(); j++) {
// 递归推导 产生式右侧无法推导至 $ 时
if (!(this->symbol_infer_empty(rule_right[j]))) {
break;
}
}
// 当且仅当产生式右侧可以推导至 $ 时
if (j == rule_right.size()) {
infer_empty[symbol] = true;
return infer_empty[symbol];
}
}
}
// 当各产生式都无法推导至 $ 时,则无法推导
infer_empty[symbol] = false;
return infer_empty[symbol];
}
vector<string> Grammar::symbol_infer_first(const string& symbol)
{
// 已经推导过 FIRST 集
if (first.find(symbol) != first.end()) {
return first[symbol];
}
vector<string> symbol_first;
// 当符号为终结符时 FIRST 集为它本身
if (find(VTs.begin(), VTs.end(), symbol) != VTs.end()) {
symbol_first.push_back(symbol);
first[symbol] = symbol_first;
return first[symbol];
}
// 当符号为非终结符时,通过产生式进行推导
for (int i = 0; i < grammar_rules.size(); i++) {
// 当该符号为产生式左侧时
if (grammar_rules[i].first == symbol) {
int j;
for (j = 0; j < grammar_rules[i].second.size(); j++) {
// 依次添加所有产生式右侧的
vector<string> firsts = symbol_infer_first(grammar_rules[i].second[j]);
for (int k = 0; k < firsts.size(); k++) {
symbol_first.push_back(firsts[k]);
}
// 若产生式右侧无法推导至 $ 空字符时 中断
if (!infer_empty[grammar_rules[i].second[j]]) {
break;
}
}
// 当且仅当产生式右侧可以推导至 $ 时 将 $ 加入到 FIRST 集中
if (j == grammar_rules[i].second.size()) {
symbol_first.push_back("$");
}
}
}
// 对当前 FIRST 集进行 去重 与 排序
set<string> ssymbol_first(symbol_first.begin(), symbol_first.end());
symbol_first.clear();
symbol_first.resize(ssymbol_first.size());
symbol_first.assign(ssymbol_first.begin(), ssymbol_first.end());
sort(symbol_first.begin(), symbol_first.end());
// 返回非终结符的 FIRST 集
first[symbol] = symbol_first;
return first[symbol];
}
vector<string> Grammar::symbol_infer_follow(const string& symbol)
{
vector<string> symbol_follow;
// 获取该符号出现在哪些产生式右侧
vector<int> right_appear = right_appears[symbol];
for (int i = 0; i < right_appear.size(); i++) {
int cnt;
// 获取该产生式右侧的符号
vector<string> rule_right = grammar_rules[right_appear[i]].second;
// 依次遍历 该产生式右侧 至 该符号 后一位
for (cnt = 0; cnt < rule_right.size(); cnt++) {
if (rule_right[cnt] == symbol) {
break;
}
}
cnt++;
// 遍历 剩余产生式右侧
for (; cnt < rule_right.size(); cnt++) {
// 依次获取 后置元素 的 FIRST 集
vector<string> symbol_first = first[rule_right[cnt]];
// 将 该 FIRST 集 循环添加至 symbol_follow 中
for (int j = 0; j < symbol_first.size(); j++) {
symbol_follow.push_back(symbol_first[j]);
}
// 若不可达 $ 中断遍历
if (!infer_empty[rule_right[cnt]]) {
break;
}
}
// 当剩余产生式右侧均可到达 $ 时
if (cnt == rule_right.size()) {
if (follow.find(grammar_rules[right_appear[i]].first) != follow.end()) {
// 将产生式左侧的 FOLLOW 集 加入到 当前符号的 FOLLOW 集中
vector<string> first_follow = follow[grammar_rules[right_appear[i]].first];
for (int j = 0; j < first_follow.size(); j++) {
symbol_follow.push_back(first_follow[j]);
}
}
}
}
// 删除不需要的 $ 空字符
auto it = remove(symbol_follow.begin(), symbol_follow.end(), "$");
auto it1 = symbol_follow.erase(it, symbol_follow.end());
// 对当前 FOLLOW 集 进行去重排序
set<string> ssymbol_follow(symbol_follow.begin(), symbol_follow.end());
symbol_follow.clear();
symbol_follow.resize(ssymbol_follow.size());
symbol_follow.assign(ssymbol_follow.begin(), ssymbol_follow.end());
sort(symbol_follow.begin(), symbol_follow.end());
return symbol_follow;
}

55
grammar.h Normal file
View File

@ -0,0 +1,55 @@
// 语法生成器
#ifndef GRAMMAR_H
#define GRAMMAR_H
#include <string>
#include <vector>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
class Grammar
{
public:
const char grammar_file[12] = "grammar.txt";
Grammar();
~Grammar();
void read_grammar(); // 读取语法规则
void print_grammar(); // 打印语法规则
void expand_grammar(); // 拓展语法规则
void init_grammar_set(); // 初始化语法相关集合
void print_grammar_set(); // 打印语法相关集合
void get_token_strings(vector<string> &); // 获取 token_stirngs
void print_token_strings();
protected:
vector<pair<string, vector<string>>> grammar_rules; // 产生式规则
string start; // 起始字符
vector<string> symbols; // 符号
vector<string> VTs; // 终结符
vector<string> VNs; // 非终结符
unordered_map<string, vector<string>> first; // FIRST 集
unordered_map<string, vector<string>> follow; // FOLLOW 集
unordered_map<string, bool> infer_empty; // 是否可以推导出 $ 空字符
vector<string> token_strings;
private:
unordered_map<string, vector<int>> left_appears; // 该符号出现在哪些产生式左侧
unordered_map<string, vector<int>> right_appears; // 该符号出现在哪些产生式右侧
unordered_map<string, vector<string>> depend; // FOLLOW 集的依赖关系
void init_appears_depend(); // 获取 appear depend 集合
bool symbol_infer_empty(const string& symbol); // 判断符号是否可以推导出 $ 空字符
vector<string> symbol_infer_first(const string& symbol);// 推导符号的 FIRST 集
vector<string> symbol_infer_follow(const string& symbol);// 推导符号的 FOLLOW 集
};
#endif // !GRAMMAR_H

70
grammar.txt Normal file
View File

@ -0,0 +1,70 @@
program -> compUnit
compUnit -> decl compUnit
compUnit -> funcDef compUnit
compUnit -> $
decl -> constDecl
decl -> varDecl
constDecl -> const bType constDef argConst ;
argConst -> , constDef argConst
argConst -> $
constDef -> IDN = constInitVal
constInitVal -> constExp
constExp -> assignExp
varDecl -> bType varDef argVarDecl ;
argVarDecl -> , varDef argVarDecl
argVarDecl -> $
varDef -> IDN argVarDef
argVarDef -> = initVal
argVarDef -> $
initVal -> exp
bType -> int
funcDef -> funcType IDN ( funcFParams ) block
funcType -> void
funcFParams -> funcFParam argFunctionF
funcFParams -> $
argFunctionF -> , funcFParam argFunctionF
argFunctionF -> $
funcFParam -> bType IDN
block -> { blockItem }
blockItem -> decl blockItem
blockItem -> stmt blockItem
blockItem -> $
stmt -> exp ;
stmt -> ;
stmt -> block
stmt -> return argExp ;
callFunc -> ( funcRParams )
callFunc -> $
funcRParam -> exp
funcRParams -> funcRParam argFunctionR
funcRParams -> $
argFunctionR -> , funcRParam argFunctionR
argFunctionR -> $
argExp -> exp
argExp -> $
exp -> assignExp
assignExp -> eqExp assignExpAtom
assignExpAtom -> = eqExp assignExpAtom
assignExpAtom -> $
eqExp -> relExp eqExpAtom
eqExpAtom -> == relExp eqExpAtom
eqExpAtom -> != relExp eqExpAtom
eqExpAtom -> $
relExp -> addExp relExpAtom
relExpAtom -> < addExp relExpAtom
relExpAtom -> > addExp relExpAtom
relExpAtom -> <= addExp relExpAtom
relExpAtom -> >= addExp relExpAtom
relExpAtom -> $
addExp -> mulExp addExpAtom
addExpAtom -> + mulExp addExpAtom
addExpAtom -> - mulExp addExpAtom
addExpAtom -> $
mulExp -> unaryExp mulExpAtom
mulExpAtom -> * unaryExp mulExpAtom
mulExpAtom -> / unaryExp mulExpAtom
mulExpAtom -> % unaryExp mulExpAtom
mulExpAtom -> $
number -> INT
unaryExp -> number
unaryExp -> IDN callFunc

79
main.cpp Normal file
View File

@ -0,0 +1,79 @@
#include <iostream>
#include <fstream>
#include <cassert>
#include "nfa.h"
#include "grammar.h"
#include "LL1.h"
using namespace std;
int main(int argc, char** argv) {
cout << "hello world" << endl;
//NFA nfa = buildNFA("./nfa.txt");
NFA nfa = RexToNFA();
//printNFA(nfa);
DFA dfa = nfaToDFA(nfa);
//printDFA(dfa);
DFA minimizedDFA = minimizeDFA(minimizeDFA(dfa));
removeUnreachableStates(minimizedDFA);
printDFA(minimizedDFA);
string inputs[6] = {
"tests/00/00.txt",
"tests/01/01.txt",
"tests/02/02.txt",
"tests/07/07.txt",
"tests/08_±àÒë´íÎóʾÀý/08.txt",
"tests/10_±àÒë´íÎóʾÀý/10.txt"
};
string outputs_lexical[6] = {
"tests/00/00_my_lexical.txt",
"tests/01/01_my_lexical.txt",
"tests/02/02_my_lexical.txt",
"tests/07/07_my_lexical.txt",
"tests/08_±àÒë´íÎóʾÀý/08_my_lexical.txt",
"tests/10_±àÒë´íÎóʾÀý/10_my_lexical.txt"
};
string outputs_grammar[6] = {
"tests/00/00_my_grammar.txt",
"tests/01/01_my_grammar.txt",
"tests/02/02_my_grammar.txt",
"tests/07/07_my_grammar.txt",
"tests/08_±àÒë´íÎóʾÀý/08_my_grammar.txt",
"tests/10_±àÒë´íÎóʾÀý/10_my_grammar.txt"
};
int i = 0;
LL1 ll;
ll.print_grammar_set();
for (auto input : inputs) {
string content = readfile(input);
vector<string> token_strings = recognize(minimizedDFA, content, outputs_lexical[i]);
LL1 ll;
bool flag = ll.IsLL1();
ll.build_LL1_predict();
// ll.print_LL1_predict();
ll.get_token_strings(token_strings);
// ll.print_token_strings();
ll.build_LL1_grammar();
ll.fileout_LL1_grammar_log(outputs_grammar[i]);
// ll.print_LL1_grammar_log();
cout << endl;
i++;
}
return 0;
}

253
nfa.cpp Normal file
View File

@ -0,0 +1,253 @@
#include "nfa.h"
NFA RexToNFA() {
//由于里面存在||,所以不同正则间使用空格分隔代表| l代表letter_代表下划线0代表数字(也可以是d但是为了使用已经有的函数)
//[lu]代表l|u
string rex = "+ - * / % = > < == <= >= != && || ( ) { } , ; [l_][l_0]* -?00*";
//下面给出正则对应的输出(终态)
vector<WordType> finalState = {
OP_ADD, OP_SUB,OP_MUL,OP_DIV,OP_MOD,OP_ASSIGN,OP_GT,OP_LT, OP_EQ,OP_LE,OP_GE,OP_NE, OP_AND, OP_OR,SE_LBRAC, SE_RBRAC,
SE_LCBRAC,SE_RCBRAC,SE_COMMA,SE_SEMI,IDN,INT_VAL
};
stringstream ss(rex);
string target;
// 创建初始状态
int stateIndex = 0;
int finalIndex = 0;
State* startState = new State(stateIndex++);
set<State*, StatePtrCompare> endStates;
set<State*, StatePtrCompare> allStates = { startState };
while (getline(ss, target,' ')) {
//如获得[l_][l_0]*
State* currentState = startState;
for (size_t i = 0; i < target.length();i++) {
//创建一个新状态startState通过输入InputCharType到达该状态
State* newState = new State(stateIndex++);
allStates.insert(newState);
//需要往后看一个符号
if (target[i] == '[') {
//[...]构成一种输入,查看]后面是否有?或者*,来判断当前状态的构成
for (i=i+1; i < target.length() && target[i] != ']'; i++) {
InputCharType input = getInputCharType(target[i]);
if (input != EPSILON) {
// 添加转移函数,从当前状态向新状态转移
currentState->addTransition(input, newState);
}
}
}
else {
InputCharType input = getInputCharType(target[i]);
currentState->addTransition(input, newState);
}
//往后查看一个输入
if (i + 1 < target.length() && target[i + 1] == '?') {
//创建EPSILON转移状态
State* epsState = new State(stateIndex++);
allStates.insert(epsState);
currentState->addTransition(EPSILON, epsState);
newState->addTransition(EPSILON, epsState);
currentState = epsState;
// 跳过'?'字符
i++;
}
else if (i + 1 < target.length() && target[i + 1] == '*') {
State* epsState = new State(stateIndex++);
allStates.insert(epsState);
currentState->addTransition(EPSILON, epsState);
newState->addTransition(EPSILON, epsState);
epsState->addTransition(EPSILON, currentState);
currentState = epsState;
// 跳过'*'字符
i++;
}
else {
currentState = newState;
}
//判断是否是终止状态
if (i == (target.length() - 1)) {
// 到达最后一个字符,将当前状态设置为终止状态
currentState->setFinalState(true, finalState[endStates.size()]);
endStates.insert(currentState);
}
}//for
}
// 返回字符集合对应的NFA
return NFA(startState, endStates, allStates);
}
NFA buildNFA(string filename) {
ifstream ifs(filename);
if (!ifs) {
cerr << "Cannot open file: " << filename << endl;
exit(EXIT_FAILURE);
}
int stateNum, inputNum;
ifs >> stateNum >> inputNum;
vector<State*> states(stateNum);
for (int i = 0; i < stateNum; i++) {
states[i] = new State(i);
}
State* startState = states[0];
set<State*, StatePtrCompare> endStates;
for (int i = 0; i < stateNum; i++) {
for (int j = 0; j < inputNum; j++) {
string targetStateIDs;
ifs >> targetStateIDs;
if (targetStateIDs.compare("#") != 0) {
stringstream ss(targetStateIDs);
string targetStateIDStr;
while (getline(ss, targetStateIDStr, ',')) {
int targetStateID = stoi(targetStateIDStr);
states[i]->addTransition(static_cast<InputCharType>(j), states[targetStateID]);
}
}
}
}
int endStateNum;
ifs >> endStateNum;
for (int i = 0; i < endStateNum; i++) {
int endStateID, wordTypeID;
ifs >> endStateID >> wordTypeID;
states[endStateID]->setFinalState(true, static_cast<WordType>(wordTypeID));
endStates.insert(states[endStateID]);
}
return NFA(startState, endStates, set<State*, StatePtrCompare>(states.begin(), states.end()));
}
void printNFA(const NFA& nfa) {
cout << "Start state: " << nfa.startState->id << endl;
cout << "End states: "<<endl;
for (auto state : nfa.endStates) {
cout << state->id << " " << getWordTypeName(state->wordType) << " " << (state->isFinalState == true) << endl;
}
cout << endl;
cout << "States and transitions:" << endl;
for (auto state : nfa.states) {
cout << "State " << state->id << ":" << endl;
for (auto transition : state->transitions) {
cout << "\tInput " << getInputChartypeName(transition.first) << ": ";
for (auto targetState : transition.second) {
cout << targetState->id << " ";
}
cout << endl;
}
}
}
set<State*, StatePtrCompare> move(const set<State*, StatePtrCompare>& states, InputCharType input) {
set<State*, StatePtrCompare> targetStates;
for (State* state : states) {
auto it = state->transitions.find(input);
if (it != state->transitions.end()) {
for (State* targetState : it->second) {
if (targetStates.find(targetState) == targetStates.end()) {
targetStates.insert(targetState);
}
}
}
}
return targetStates;
}
set<State*, StatePtrCompare> epsilonClosure(const set<State*, StatePtrCompare>& states) {
set<State*, StatePtrCompare> closure = states;
stack<State*> stateStack;
for (State* state : states) {
stateStack.push(state);
}
while (!stateStack.empty()) {
State* currentState = stateStack.top();
stateStack.pop();
auto it = currentState->transitions.find(EPSILON);
if (it != currentState->transitions.end()) {
for (State* nextState : it->second) {
if (closure.find(nextState) == closure.end()) {//防止同一状态多次进栈set自带去重
closure.insert(nextState);
stateStack.push(nextState);
}
}
}
}
return closure;
}
DFA nfaToDFA(const NFA& nfa) {
map<set<State*, StatePtrCompare>, State*, SetComparator> dfaStatesMap; // 用于映射NFA状态集合到DFA状态的映射表
queue<set<State*, StatePtrCompare>> nfaStatesQueue; // 用于BFS遍历的集合队列
set<State*, StatePtrCompare> dfaStates;
set<State*, StatePtrCompare> dfaEndStates;
set<State*, StatePtrCompare> nfaStartClosure = epsilonClosure({ nfa.startState });
State* dfaStartState = new State(0);
dfaStatesMap[nfaStartClosure] = dfaStartState;
dfaStates.insert(dfaStartState);
nfaStatesQueue.push(nfaStartClosure);
int nextStateId = 1;
//set<State*, StatePtrCompare> nfaStartClosure
while (!nfaStatesQueue.empty()) {
set<State*, StatePtrCompare> currentNFAStates = nfaStatesQueue.front();
nfaStatesQueue.pop();
State* currentDFAState = dfaStatesMap[currentNFAStates];
// 检查是否有终止状态如果有设置DFA状态为终止状态
for (State* nfaState : currentNFAStates) {
if (nfaState->isFinalState) {
// cout << nfaState->id << "is FinalState" << endl;
currentDFAState->setFinalState(true, nfaState->wordType);
dfaEndStates.insert(currentDFAState);
break;
}
}
// 遍历所有输入字符类型
for (int i = 0; i < static_cast<int>(EPSILON); i++) {
InputCharType inputCharType = static_cast<InputCharType>(i);
set<State*, StatePtrCompare> nextNFAStates = epsilonClosure(move(currentNFAStates, inputCharType));
if (nextNFAStates.empty()) {
continue;
}
// 如果NFA状态集合不存在于映射表中则创建新的DFA状态
if (dfaStatesMap.find(nextNFAStates) == dfaStatesMap.end()) {
State* newDFAState = new State(nextStateId++);
dfaStatesMap[nextNFAStates] = newDFAState;
dfaStates.insert(newDFAState);
nfaStatesQueue.push(nextNFAStates);
}
currentDFAState->addTransition(inputCharType, dfaStatesMap[nextNFAStates]);
}
}
return DFA(dfaStartState, dfaEndStates, dfaStates);
}
void printDFA(const DFA& dfa) {
cout << "Start state: " << dfa.startState->id << endl;
cout << "End states: "<<endl;
for (auto state : dfa.endStates) {
cout << state->id << " " << getWordTypeName(state->wordType) << endl;
}
cout << endl;
cout << "States and transitions:" << endl;
for (auto state : dfa.states) {
cout << "State " << state->id << ":" << endl;
for (auto transition : state->transitions) {
cout << "\tInput " << getInputChartypeName(transition.first) << ": ";
for (auto targetState : transition.second) {
cout << targetState->id << " ";
}
cout << endl;
}
}
}

173
nfa.h Normal file
View File

@ -0,0 +1,173 @@
#pragma once
#ifndef __NFA__H__
#define __NFA__H__
#include <map>
#include <set>
#include <deque>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <sstream>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
//单词符号的类型,返回<待测代码中的单词符号,WordType>
typedef enum WordType {
//当识别成标识符后先判断是不是保留字让后再判断IDN
KW_INT = 0, // int
KW_VOID, // void
KW_RETURN, // return
KW_CONST, // const
OP_ADD, // +
OP_SUB, // -
OP_MUL, // *
OP_DIV, // /
OP_MOD, // %
OP_ASSIGN, // =
OP_GT, // >
OP_LT, // <
OP_EQ, // ==
OP_LE, // <=
OP_GE, // >=
OP_NE, // !=
OP_AND, // &&
OP_OR, // ||
SE_LBRAC, // ( left backet
SE_RBRAC, // ) right bracket
SE_LCBRAC, // { left curly bracket
SE_RCBRAC, // } right curly bracket
SE_COMMA, // ,
SE_SEMI, // ;
IDN, // [a-zA-Z][a-zA-Z_0-9]*
INT_VAL, // -*[0-9]+
UNKOWN
}WordType;
string getWordTypeName(WordType type);
//定义输入的字符类别
typedef enum InputCharType {
LETTER = 0, // 字母 0
UNDERLINE, // _ 1
DIGIT, // 数字 2 当识别成功一个数字时为了避免出现数字01的情况返回前先进行一个判断对GCC01可以识别并等于1的
//OP
ADD, // + 3
SUB, // - 4
MUL, // * 5
DIV, // / 6
MOD, // % 7
EQ, // = 8
GT, // > 9
LT, // < 10
NOT, // ! 11
AND, // & 12
OR, // | 13
//SE
LBRACKET, // ( 14
RBRACKET, // ) 15
LCBRAC, // { 16
RCBRAC, // } 17
COMMA, // , 18
SEMI, // ; 19
EPSILON, // 空字符 20
}InputCharType;
string getInputChartypeName(InputCharType type);
enum class TokenType {
KW = 0,
OP,
SE,
IDN,
INT,
UNKNOWN
};
TokenType getTokenType(WordType wordType,string buffer);
typedef struct Token {
string value;
TokenType type;
} Token;
//定义函数判断输入的字符类别
InputCharType getInputCharType(char c);
string getWordTypeName(WordType type,string buffer);
//定义状态类
class State {
public:
int id; // 状态编号
map<InputCharType, set<State*>> transitions; // 转移函数映射表,记录每个输入字符类型对应的目标状态集合
bool isFinalState; // 是否为最终状态
WordType wordType; // 到达该状态时应该返回的词法单元类型
State(int id) : id(id), isFinalState(false), wordType(UNKOWN) {}
void addTransition(InputCharType input, State* targetState) {
transitions[input].insert(targetState);
}
void setFinalState(bool isFinal, WordType type) {
isFinalState = isFinal;
wordType = type;
}
bool operator<(const State& other) const {
return id < other.id;
}
};
//为了是set内部有序定义排序结构体StatePtrCompare
struct StatePtrCompare {
bool operator()(const State* lhs, const State* rhs) const {
return lhs->id < rhs->id;
}
};
//定义NFA类
class NFA {
public:
State* startState; // 起始状态
set<State*, StatePtrCompare> endStates; // 终止状态集合
set<State*, StatePtrCompare> states; // 状态集合
NFA(State* startState, set<State*, StatePtrCompare> endStates, set<State*, StatePtrCompare> states) :
startState(startState), endStates(endStates), states(states) {}
// void printNFA();
};
NFA RexToNFA();
void printNFA(const NFA& nfa);
NFA buildNFA(string filename);
NFA RexToNFA();
set<State*, StatePtrCompare> move(const set<State*, StatePtrCompare>& states, InputCharType input);
set<State*, StatePtrCompare> epsilonClosure(const set<State*, StatePtrCompare>& states);
class DFA {
public:
State* startState; // 起始状态
set<State*, StatePtrCompare> endStates; // 终止状态集合
set<State*, StatePtrCompare> states; // 状态集合
DFA(State* startState, set<State*, StatePtrCompare> endStates, set<State*, StatePtrCompare> states) :
startState(startState), endStates(endStates), states(states) {}
};
void removeUnreachableStates(DFA& dfa);
void printDFA(const DFA& dfa);
DFA nfaToDFA(const NFA& nfa);
void printDFA(const DFA& dfa);
struct SetComparator {
bool operator()(const set<State*, StatePtrCompare>& a, const set<State*, StatePtrCompare>& b) const {
if (a.size() != b.size()) {
return a.size() < b.size();
}
vector<State*> vecA(a.begin(), a.end());
vector<State*> vecB(b.begin(), b.end());
sort(vecA.begin(), vecA.end(), [](const State* a, const State* b) { return a->id < b->id; });
sort(vecB.begin(), vecB.end(), [](const State* a, const State* b) { return a->id < b->id; });
return vecA < vecB;
}
};
string getGrammarName(WordType type, string buffer);
DFA minimizeDFA(const DFA& dfa);
vector<string> recognize(const DFA& dfa, const string& input, const string& output);
string readfile(const string& filename);
#endif

56
nfa.txt Normal file
View File

@ -0,0 +1,56 @@
30 21
1 1 2 5 3,4 6 7 8 9,10 12,13 15,16 18 22 20 24 25 26 27 28 29 0
1 1 1 # # # # # # # # # # # # # # # # # #
# # 2 # # # # # # # # # # # # # # # # # #
# # 2 # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # 11 # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # 14 # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # 17 # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # 19 # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # 21 # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # 23 # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
22
1 24
2 25
4 5
5 4
6 6
7 7
8 8
9 9
11 12
12 10
14 14
15 11
17 13
19 15
21 17
23 16
24 18
25 19
26 20
27 21
28 22
29 23

3
tests/00/00.txt Normal file
View File

@ -0,0 +1,3 @@
void main(){
return 3;
}

34
tests/00/00_grammar.txt Normal file
View File

@ -0,0 +1,34 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

9
tests/00/00_lexical.txt Normal file
View File

@ -0,0 +1,9 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
return <KW>
3 <INT>
; <SE>
} <SE>

23
tests/00/00_main.ll Normal file
View File

@ -0,0 +1,23 @@
; ModuleID = 'sysy2022_compiler'
source_filename = "../input/../input/00_main.sy"
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @starttime()
declare void @stoptime()
define void @defn() {
defn_ENTRY:
ret i32 3
}

View File

@ -0,0 +1,34 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

View File

@ -0,0 +1,9 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
return <KW>
3 <INT>
; <SE>
} <SE>

View File

@ -0,0 +1,9 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
return <KW>
3 <INT>
; <SE>
} <SE>

View File

@ -0,0 +1,83 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to0__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to0__0"><a href="#difflib_chg_to0__top">t</a></td><td class="diff_header" id="from0_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to0__top">t</a></td><td class="diff_header" id="to0_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_12">12</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_12">12</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_13">13</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_13">13</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_14">14</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_14">14</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_15">15</td><td nowrap="nowrap">argExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_15">15</td><td nowrap="nowrap">argExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_16">16</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_16">16</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_17">17</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_17">17</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_18">18</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_18">18</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_19">19</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_19">19</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_20">20</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_20">20</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_21">21</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_21">21</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_22">22</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_22">22</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_23">23</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_23">23</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_24">24</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_24">24</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_25">25</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_25">25</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_26">26</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_26">26</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_27">27</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_27">27</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_28">28</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_28">28</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_29">29</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_29">29</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_30">30</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_30">30</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_31">31</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_31">31</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_32">32</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to0_32">32</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_33">33</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to0_33">33</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from0_34">34</td><td nowrap="nowrap">EOF#EOF&nbsp;accept</td><td class="diff_next"></td><td class="diff_header" id="to0_34">34</td><td nowrap="nowrap">EOF#EOF&nbsp;accept<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to1__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to1__0"><a href="#difflib_chg_to1__top">t</a></td><td class="diff_header" id="from1_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to1__top">t</a></td><td class="diff_header" id="to1_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_6">6</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_6">6</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_7">7</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_7">7</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_8">8</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_8">8</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from1_9">9</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to1_9">9</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

7
tests/01/01.txt Normal file
View File

@ -0,0 +1,7 @@
int a = 3;
int b = 5;
void main(){
int a = 5;
return a + b;
}

119
tests/01/01_grammar.txt Normal file
View File

@ -0,0 +1,119 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#+ reduction
mulExpAtom#+ reduction
addExpAtom#+ reduction
+#+ move
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

26
tests/01/01_lexical.txt Normal file
View File

@ -0,0 +1,26 @@
int <KW>
a <IDN>
= <OP>
3 <INT>
; <SE>
int <KW>
b <IDN>
= <OP>
5 <INT>
; <SE>
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
a <IDN>
+ <OP>
b <IDN>
; <SE>
} <SE>

119
tests/01/01_my_grammar.txt Normal file
View File

@ -0,0 +1,119 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argVarDecl#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#+ reduction
mulExpAtom#+ reduction
addExpAtom#+ reduction
+#+ move
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

View File

@ -0,0 +1,26 @@
int <KW>
a <IDN>
= <OP>
3 <INT>
; <SE>
int <KW>
b <IDN>
= <OP>
5 <INT>
; <SE>
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
a <IDN>
+ <OP>
b <IDN>
; <SE>
} <SE>

30
tests/01/01_var_defn2.ll Normal file
View File

@ -0,0 +1,30 @@
; ModuleID = 'sysy2022_compiler'
source_filename = "../input/../input/01_var_defn2.sy"
@a = global i32 3
@b = global i32 5
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @starttime()
declare void @stoptime()
define void @defn() {
defn_ENTRY:
%op0 = alloca i32
store i32 5, i32* %op0
%op1 = load i32, i32* %op0
%op2 = load i32, i32* @b
%op3 = add i32 %op1, %op2
ret i32 %op3
}

168
tests/01/grammar_diff.html Normal file
View File

@ -0,0 +1,168 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to2__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to2__0"><a href="#difflib_chg_to2__top">t</a></td><td class="diff_header" id="from2_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to2__top">t</a></td><td class="diff_header" id="to2_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_6">6</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_6">6</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_21">21</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_21">21</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_22">22</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_22">22</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_23">23</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_23">23</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_24">24</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_24">24</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_25">25</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_25">25</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_26">26</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_26">26</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_27">27</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_27">27</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_28">28</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_28">28</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_29">29</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_29">29</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_30">30</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_30">30</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_31">31</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_31">31</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_32">32</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_32">32</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_33">33</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_33">33</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_34">34</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_34">34</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_35">35</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_35">35</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_36">36</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_36">36</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_37">37</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_37">37</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_38">38</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_38">38</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_39">39</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_39">39</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_40">40</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_40">40</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_41">41</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_41">41</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_42">42</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_42">42</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_43">43</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_43">43</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_44">44</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_44">44</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_45">45</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_45">45</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_46">46</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_46">46</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_47">47</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_47">47</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_48">48</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_48">48</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_49">49</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_49">49</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_50">50</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_50">50</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_51">51</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_51">51</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_52">52</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_52">52</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_53">53</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_53">53</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_54">54</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_54">54</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_55">55</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_55">55</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_56">56</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_56">56</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_57">57</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_57">57</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_58">58</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_58">58</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_59">59</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_59">59</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_60">60</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_60">60</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_61">61</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_61">61</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_62">62</td><td nowrap="nowrap">block#{&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_62">62</td><td nowrap="nowrap">block#{&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_63">63</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_63">63</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_64">64</td><td nowrap="nowrap">blockItem#int&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_64">64</td><td nowrap="nowrap">blockItem#int&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_65">65</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_65">65</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_66">66</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_66">66</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_67">67</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_67">67</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_68">68</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_68">68</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_69">69</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_69">69</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_70">70</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_70">70</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_71">71</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_71">71</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_72">72</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_72">72</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_73">73</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_73">73</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_74">74</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_74">74</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_75">75</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_75">75</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_76">76</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_76">76</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_77">77</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_77">77</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_78">78</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_78">78</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_79">79</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_79">79</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_80">80</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_80">80</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_81">81</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_81">81</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_82">82</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_82">82</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_83">83</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_83">83</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_84">84</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_84">84</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_85">85</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_85">85</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_86">86</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_86">86</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_87">87</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_87">87</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_88">88</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_88">88</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_89">89</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_89">89</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_90">90</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_90">90</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_91">91</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_91">91</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_92">92</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_92">92</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_93">93</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_93">93</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_94">94</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_94">94</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_95">95</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_95">95</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_96">96</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_96">96</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_97">97</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_97">97</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_98">98</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_98">98</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_99">99</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_99">99</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_100">100</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_100">100</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_101">101</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_101">101</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_102">102</td><td nowrap="nowrap">callFunc#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_102">102</td><td nowrap="nowrap">callFunc#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_103">103</td><td nowrap="nowrap">mulExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_103">103</td><td nowrap="nowrap">mulExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_104">104</td><td nowrap="nowrap">addExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_104">104</td><td nowrap="nowrap">addExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_105">105</td><td nowrap="nowrap">+#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_105">105</td><td nowrap="nowrap">+#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_106">106</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_106">106</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_107">107</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_107">107</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_108">108</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_108">108</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_109">109</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_109">109</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_110">110</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_110">110</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_111">111</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_111">111</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_112">112</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_112">112</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_113">113</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_113">113</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_114">114</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_114">114</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_115">115</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_115">115</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_116">116</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_116">116</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_117">117</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to2_117">117</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_118">118</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to2_118">118</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from2_119">119</td><td nowrap="nowrap">EOF#EOF&nbsp;accept</td><td class="diff_next"></td><td class="diff_header" id="to2_119">119</td><td nowrap="nowrap">EOF#EOF&nbsp;accept<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,75 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to3__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to3__0"><a href="#difflib_chg_to3__top">t</a></td><td class="diff_header" id="from3_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to3__top">t</a></td><td class="diff_header" id="to3_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_4">4</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_4">4</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_5">5</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_5">5</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_6">6</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_6">6</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_7">7</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_7">7</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_8">8</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_8">8</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_9">9</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_9">9</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_10">10</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_10">10</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_11">11</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_11">11</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_12">12</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_12">12</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_13">13</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_13">13</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_14">14</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_14">14</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_15">15</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_15">15</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_16">16</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_16">16</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_17">17</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_17">17</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_18">18</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_18">18</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_19">19</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_19">19</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_20">20</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_20">20</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_21">21</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_21">21</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_22">22</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_22">22</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_23">23</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_23">23</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_24">24</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_24">24</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_25">25</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_25">25</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from3_26">26</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to3_26">26</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

7
tests/02/02.txt Normal file
View File

@ -0,0 +1,7 @@
void main(){
int a, b0, _c;
a = 1;
b0 = 2;
_c = 3;
return b0 + _c;
}

151
tests/02/02_grammar.txt Normal file
View File

@ -0,0 +1,151 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#, reduction
argVarDecl#, reduction
,#, move
varDef#IDN reduction
IDN#IDN move
argVarDef#, reduction
argVarDecl#, reduction
,#, move
varDef#IDN reduction
IDN#IDN move
argVarDef#; reduction
argVarDecl#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#+ reduction
mulExpAtom#+ reduction
addExpAtom#+ reduction
+#+ move
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

30
tests/02/02_lexical.txt Normal file
View File

@ -0,0 +1,30 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
, <SE>
b0 <IDN>
, <SE>
_c <IDN>
; <SE>
a <IDN>
= <OP>
1 <INT>
; <SE>
b0 <IDN>
= <OP>
2 <INT>
; <SE>
_c <IDN>
= <OP>
3 <INT>
; <SE>
return <KW>
b0 <IDN>
+ <OP>
_c <IDN>
; <SE>
} <SE>

151
tests/02/02_my_grammar.txt Normal file
View File

@ -0,0 +1,151 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#, reduction
argVarDecl#, reduction
,#, move
varDef#IDN reduction
IDN#IDN move
argVarDef#, reduction
argVarDecl#, reduction
,#, move
varDef#IDN reduction
IDN#IDN move
argVarDef#; reduction
argVarDecl#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#IDN reduction
stmt#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#= reduction
mulExpAtom#= reduction
addExpAtom#= reduction
relExpAtom#= reduction
eqExpAtom#= reduction
assignExpAtom#= reduction
=#= move
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#+ reduction
mulExpAtom#+ reduction
addExpAtom#+ reduction
+#+ move
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

View File

@ -0,0 +1,30 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
, <SE>
b0 <IDN>
, <SE>
_c <IDN>
; <SE>
a <IDN>
= <OP>
1 <INT>
; <SE>
b0 <IDN>
= <OP>
2 <INT>
; <SE>
_c <IDN>
= <OP>
3 <INT>
; <SE>
return <KW>
b0 <IDN>
+ <OP>
_c <IDN>
; <SE>
} <SE>

35
tests/02/02_var_defn3.ll Normal file
View File

@ -0,0 +1,35 @@
; ModuleID = 'sysy2022_compiler'
source_filename = "../input/../input/02_var_defn3.sy"
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @starttime()
declare void @stoptime()
define void @defn() {
defn_ENTRY:
%op0 = alloca i32
%op1 = alloca i32
%op2 = alloca i32
%op3 = load i32, i32* %op0
store i32 %op3, i32 1
%op4 = load i32, i32* %op1
store i32 %op4, i32 2
%op5 = load i32, i32* %op2
store i32 %op5, i32 3
%op6 = load i32, i32* %op1
%op7 = load i32, i32* %op2
%op8 = add i32 %op6, %op7
ret i32 %op8
}

200
tests/02/grammar_diff.html Normal file
View File

@ -0,0 +1,200 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to4__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to4__0"><a href="#difflib_chg_to4__top">t</a></td><td class="diff_header" id="from4_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to4__top">t</a></td><td class="diff_header" id="to4_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_12">12</td><td nowrap="nowrap">blockItem#int&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_12">12</td><td nowrap="nowrap">blockItem#int&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_13">13</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_13">13</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_14">14</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_14">14</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_15">15</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_15">15</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_16">16</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_16">16</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_17">17</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_17">17</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_18">18</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_18">18</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_19">19</td><td nowrap="nowrap">argVarDef#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_19">19</td><td nowrap="nowrap">argVarDef#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_20">20</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_20">20</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_21">21</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_21">21</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_22">22</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_22">22</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_23">23</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_23">23</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_24">24</td><td nowrap="nowrap">argVarDef#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_24">24</td><td nowrap="nowrap">argVarDef#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_25">25</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_25">25</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_26">26</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_26">26</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_27">27</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_27">27</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_28">28</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_28">28</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_29">29</td><td nowrap="nowrap">argVarDef#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_29">29</td><td nowrap="nowrap">argVarDef#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_30">30</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_30">30</td><td nowrap="nowrap">argVarDecl#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_31">31</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_31">31</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_32">32</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_32">32</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_33">33</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_33">33</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_34">34</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_34">34</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_35">35</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_35">35</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_36">36</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_36">36</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_37">37</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_37">37</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_38">38</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_38">38</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_39">39</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_39">39</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_40">40</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_40">40</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_41">41</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_41">41</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_42">42</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_42">42</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_43">43</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_43">43</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_44">44</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_44">44</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_45">45</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_45">45</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_46">46</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_46">46</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_47">47</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_47">47</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_48">48</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_48">48</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_49">49</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_49">49</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_50">50</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_50">50</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_51">51</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_51">51</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_52">52</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_52">52</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_53">53</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_53">53</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_54">54</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_54">54</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_55">55</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_55">55</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_56">56</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_56">56</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_57">57</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_57">57</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_58">58</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_58">58</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_59">59</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_59">59</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_60">60</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_60">60</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_61">61</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_61">61</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_62">62</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_62">62</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_63">63</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_63">63</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_64">64</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_64">64</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_65">65</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_65">65</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_66">66</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_66">66</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_67">67</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_67">67</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_68">68</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_68">68</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_69">69</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_69">69</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_70">70</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_70">70</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_71">71</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_71">71</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_72">72</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_72">72</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_73">73</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_73">73</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_74">74</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_74">74</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_75">75</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_75">75</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_76">76</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_76">76</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_77">77</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_77">77</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_78">78</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_78">78</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_79">79</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_79">79</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_80">80</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_80">80</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_81">81</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_81">81</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_82">82</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_82">82</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_83">83</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_83">83</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_84">84</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_84">84</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_85">85</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_85">85</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_86">86</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_86">86</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_87">87</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_87">87</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_88">88</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_88">88</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_89">89</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_89">89</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_90">90</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_90">90</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_91">91</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_91">91</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_92">92</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_92">92</td><td nowrap="nowrap">blockItem#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_93">93</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_93">93</td><td nowrap="nowrap">stmt#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_94">94</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_94">94</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_95">95</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_95">95</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_96">96</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_96">96</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_97">97</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_97">97</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_98">98</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_98">98</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_99">99</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_99">99</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_100">100</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_100">100</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_101">101</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_101">101</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_102">102</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_102">102</td><td nowrap="nowrap">callFunc#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_103">103</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_103">103</td><td nowrap="nowrap">mulExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_104">104</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_104">104</td><td nowrap="nowrap">addExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_105">105</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_105">105</td><td nowrap="nowrap">relExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_106">106</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_106">106</td><td nowrap="nowrap">eqExpAtom#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_107">107</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_107">107</td><td nowrap="nowrap">assignExpAtom#=&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_108">108</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_108">108</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_109">109</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_109">109</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_110">110</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_110">110</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_111">111</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_111">111</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_112">112</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_112">112</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_113">113</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_113">113</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_114">114</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_114">114</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_115">115</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_115">115</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_116">116</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_116">116</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_117">117</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_117">117</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_118">118</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_118">118</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_119">119</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_119">119</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_120">120</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_120">120</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_121">121</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_121">121</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_122">122</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_122">122</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_123">123</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_123">123</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_124">124</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_124">124</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_125">125</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_125">125</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_126">126</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_126">126</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_127">127</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_127">127</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_128">128</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_128">128</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_129">129</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_129">129</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_130">130</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_130">130</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_131">131</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_131">131</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_132">132</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_132">132</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_133">133</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_133">133</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_134">134</td><td nowrap="nowrap">callFunc#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_134">134</td><td nowrap="nowrap">callFunc#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_135">135</td><td nowrap="nowrap">mulExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_135">135</td><td nowrap="nowrap">mulExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_136">136</td><td nowrap="nowrap">addExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_136">136</td><td nowrap="nowrap">addExpAtom#+&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_137">137</td><td nowrap="nowrap">+#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_137">137</td><td nowrap="nowrap">+#+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_138">138</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_138">138</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_139">139</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_139">139</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_140">140</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_140">140</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_141">141</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_141">141</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_142">142</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_142">142</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_143">143</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_143">143</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_144">144</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_144">144</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_145">145</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_145">145</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_146">146</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_146">146</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_147">147</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_147">147</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_148">148</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_148">148</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_149">149</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to4_149">149</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_150">150</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to4_150">150</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from4_151">151</td><td nowrap="nowrap">EOF#EOF&nbsp;accept</td><td class="diff_next"></td><td class="diff_header" id="to4_151">151</td><td nowrap="nowrap">EOF#EOF&nbsp;accept<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to5__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to5__0"><a href="#difflib_chg_to5__top">t</a></td><td class="diff_header" id="from5_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to5__top">t</a></td><td class="diff_header" id="to5_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_6">6</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_6">6</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_7">7</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_7">7</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_8">8</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_8">8</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_9">9</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_9">9</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_10">10</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_10">10</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_11">11</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_11">11</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_12">12</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_12">12</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_13">13</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_13">13</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_14">14</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_14">14</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_15">15</td><td nowrap="nowrap">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_15">15</td><td nowrap="nowrap">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_16">16</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_16">16</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_17">17</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_17">17</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_18">18</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_18">18</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_19">19</td><td nowrap="nowrap">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_19">19</td><td nowrap="nowrap">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_20">20</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_20">20</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_21">21</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_21">21</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_22">22</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_22">22</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_23">23</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_23">23</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_24">24</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_24">24</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_25">25</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_25">25</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_26">26</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_26">26</td><td nowrap="nowrap">b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_27">27</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_27">27</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_28">28</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_28">28</td><td nowrap="nowrap">_c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_29">29</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_29">29</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from5_30">30</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to5_30">30</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

4
tests/07/07.txt Normal file
View File

@ -0,0 +1,4 @@
void main(){
const int a = 10, b = 5;
return b;
}

View File

@ -0,0 +1,23 @@
; ModuleID = 'sysy2022_compiler'
source_filename = "../input/../input/07_const_var_defn3.sy"
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @starttime()
declare void @stoptime()
define void @defn() {
defn_ENTRY:
ret i32 5
}

80
tests/07/07_grammar.txt Normal file
View File

@ -0,0 +1,80 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#const reduction
decl#const reduction
constDecl#const reduction
const#const move
bType#int reduction
int#int move
constDef#IDN reduction
IDN#IDN move
=#= move
constInitVal#INT reduction
constExp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#, reduction
addExpAtom#, reduction
relExpAtom#, reduction
eqExpAtom#, reduction
assignExpAtom#, reduction
argConst#, reduction
,#, move
constDef#IDN reduction
IDN#IDN move
=#= move
constInitVal#INT reduction
constExp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argConst#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

19
tests/07/07_lexical.txt Normal file
View File

@ -0,0 +1,19 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
const <KW>
int <KW>
a <IDN>
= <OP>
10 <INT>
, <SE>
b <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
b <IDN>
; <SE>
} <SE>

View File

@ -0,0 +1,80 @@
program#void reduction
compUnit#void reduction
funcDef#void reduction
funcType#void reduction
void#void move
IDN#IDN move
(#( move
funcFParams#) reduction
)#) move
block#{ reduction
{#{ move
blockItem#const reduction
decl#const reduction
constDecl#const reduction
const#const move
bType#int reduction
int#int move
constDef#IDN reduction
IDN#IDN move
=#= move
constInitVal#INT reduction
constExp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#, reduction
addExpAtom#, reduction
relExpAtom#, reduction
eqExpAtom#, reduction
assignExpAtom#, reduction
argConst#, reduction
,#, move
constDef#IDN reduction
IDN#IDN move
=#= move
constInitVal#INT reduction
constExp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
argConst#; reduction
;#; move
blockItem#return reduction
stmt#return reduction
return#return move
argExp#IDN reduction
exp#IDN reduction
assignExp#IDN reduction
eqExp#IDN reduction
relExp#IDN reduction
addExp#IDN reduction
mulExp#IDN reduction
unaryExp#IDN reduction
IDN#IDN move
callFunc#; reduction
mulExpAtom#; reduction
addExpAtom#; reduction
relExpAtom#; reduction
eqExpAtom#; reduction
assignExpAtom#; reduction
;#; move
blockItem#} reduction
}#} move
compUnit#EOF reduction
EOF#EOF accept

View File

@ -0,0 +1,19 @@
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
const <KW>
int <KW>
a <IDN>
= <OP>
10 <INT>
, <SE>
b <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
b <IDN>
; <SE>
} <SE>

129
tests/07/grammar_diff.html Normal file
View File

@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to6__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to6__0"><a href="#difflib_chg_to6__top">t</a></td><td class="diff_header" id="from6_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to6__top">t</a></td><td class="diff_header" id="to6_1">1</td><td nowrap="nowrap">program#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_2">2</td><td nowrap="nowrap">compUnit#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_3">3</td><td nowrap="nowrap">funcDef#void&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_4">4</td><td nowrap="nowrap">funcType#void&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_5">5</td><td nowrap="nowrap">void#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_6">6</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_7">7</td><td nowrap="nowrap">(#(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_8">8</td><td nowrap="nowrap">funcFParams#)&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_9">9</td><td nowrap="nowrap">)#)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_10">10</td><td nowrap="nowrap">block#{&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_11">11</td><td nowrap="nowrap">{#{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_12">12</td><td nowrap="nowrap">blockItem#const&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_12">12</td><td nowrap="nowrap">blockItem#const&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_13">13</td><td nowrap="nowrap">decl#const&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_13">13</td><td nowrap="nowrap">decl#const&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_14">14</td><td nowrap="nowrap">constDecl#const&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_14">14</td><td nowrap="nowrap">constDecl#const&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_15">15</td><td nowrap="nowrap">const#const&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_15">15</td><td nowrap="nowrap">const#const&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_16">16</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_16">16</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_17">17</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_17">17</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_18">18</td><td nowrap="nowrap">constDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_18">18</td><td nowrap="nowrap">constDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_19">19</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_19">19</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_20">20</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_20">20</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_21">21</td><td nowrap="nowrap">constInitVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_21">21</td><td nowrap="nowrap">constInitVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_22">22</td><td nowrap="nowrap">constExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_22">22</td><td nowrap="nowrap">constExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_23">23</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_23">23</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_24">24</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_24">24</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_25">25</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_25">25</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_26">26</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_26">26</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_27">27</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_27">27</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_28">28</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_28">28</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_29">29</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_29">29</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_30">30</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_30">30</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_31">31</td><td nowrap="nowrap">mulExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_31">31</td><td nowrap="nowrap">mulExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_32">32</td><td nowrap="nowrap">addExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_32">32</td><td nowrap="nowrap">addExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_33">33</td><td nowrap="nowrap">relExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_33">33</td><td nowrap="nowrap">relExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_34">34</td><td nowrap="nowrap">eqExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_34">34</td><td nowrap="nowrap">eqExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_35">35</td><td nowrap="nowrap">assignExpAtom#,&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_35">35</td><td nowrap="nowrap">assignExpAtom#,&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_36">36</td><td nowrap="nowrap">argConst#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_36">36</td><td nowrap="nowrap">argConst#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_37">37</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_37">37</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_38">38</td><td nowrap="nowrap">constDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_38">38</td><td nowrap="nowrap">constDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_39">39</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_39">39</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_40">40</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_40">40</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_41">41</td><td nowrap="nowrap">constInitVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_41">41</td><td nowrap="nowrap">constInitVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_42">42</td><td nowrap="nowrap">constExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_42">42</td><td nowrap="nowrap">constExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_43">43</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_43">43</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_44">44</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_44">44</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_45">45</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_45">45</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_46">46</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_46">46</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_47">47</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_47">47</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_48">48</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_48">48</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_49">49</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_49">49</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_50">50</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_50">50</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_51">51</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_51">51</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_52">52</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_52">52</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_53">53</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_53">53</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_54">54</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_54">54</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_55">55</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_55">55</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_56">56</td><td nowrap="nowrap">argConst#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_56">56</td><td nowrap="nowrap">argConst#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_57">57</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_57">57</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_58">58</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_58">58</td><td nowrap="nowrap">blockItem#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_59">59</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_59">59</td><td nowrap="nowrap">stmt#return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_60">60</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_60">60</td><td nowrap="nowrap">return#return&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_61">61</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_61">61</td><td nowrap="nowrap">argExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_62">62</td><td nowrap="nowrap">exp#IDN&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_62">62</td><td nowrap="nowrap">exp#IDN&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_63">63</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_63">63</td><td nowrap="nowrap">assignExp#IDN&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_64">64</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_64">64</td><td nowrap="nowrap">eqExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_65">65</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_65">65</td><td nowrap="nowrap">relExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_66">66</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_66">66</td><td nowrap="nowrap">addExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_67">67</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_67">67</td><td nowrap="nowrap">mulExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_68">68</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_68">68</td><td nowrap="nowrap">unaryExp#IDN&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_69">69</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_69">69</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_70">70</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_70">70</td><td nowrap="nowrap">callFunc#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_71">71</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_71">71</td><td nowrap="nowrap">mulExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_72">72</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_72">72</td><td nowrap="nowrap">addExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_73">73</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_73">73</td><td nowrap="nowrap">relExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_74">74</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_74">74</td><td nowrap="nowrap">eqExpAtom#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_75">75</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_75">75</td><td nowrap="nowrap">assignExpAtom#;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_76">76</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_76">76</td><td nowrap="nowrap">;#;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_77">77</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_77">77</td><td nowrap="nowrap">blockItem#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_78">78</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to6_78">78</td><td nowrap="nowrap">}#}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_79">79</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to6_79">79</td><td nowrap="nowrap">compUnit#EOF&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from6_80">80</td><td nowrap="nowrap">EOF#EOF&nbsp;accept</td><td class="diff_next"></td><td class="diff_header" id="to6_80">80</td><td nowrap="nowrap">EOF#EOF&nbsp;accept<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to7__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to7__0"><a href="#difflib_chg_to7__top">t</a></td><td class="diff_header" id="from7_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to7__top">t</a></td><td class="diff_header" id="to7_1">1</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_2">2</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_3">3</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_4">4</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_5">5</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_6">6</td><td nowrap="nowrap">const&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_6">6</td><td nowrap="nowrap">const&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_7">7</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_7">7</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_8">8</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_8">8</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_9">9</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_9">9</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_10">10</td><td nowrap="nowrap">10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_10">10</td><td nowrap="nowrap">10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_11">11</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_11">11</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_12">12</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_12">12</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_13">13</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_13">13</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_14">14</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_14">14</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_15">15</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_15">15</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_16">16</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_16">16</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_17">17</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_17">17</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_18">18</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_18">18</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from7_19">19</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to7_19">19</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,7 @@
int a = 3,= 1,c = 3;
void func(){
int a = 5;
return a + b;
}

View File

@ -0,0 +1,28 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#, reduction
addExpAtom#, reduction
relExpAtom#, reduction
eqExpAtom#, reduction
assignExpAtom#, reduction
argVarDecl#, reduction
,#, move
varDef#INT error

View File

@ -0,0 +1,26 @@
int <KW>
a <IDN>
= <OP>
3 <INT>
, <SE>
1 <INT>
, <SE>
= <OP>
3 <INT>
; <SE>
void <KW>
func <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
a <IDN>
+ <OP>
b <IDN>
; <SE>
} <SE>

View File

@ -0,0 +1,28 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#, reduction
addExpAtom#, reduction
relExpAtom#, reduction
eqExpAtom#, reduction
assignExpAtom#, reduction
argVarDecl#, reduction
,#, move
varDef#= error

View File

@ -0,0 +1,28 @@
int <KW>
a <IDN>
= <OP>
3 <INT>
, <SE>
= <OP>
1 <INT>
, <SE>
c <IDN>
= <OP>
3 <INT>
; <SE>
void <KW>
func <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
a <IDN>
= <OP>
5 <INT>
; <SE>
return <KW>
a <IDN>
+ <OP>
b <IDN>
; <SE>
} <SE>

View File

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to8__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to8__0"><a href="#difflib_chg_to8__top">t</a></td><td class="diff_header" id="from8_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to8__top">t</a></td><td class="diff_header" id="to8_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_6">6</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to8_6">6</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to8_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to8_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to8_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_21">21</td><td nowrap="nowrap">mulExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_21">21</td><td nowrap="nowrap">mulExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_22">22</td><td nowrap="nowrap">addExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_22">22</td><td nowrap="nowrap">addExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_23">23</td><td nowrap="nowrap">relExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_23">23</td><td nowrap="nowrap">relExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_24">24</td><td nowrap="nowrap">eqExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_24">24</td><td nowrap="nowrap">eqExpAtom#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_25">25</td><td nowrap="nowrap">assignExpAtom#,&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_25">25</td><td nowrap="nowrap">assignExpAtom#,&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_26">26</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to8_26">26</td><td nowrap="nowrap">argVarDecl#,&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_27">27</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to8_27">27</td><td nowrap="nowrap">,#,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from8_28">28</td><td nowrap="nowrap">varDef#<span class="diff_chg">INT</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error</td><td class="diff_next"></td><td class="diff_header" id="to8_28">28</td><td nowrap="nowrap">varDef#<span class="diff_chg">=&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to9__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to9__0"><a href="#difflib_chg_to9__top">t</a></td><td class="diff_header" id="from9_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to9__top">t</a></td><td class="diff_header" id="to9_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_4">4</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_4">4</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_5">5</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_5">5</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td><td class="diff_next"></td><td class="diff_header" id="to9_6">6</td><td nowrap="nowrap"><span class="diff_add">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt; </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_6">6</td><td nowrap="nowrap">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_7">7</td><td nowrap="nowrap">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_7">7</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_8">8</td><td nowrap="nowrap">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td><td class="diff_next"></td><td class="diff_header" id="to9_9">9</td><td nowrap="nowrap"><span class="diff_add">c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt; </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_8">8</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_10">10</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_9">9</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_11">11</td><td nowrap="nowrap">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_10">10</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_12">12</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_11">11</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_13">13</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_12">12</td><td nowrap="nowrap">func&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_14">14</td><td nowrap="nowrap">func&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_13">13</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_15">15</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_14">14</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_16">16</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_15">15</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_17">17</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_16">16</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_18">18</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_17">17</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_19">19</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_18">18</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_20">20</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_19">19</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_21">21</td><td nowrap="nowrap">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_20">20</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_22">22</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_21">21</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_23">23</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_22">22</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_24">24</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_23">23</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_25">25</td><td nowrap="nowrap">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_24">24</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_26">26</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_25">25</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_27">27</td><td nowrap="nowrap">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from9_26">26</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to9_28">28</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,6 @@
int a = 10
void main(){
int b
b = 2
return b - a
}

View File

@ -0,0 +1,26 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#void reduction
addExpAtom#void reduction
relExpAtom#void reduction
eqExpAtom#void reduction
assignExpAtom#void reduction
argVarDecl#void error

View File

@ -0,0 +1,19 @@
int <KW>
a <IDN>
= <OP>
10 <INT>
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
b <IDN>
b <IDN>
= <OP>
2 <INT>
return <KW>
b <IDN>
- <OP>
a <IDN>
} <SE>

View File

@ -0,0 +1,21 @@
program#int reduction
compUnit#int reduction
decl#int reduction
varDecl#int reduction
bType#int reduction
int#int move
varDef#IDN reduction
IDN#IDN move
argVarDef#= reduction
=#= move
initVal#INT reduction
exp#INT reduction
assignExp#INT reduction
eqExp#INT reduction
relExp#INT reduction
addExp#INT reduction
mulExp#INT reduction
unaryExp#INT reduction
number#INT reduction
INT#INT move
mulExpAtom#void error

View File

@ -0,0 +1,19 @@
int <KW>
a <IDN>
= <OP>
10 <INT>
void <KW>
main <IDN>
( <SE>
) <SE>
{ <SE>
int <KW>
b <IDN>
b <IDN>
= <OP>
2 <INT>
return <KW>
b <IDN>
- <OP>
a <IDN>
} <SE>

View File

@ -0,0 +1,75 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to10__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to10__0"><a href="#difflib_chg_to10__top">t</a></td><td class="diff_header" id="from10_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"><a href="#difflib_chg_to10__top">t</a></td><td class="diff_header" id="to10_1">1</td><td nowrap="nowrap">program#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_2">2</td><td nowrap="nowrap">compUnit#int&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_3">3</td><td nowrap="nowrap">decl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_4">4</td><td nowrap="nowrap">varDecl#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_5">5</td><td nowrap="nowrap">bType#int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_6">6</td><td nowrap="nowrap">int#int&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to10_6">6</td><td nowrap="nowrap">int#int&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_7">7</td><td nowrap="nowrap">varDef#IDN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to10_8">8</td><td nowrap="nowrap">IDN#IDN&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_9">9</td><td nowrap="nowrap">argVarDef#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to10_10">10</td><td nowrap="nowrap">=#=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_11">11</td><td nowrap="nowrap">initVal#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_12">12</td><td nowrap="nowrap">exp#INT&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_13">13</td><td nowrap="nowrap">assignExp#INT&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_14">14</td><td nowrap="nowrap">eqExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_15">15</td><td nowrap="nowrap">relExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_16">16</td><td nowrap="nowrap">addExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_17">17</td><td nowrap="nowrap">mulExp#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_18">18</td><td nowrap="nowrap">unaryExp#INT&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</td><td class="diff_next"></td><td class="diff_header" id="to10_19">19</td><td nowrap="nowrap">number#INT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move</td><td class="diff_next"></td><td class="diff_header" id="to10_20">20</td><td nowrap="nowrap">INT#INT&nbsp;move<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_21">21</td><td nowrap="nowrap">mulExpAtom#void&nbsp;r<span class="diff_chg">educti</span>o<span class="diff_chg">n</span></td><td class="diff_next"></td><td class="diff_header" id="to10_21">21</td><td nowrap="nowrap">mulExpAtom#void&nbsp;<span class="diff_add">e</span>r<span class="diff_chg">r</span>o<span class="diff_chg">r </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_22">22</td><td nowrap="nowrap"><span class="diff_sub">addExpAtom#void&nbsp;reduction</span></td><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_23">23</td><td nowrap="nowrap"><span class="diff_sub">relExpAtom#void&nbsp;reduction</span></td><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_24">24</td><td nowrap="nowrap"><span class="diff_sub">eqExpAtom#void&nbsp;&nbsp;reduction</span></td><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_25">25</td><td nowrap="nowrap"><span class="diff_sub">assignExpAtom#void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reduction</span></td><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from10_26">26</td><td nowrap="nowrap"><span class="diff_sub">argVarDecl#void&nbsp;error</span></td><td class="diff_next"></td><td class="diff_header"></td><td nowrap="nowrap"></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
table.diff {font-family:Courier; border:medium;}
.diff_header {background-color:#e0e0e0}
td.diff_header {text-align:right}
.diff_next {background-color:#c0c0c0}
.diff_add {background-color:#aaffaa}
.diff_chg {background-color:#ffff77}
.diff_sub {background-color:#ffaaaa}
</style>
</head>
<body>
<table class="diff" id="difflib_chg_to11__top"
cellspacing="0" cellpadding="0" rules="groups" >
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
<tbody>
<tr><td class="diff_next" id="difflib_chg_to11__0"><a href="#difflib_chg_to11__top">t</a></td><td class="diff_header" id="from11_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"><a href="#difflib_chg_to11__top">t</a></td><td class="diff_header" id="to11_1">1</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_2">2</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_3">3</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_4">4</td><td nowrap="nowrap">10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_4">4</td><td nowrap="nowrap">10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_5">5</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_5">5</td><td nowrap="nowrap">void&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_6">6</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_6">6</td><td nowrap="nowrap">main&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_7">7</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_7">7</td><td nowrap="nowrap">(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_8">8</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_8">8</td><td nowrap="nowrap">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_9">9</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_9">9</td><td nowrap="nowrap">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_10">10</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_10">10</td><td nowrap="nowrap">int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_11">11</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_11">11</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_12">12</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_12">12</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_13">13</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_13">13</td><td nowrap="nowrap">=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_14">14</td><td nowrap="nowrap">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_14">14</td><td nowrap="nowrap">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;INT&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_15">15</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_15">15</td><td nowrap="nowrap">return&nbsp;&nbsp;&lt;KW&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_16">16</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_16">16</td><td nowrap="nowrap">b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_17">17</td><td nowrap="nowrap">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_17">17</td><td nowrap="nowrap">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;OP&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_18">18</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_18">18</td><td nowrap="nowrap">a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDN&gt;<span class="diff_add"> </span></td></tr>
<tr><td class="diff_next"></td><td class="diff_header" id="from11_19">19</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;</td><td class="diff_next"></td><td class="diff_header" id="to11_19">19</td><td nowrap="nowrap">}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SE&gt;<span class="diff_add"> </span></td></tr>
</tbody>
</table>
<table class="diff" summary="Legends">
<tr> <th colspan="2"> Legends </th> </tr>
<tr> <td> <table border="" summary="Colors">
<tr><th> Colors </th> </tr>
<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
<tr><td class="diff_chg">Changed</td> </tr>
<tr><td class="diff_sub">Deleted</td> </tr>
</table></td>
<td> <table border="" summary="Links">
<tr><th colspan="2"> Links </th> </tr>
<tr><td>(f)irst change</td> </tr>
<tr><td>(n)ext change</td> </tr>
<tr><td>(t)op</td> </tr>
</table></td> </tr>
</table>
</body>
</html>

287
tool.cpp Normal file
View File

@ -0,0 +1,287 @@
#include "nfa.h"
InputCharType getInputCharType(char c) {
switch (c) {
case '_': return UNDERLINE;
case '+': return ADD;
case '-': return SUB;
case '*': return MUL;
case '/': return DIV;
case '%': return MOD;
case '=': return EQ;
case '>': return GT;
case '<': return LT;
case '!': return NOT;
case '&': return AND;
case '|': return OR;
case '(': return LBRACKET;
case ')': return RBRACKET;
case '{': return LCBRAC;
case '}': return RCBRAC;
case ',': return COMMA;
case ';': return SEMI;
default:
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
return LETTER;
}
else if (c >= '0' && c <= '9') {
return DIGIT;
}
else {
return EPSILON;
}
}
}
string getInputChartypeName(InputCharType type) {
switch (type)
{
case LETTER:
return "LETTER";
case UNDERLINE:
return "UNDERLINE";
case DIGIT:
return "DIGIT";
case ADD:
return "+";
case SUB:
return "-";
case MUL:
return "*";
case DIV:
return "/";
case MOD:
return "%";
case EQ:
return "=";
case GT:
return ">";
case LT:
return "<";
case NOT:
return "!";
case AND:
return "&";
case OR:
return "|";
case LBRACKET:
return "(";
case RBRACKET:
return ")";
case LCBRAC:
return "{";
case RCBRAC:
return "}";
case COMMA:
return ",";
case SEMI:
return ";";
case EPSILON:
return "EPSILON";
default:
return "UNKOWN";
}
}
string getWordTypeName(WordType type, string buffer) {
switch (type) {
case OP_ADD:
case OP_SUB:
case OP_MUL:
case OP_DIV:
case OP_MOD:
case OP_ASSIGN:
case OP_GT:
case OP_LT:
case OP_EQ:
case OP_LE:
case OP_GE:
case OP_NE:
case OP_AND:
case OP_OR:
return "OP";
case SE_LBRAC:
case SE_RBRAC:
case SE_LCBRAC:
case SE_RCBRAC:
case SE_COMMA:
case SE_SEMI:
return "SE";
case IDN:
if (!buffer.compare("int") || !buffer.compare("void") || !buffer.compare("const") || !buffer.compare("return")){
return "KW";
}
else {
return "IDN";
}
case INT_VAL:
return "INT";
default:
return "UNKNOWN";
}
}
string readfile(const string& filename)
{
// 打开文件流并读取文件内容
ifstream file(filename);
string content((istreambuf_iterator<char>(file)),
istreambuf_iterator<char>());
// 去掉换行符
//remove函数的作用是将字符串中的某个字符移动到字符串的末尾并返回一个指向该字符后面位置的指针。
//erase 函数的作用是删除字符串中指定区间内的所有字符,返回修改后的字符串
//content.erase(remove(content.begin(), content.end(), '\n'), content.end());
return content;
}
TokenType getTokenType(WordType type,string buffer) {
switch (type) {
case OP_ADD:
case OP_SUB:
case OP_MUL:
case OP_DIV:
case OP_MOD:
case OP_ASSIGN:
case OP_GT:
case OP_LT:
case OP_EQ:
case OP_LE:
case OP_GE:
case OP_NE:
case OP_AND:
case OP_OR:
return TokenType::OP;
case SE_LBRAC:
case SE_RBRAC:
case SE_LCBRAC:
case SE_RCBRAC:
case SE_COMMA:
case SE_SEMI:
return TokenType::SE;
case IDN:
if (!buffer.compare("int") || !buffer.compare("void") || !buffer.compare("const") || !buffer.compare("return")) {
return TokenType::KW;
}
else {
return TokenType::IDN;
}
case INT_VAL:
return TokenType::INT;
default:
return TokenType::UNKNOWN;
}
}
string getWordTypeName(WordType type) {
switch (type) {
case KW_INT:
return "KW_INT";
case KW_VOID:
return "KW_VOID";
case KW_RETURN:
return "KW_RETURN";
case KW_CONST:
return "KW_CONST";
case OP_ADD:
return "OP_ADD";
case OP_SUB:
return "OP_SUB";
case OP_MUL:
return "OP_MUL";
case OP_DIV:
return "OP_DIV";
case OP_MOD:
return "OP_MOD";
case OP_ASSIGN:
return "OP_ASSIGN";
case OP_GT:
return "OP_GT";
case OP_LT:
return "OP_LT";
case OP_EQ:
return "OP_EQ";
case OP_LE:
return "OP_LE";
case OP_GE:
return "OP_GE";
case OP_NE:
return "OP_NE";
case OP_AND:
return "OP_AND";
case OP_OR:
return "OP_OR";
case SE_LBRAC:
return "SE_LBRAC";
case SE_RBRAC:
return "SE_RBRAC";
case SE_LCBRAC:
return "SE_LCBRAC";
case SE_RCBRAC:
return "SE_RCBRAC";
case SE_COMMA:
return "SE_COMMA";
case SE_SEMI:
return "SE_SEMI";
case IDN:
return "IDN";
case INT_VAL:
return "INT_VAL";
default:
return "UNKNOWN";
}
}
string getGrammarName(WordType type, string buffer) {
switch (type) {
case OP_ADD: return "+";
case OP_SUB: return "-";
case OP_MUL: return "*";
case OP_DIV: return "/";
case OP_MOD: return "%";
case OP_ASSIGN: return "=";
case OP_GT: return ">";
case OP_LT: return "<";
case OP_EQ: return "==";
case OP_LE: return "<=";
case OP_GE: return ">=";
case OP_NE: return "!=";
case OP_AND: return "&&";
case OP_OR: return "||";
case SE_LBRAC: return "(";
case SE_RBRAC: return ")";
case SE_LCBRAC: return "{";
case SE_RCBRAC: return "}";
case SE_COMMA: return ",";
case SE_SEMI: return ";";
case IDN:
if (!buffer.compare("int")) {
return "int";
}
else if (!buffer.compare("void")) {
return "void";
}
else if (!buffer.compare("return")) {
return "return";
}
else if (!buffer.compare("const")) {
return "const";
}
else {
return "IDN";
}
case INT_VAL: return "INT";
default: cerr << "Token Error: "<< type << endl; exit(-1);
}
}