提交 9937caac 创建 作者: 宋海霞's avatar 宋海霞

add readme

上级 44ccba8d
没有这种文件类型的预览
digraph Automaton {
0 [label="0\n$accept -> . command $end\ncommand -> . A\nA -> . 'a'\nA -> . '(' A ')'"]
0 -> 1 [style=solid label="'a'"]
0 -> 2 [style=solid label="'('"]
0 -> 3 [style=dashed label="command"]
0 -> 4 [style=dashed label="A"]
1 [label="1\nA -> 'a' ."]
2 [label="2\nA -> . 'a'\nA -> . '(' A ')'\nA -> '(' . A ')'"]
2 -> 1 [style=solid label="'a'"]
2 -> 2 [style=solid label="'('"]
2 -> 5 [style=dashed label="A"]
3 [label="3\n$accept -> command . $end"]
3 -> 6 [style=solid label="$end"]
4 [label="4\ncommand -> A ."]
5 [label="5\nA -> '(' A . ')'"]
5 -> 7 [style=solid label="')'"]
6 [label="6\n$accept -> command $end ."]
7 [label="7\nA -> '(' A ')' ."]
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bison="http://www.gnu.org/software/bison/">
<head>
<title>sample.txt - GNU Bison XML Automaton Report</title>
<style type="text/css">
body {
font-family: "Nimbus Sans L", Arial, sans-serif;
font-size: 9pt;
}
a:link {
color: #1f00ff;
text-decoration: none;
}
a:visited {
color: #1f00ff;
text-decoration: none;
}
a:hover {
color: red;
}
#menu a {
text-decoration: underline;
}
.i {
font-style: italic;
}
.pre {
font-family: monospace;
white-space: pre;
}
ol.decimal {
list-style-type: decimal;
}
ol.lower-alpha {
list-style-type: lower-alpha;
}
.point {
color: #cc0000;
}
#footer {
margin-top: 3.5em;
font-size: 7pt;
}
</style>
</head>
<body><h1>GNU Bison XML Automaton Report</h1><p>
input grammar: <span class="i">sample.txt</span></p>
<h3>Table of Contents</h3><ul id="menu"><li><a href="#reductions">Reductions</a><ul class="lower-alpha"><li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li><li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li><li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li></ul></li><li><a href="#conflicts">Conflicts</a></li><li><a href="#grammar">Grammar</a><ul class="lower-alpha"><li><a href="#grammar">Itemset</a></li><li><a href="#terminals">Terminal symbols</a></li><li><a href="#nonterminals">Nonterminal symbols</a></li></ul></li><li><a href="#automaton">Automaton</a></li></ul><h2><a name="reductions"/> Reductions</h2><h3><a name="nonterminals_useless_in_grammar"/> Nonterminals useless in grammar</h3>
<h3><a name="terminals_unused_in_grammar"/> Terminals unused in grammar</h3>
<h3><a name="rules_useless_in_grammar"/> Rules useless in grammar</h3>
<h2><a name="conflicts"/> Conflicts</h2>
<h2><a name="grammar"/> Grammar</h2>
<p class="pre">
<a name="rule_0"/> 0 <span class="i">$accept</span><span class="i">command</span> <b>$end</b>
<a name="rule_1"/> 1 <span class="i">command</span><span class="i">A</span>
<a name="rule_2"/> 2 <span class="i">A</span><b>'a'</b>
<a name="rule_3"/> 3 | <b>'('</b> <span class="i">A</span> <b>')'</b>
</p>
<h3><a name="terminals"/> Terminals, with rules where they appear</h3>
<p class="pre"><b>$end</b> (0)
<b>'('</b> (40) <a href="#rule_3">3</a>
<b>')'</b> (41)
<b>'a'</b> (97) <a href="#rule_2">2</a>
<b>error</b> (256)
</p>
<h3><a name="nonterminals"/> Nonterminals, with rules where they appear</h3>
<p class="pre"><b>$accept</b> (6)
on left: <a href="#rule_0">0</a>
<b>command</b> (7)
on left: <a href="#rule_1">1</a>
on right: <a href="#rule_0">0</a>
<b>A</b> (8)
on left: <a href="#rule_2">2</a> <a href="#rule_3">3</a>
on right: <a href="#rule_1">1</a>
</p><h2><a name="automaton"/> Automaton</h2>
<h3><a name="state_0"/>state 0</h3>
<p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span><span class="point">.</span> <span class="i">command</span> <b>$end</b>
<a href="#rule_1"> 1</a> <span class="i">command</span><span class="point">.</span> <span class="i">A</span>
<a href="#rule_2"> 2</a> <span class="i">A</span><span class="point">.</span> <b>'a'</b>
<a href="#rule_3"> 3</a> | <span class="point">.</span> <b>'('</b> <span class="i">A</span> <b>')'</b>
'a' <a href="#state_1">shift, and go to state 1</a>
'(' <a href="#state_2">shift, and go to state 2</a>
command <a href="#state_3">go to state 3</a>
A <a href="#state_4">go to state 4</a>
</p>
<h3><a name="state_1"/>state 1</h3>
<p class="pre"> <a href="#rule_2"> 2</a> <span class="i">A</span><b>'a'</b> <span class="point">.</span>
$default <a href="#rule_2">reduce using rule 2</a> (A)
</p>
<h3><a name="state_2"/>state 2</h3>
<p class="pre"> <a href="#rule_2"> 2</a> <span class="i">A</span><span class="point">.</span> <b>'a'</b>
<a href="#rule_3"> 3</a> | <span class="point">.</span> <b>'('</b> <span class="i">A</span> <b>')'</b>
<a href="#rule_3"> 3</a> | <b>'('</b> <span class="point">.</span> <span class="i">A</span> <b>')'</b>
'a' <a href="#state_1">shift, and go to state 1</a>
'(' <a href="#state_2">shift, and go to state 2</a>
A <a href="#state_5">go to state 5</a>
</p>
<h3><a name="state_3"/>state 3</h3>
<p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span><span class="i">command</span> <span class="point">.</span> <b>$end</b>
$end <a href="#state_6">shift, and go to state 6</a>
</p>
<h3><a name="state_4"/>state 4</h3>
<p class="pre"> <a href="#rule_1"> 1</a> <span class="i">command</span><span class="i">A</span> <span class="point">.</span>
$default <a href="#rule_1">reduce using rule 1</a> (command)
</p>
<h3><a name="state_5"/>state 5</h3>
<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">A</span><b>'('</b> <span class="i">A</span> <span class="point">.</span> <b>')'</b>
')' <a href="#state_7">shift, and go to state 7</a>
</p>
<h3><a name="state_6"/>state 6</h3>
<p class="pre"> <a href="#rule_0"> 0</a> <span class="i">$accept</span><span class="i">command</span> <b>$end</b> <span class="point">.</span>
$default accept
</p>
<h3><a name="state_7"/>state 7</h3>
<p class="pre"> <a href="#rule_3"> 3</a> <span class="i">A</span><b>'('</b> <span class="i">A</span> <b>')'</b> <span class="point">.</span>
$default <a href="#rule_3">reduce using rule 3</a> (A)
</p>
<div id="footer"><hr/>This document was generated using
<a href="http://www.gnu.org/software/bison/" title="GNU Bison">
GNU Bison 2.4.1</a>
XML Automaton Report.<br/>
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>
</html>
Grammar
0 $accept: command $end
1 command: A
2 A: 'a'
3 | '(' A ')'
Terminals, with rules where they appear
$end (0) 0
'(' (40) 3
')' (41) 3
'a' (97) 2
error (256)
Nonterminals, with rules where they appear
$accept (6)
on left: 0
command (7)
on left: 1, on right: 0
A (8)
on left: 2 3, on right: 1 3
state 0
0 $accept: . command $end
1 command: . A
2 A: . 'a'
3 | . '(' A ')'
'a' shift, and go to state 1
'(' shift, and go to state 2
command go to state 3
A go to state 4
state 1
2 A: 'a' .
$default reduce using rule 2 (A)
state 2
2 A: . 'a'
3 | . '(' A ')'
3 | '(' . A ')'
'a' shift, and go to state 1
'(' shift, and go to state 2
A go to state 5
state 3
0 $accept: command . $end
$end shift, and go to state 6
state 4
1 command: A .
$default reduce using rule 1 (command)
state 5
3 A: '(' A . ')'
')' shift, and go to state 7
state 6
0 $accept: command $end .
$default accept
state 7
3 A: '(' A ')' .
$default reduce using rule 3 (A)
<?xml version="1.0"?>
<bison-xml-report version="2.4.1">
<filename>sample.txt</filename>
<grammar>
<rules>
<rule number="0" usefulness="useful">
<lhs>$accept</lhs>
<rhs>
<symbol>command</symbol>
<symbol>$end</symbol>
</rhs>
</rule>
<rule number="1" usefulness="useful">
<lhs>command</lhs>
<rhs>
<symbol>A</symbol>
</rhs>
</rule>
<rule number="2" usefulness="useful">
<lhs>A</lhs>
<rhs>
<symbol>'a'</symbol>
</rhs>
</rule>
<rule number="3" usefulness="useful">
<lhs>A</lhs>
<rhs>
<symbol>'('</symbol>
<symbol>A</symbol>
<symbol>')'</symbol>
</rhs>
</rule>
</rules>
<terminals>
<terminal symbol-number="0" token-number="0" name="$end" usefulness="useful"/>
<terminal symbol-number="4" token-number="40" name="'('" usefulness="useful"/>
<terminal symbol-number="5" token-number="41" name="')'" usefulness="useful"/>
<terminal symbol-number="3" token-number="97" name="'a'" usefulness="useful"/>
<terminal symbol-number="1" token-number="256" name="error" usefulness="useful"/>
</terminals>
<nonterminals>
<nonterminal symbol-number="6" name="$accept" usefulness="useful"/>
<nonterminal symbol-number="7" name="command" usefulness="useful"/>
<nonterminal symbol-number="8" name="A" usefulness="useful"/>
</nonterminals>
</grammar>
<automaton>
<state number="0">
<itemset>
<item rule-number="0" point="0"/>
<item rule-number="1" point="0"/>
<item rule-number="2" point="0"/>
<item rule-number="3" point="0"/>
</itemset>
<actions>
<transitions>
<transition type="shift" symbol="'a'" state="1"/>
<transition type="shift" symbol="'('" state="2"/>
<transition type="goto" symbol="command" state="3"/>
<transition type="goto" symbol="A" state="4"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number="1">
<itemset>
<item rule-number="2" point="1"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol="$default" rule="2" enabled="true"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number="2">
<itemset>
<item rule-number="2" point="0"/>
<item rule-number="3" point="0"/>
<item rule-number="3" point="1"/>
</itemset>
<actions>
<transitions>
<transition type="shift" symbol="'a'" state="1"/>
<transition type="shift" symbol="'('" state="2"/>
<transition type="goto" symbol="A" state="5"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number="3">
<itemset>
<item rule-number="0" point="1"/>
</itemset>
<actions>
<transitions>
<transition type="shift" symbol="$end" state="6"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number="4">
<itemset>
<item rule-number="1" point="1"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol="$default" rule="1" enabled="true"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number="5">
<itemset>
<item rule-number="3" point="2"/>
</itemset>
<actions>
<transitions>
<transition type="shift" symbol="')'" state="7"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number="6">
<itemset>
<item rule-number="0" point="2"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol="$default" rule="accept" enabled="true"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number="7">
<itemset>
<item rule-number="3" point="3"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol="$default" rule="3" enabled="true"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
</automaton>
</bison-xml-report>
差异被折叠。
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论