dhaka 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/Rakefile +2 -2
  2. data/lib/dhaka.rb +3 -1
  3. data/lib/{dot → dhaka/dot}/dot.rb +0 -0
  4. data/lib/{evaluator → dhaka/evaluator}/evaluator.rb +0 -0
  5. data/lib/{grammar → dhaka/grammar}/closure_hash.rb +0 -0
  6. data/lib/{grammar → dhaka/grammar}/grammar.rb +0 -0
  7. data/lib/{grammar → dhaka/grammar}/grammar_symbol.rb +0 -0
  8. data/lib/{grammar → dhaka/grammar}/precedence.rb +0 -0
  9. data/lib/{grammar → dhaka/grammar}/production.rb +0 -0
  10. data/lib/dhaka/lexer/accept_actions.rb +36 -0
  11. data/lib/dhaka/lexer/alphabet.rb +21 -0
  12. data/lib/dhaka/lexer/alphabet.rb~ +5 -0
  13. data/lib/{lexer → dhaka/lexer}/compiled_lexer.rb +0 -0
  14. data/lib/{lexer → dhaka/lexer}/dfa.rb +0 -0
  15. data/lib/{lexer → dhaka/lexer}/lexeme.rb +0 -0
  16. data/lib/{lexer → dhaka/lexer}/lexer.rb +0 -0
  17. data/lib/{lexer → dhaka/lexer}/lexer_run.rb +0 -0
  18. data/lib/{lexer → dhaka/lexer}/regex_grammar.rb +0 -50
  19. data/lib/dhaka/lexer/regex_parser.rb +2010 -0
  20. data/lib/{lexer → dhaka/lexer}/regex_tokenizer.rb +0 -0
  21. data/lib/{lexer → dhaka/lexer}/specification.rb +3 -2
  22. data/lib/{lexer → dhaka/lexer}/state.rb +0 -0
  23. data/lib/{lexer → dhaka/lexer}/state_machine.rb +0 -0
  24. data/lib/{parser → dhaka/parser}/action.rb +0 -0
  25. data/lib/{parser → dhaka/parser}/channel.rb +0 -0
  26. data/lib/{parser → dhaka/parser}/compiled_parser.rb +0 -0
  27. data/lib/{parser → dhaka/parser}/conflict.rb +0 -0
  28. data/lib/{parser → dhaka/parser}/item.rb +0 -0
  29. data/lib/{parser → dhaka/parser}/parse_result.rb +7 -3
  30. data/lib/{parser → dhaka/parser}/parse_tree.rb +0 -0
  31. data/lib/{parser → dhaka/parser}/parser.rb +0 -0
  32. data/lib/{parser → dhaka/parser}/parser_methods.rb +0 -0
  33. data/lib/{parser → dhaka/parser}/parser_run.rb +1 -1
  34. data/lib/{parser → dhaka/parser}/parser_state.rb +0 -0
  35. data/lib/{parser → dhaka/parser}/token.rb +0 -0
  36. data/lib/dhaka/runtime.rb +51 -0
  37. data/lib/dhaka/runtime.rb~ +49 -0
  38. data/lib/{tokenizer → dhaka/tokenizer}/tokenizer.rb +8 -3
  39. data/test/brackets/bracket_tokenizer.rb +7 -0
  40. data/test/brackets/brackets_test.rb +9 -0
  41. data/test/chittagong/chittagong_lexer.rb +63 -63
  42. data/test/chittagong/chittagong_parser.rb +660 -660
  43. data/test/core/another_lalr_but_not_slr_grammar.rb.rej +13 -0
  44. metadata +73 -69
  45. data/lib/lexer/regex_parser.rb +0 -2010
  46. data/test/chittagong/chittagong_lexer.rb.rej +0 -189
  47. data/test/chittagong/chittagong_parser.rb.rej +0 -1623
@@ -39,7 +39,8 @@ module Dhaka
39
39
  # * All quantifiers are greedy. There is as yet no support for non-greedy modifiers.
40
40
  # * The lookahead operator "/" can behave in counter-intuitive ways in situations where the pre-lookahead-operator expression and the
41
41
  # post-lookahead-operator expression have characters in common. For example the expression "(ab)+/abcd", when applied to the input
42
- # "abababcd" will yield "ababab" as the match instead of "abab". A good thumb rule is that the pre-lookahead expression is greedy.
42
+ # "abababcd" will yield "ababab" as the match instead of "abab". A good thumb rule is that the pre-lookahead expression is greedy.
43
+ # * There is no support for characters beyond those specified in the grammar above. This means that there is no support for extended ASCII or unicode characters.
43
44
 
44
45
 
45
46
  class LexerSpecification
@@ -92,4 +93,4 @@ module Dhaka
92
93
  end
93
94
  end
94
95
  end
95
-
96
+
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -27,17 +27,21 @@ module Dhaka
27
27
 
28
28
  # Returned on unsuccessful parsing of the input token stream.
29
29
  class ParseErrorResult
30
- # The token that caused the parse error.
31
- attr_reader :unexpected_token
30
+ attr_reader :unexpected_token, :parser_state
32
31
 
33
- def initialize(unexpected_token) #:nodoc:
32
+ def initialize(unexpected_token, parser_state) #:nodoc:
34
33
  @unexpected_token = unexpected_token
34
+ @parser_state = parser_state
35
35
  end
36
36
 
37
37
  # This is true.
38
38
  def has_error?
39
39
  true
40
40
  end
41
+
42
+ def inspect #:nodoc:
43
+ "<Dhaka::ParseErrorResult unexpected_token=#{unexpected_token.inspect}>"
44
+ end
41
45
  end
42
46
  end
43
47
 
File without changes
@@ -29,7 +29,7 @@ module Dhaka
29
29
  def execute_actions
30
30
  while symbol_name = @symbol_queue.pop
31
31
  action = state_stack.last.actions[symbol_name]
32
- return ParseErrorResult.new(@current_token) unless action
32
+ return ParseErrorResult.new(@current_token, state_stack.last) unless action
33
33
  instance_eval(&action.action_code)
34
34
  end
35
35
  nil
File without changes
@@ -0,0 +1,51 @@
1
+ #--
2
+ # Copyright (c) 2006, 2007 Mushfeq Khan
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'set'
25
+ require 'logger'
26
+ require 'delegate'
27
+
28
+ %w[
29
+ grammar/grammar_symbol
30
+ grammar/production
31
+ grammar/grammar
32
+ grammar/precedence
33
+ parser/parse_tree
34
+ parser/parse_result
35
+ parser/parser_methods
36
+ parser/parser_state
37
+ parser/token
38
+ parser/action
39
+ parser/parser_run
40
+ parser/compiled_parser
41
+ tokenizer/tokenizer
42
+ evaluator/evaluator
43
+ lexer/accept_actions
44
+ lexer/alphabet
45
+ lexer/state_machine
46
+ lexer/state
47
+ lexer/specification
48
+ lexer/lexeme
49
+ lexer/lexer_run
50
+ lexer/compiled_lexer
51
+ ].each {|path| require File.join(File.dirname(__FILE__), path)}
@@ -0,0 +1,49 @@
1
+ #--
2
+ # Copyright (c) 2006, 2007 Mushfeq Khan
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'set'
25
+ require 'logger'
26
+ require 'delegate'
27
+
28
+ %w[
29
+ grammar/grammar_symbol
30
+ grammar/production
31
+ grammar/grammar
32
+ grammar/precedence
33
+ parser/parse_tree
34
+ parser/parse_result
35
+ parser/parser_methods
36
+ parser/parser_state
37
+ parser/token
38
+ parser/action
39
+ parser/parser_run
40
+ parser/compiled_parser
41
+ tokenizer/tokenizer
42
+ evaluator/evaluator
43
+ lexer/state_machine
44
+ lexer/state
45
+ lexer/specification
46
+ lexer/lexeme
47
+ lexer/lexer_run
48
+ lexer/compiled_lexer
49
+ ].each {|path| require File.join(File.dirname(__FILE__), path)}
@@ -39,7 +39,7 @@ module Dhaka
39
39
  # A tokenizer state encapsulates actions that should be performed upon
40
40
  # encountering each permissible character for that state.
41
41
  class TokenizerState
42
- attr_reader :actions
42
+ attr_reader :actions, :default_action
43
43
 
44
44
  def initialize
45
45
  @actions = {}
@@ -53,6 +53,11 @@ module Dhaka
53
53
  end
54
54
 
55
55
  alias for_character for_characters
56
+
57
+ # define the action (+blk+) to be performed for any +characters+ that don't have an action to perform.
58
+ def for_default(&blk)
59
+ @default_action = blk
60
+ end
56
61
 
57
62
  def to_s #:nodoc:
58
63
  actions.inspect
@@ -174,7 +179,7 @@ module Dhaka
174
179
 
175
180
  def run #:nodoc:
176
181
  while curr_char
177
- blk = @current_state.actions[curr_char]
182
+ blk = @current_state.actions[curr_char] || @current_state.default_action
178
183
  return TokenizerErrorResult.new(@curr_char_index) unless blk
179
184
  instance_eval(&blk)
180
185
  end
@@ -182,4 +187,4 @@ module Dhaka
182
187
  TokenizerSuccessResult.new(tokens)
183
188
  end
184
189
  end
185
- end
190
+ end
@@ -13,3 +13,10 @@ class BracketTokenizer < Dhaka::Tokenizer
13
13
 
14
14
  end
15
15
 
16
+ class LazyBracketTokenizer < BracketTokenizer
17
+ for_state Dhaka::TOKENIZER_IDLE_STATE do
18
+ for_default do
19
+ advance
20
+ end
21
+ end
22
+ end
@@ -12,6 +12,15 @@ class TestBracketGrammar < Test::Unit::TestCase
12
12
  assert !correct("B")
13
13
  assert !correct("[[B]{(B)}}(B)]")
14
14
  end
15
+
16
+ def test_ignores_invalid_characters_with_default_action
17
+ tokens = BracketTokenizer.tokenize("A{(B)[B]}")
18
+ assert tokens.has_error?
19
+
20
+ tokens = LazyBracketTokenizer.tokenize("A{(B)[B]}")
21
+ assert !tokens.has_error?
22
+ end
23
+
15
24
  def correct input_string
16
25
  result = BracketParser.parse(BracketTokenizer.tokenize(input_string))
17
26
  !result.has_error?
@@ -2,108 +2,108 @@ class ChittagongLexer < Dhaka::CompiledLexer
2
2
 
3
3
  self.specification = ChittagongLexerSpecification
4
4
 
5
- start_with 21969380
5
+ start_with 23993520499080
6
6
 
7
- at_state(21968700) {
8
- accept("\n")
9
- }
10
-
11
- at_state(21958430) {
12
- accept("-")
7
+ at_state(23993520490540) {
8
+ accept(">")
13
9
  }
14
10
 
15
- at_state(21967500) {
16
- accept("<")
11
+ at_state(23993520496080) {
12
+ accept("\\d*(\\.\\d+)?")
13
+ for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 23993520496080 }
17
14
  }
18
15
 
19
- at_state(21957330) {
20
- accept("\\(")
16
+ at_state(23993520497360) {
17
+ accept("\\d*(\\.\\d+)?")
18
+ for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 23993520497360 }
19
+ for_characters(".") { switch_to 23993520496640 }
21
20
  }
22
21
 
23
- at_state(21957550) {
24
- accept("\\/")
22
+ at_state(23993520499080) {
23
+ accept("\\d*(\\.\\d+)?")
24
+ for_characters("\n") { switch_to 23993520492400 }
25
+ for_characters("*") { switch_to 23993520491960 }
26
+ for_characters("!") { switch_to 23993520479360 }
27
+ for_characters(" ") { switch_to 23993520478920 }
28
+ for_characters("/") { switch_to 23993520479800 }
29
+ for_characters("-") { switch_to 23993520477160 }
30
+ for_characters(",") { switch_to 23993520477600 }
31
+ for_characters("+") { switch_to 23993520480240 }
32
+ for_characters(")") { switch_to 23993520478040 }
33
+ for_characters("^") { switch_to 23993520478480 }
34
+ for_characters("J", "o", "p", "K", "q", "L", "r", "M", "s", "N", "t", "O", "a", "u", "P", "b", "Q", "c", "v", "R", "d", "w", "S", "e", "x", "T", "f", "y", "A", "U", "g", "z", "B", "h", "C", "V", "i", "D", "W", "j", "E", "X", "F", "Y", "k", "G", "Z", "l", "H", "m", "I", "n") { switch_to 23993520490080 }
35
+ for_characters("=") { switch_to 23993520491540 }
36
+ for_characters(">") { switch_to 23993520490540 }
37
+ for_characters("<") { switch_to 23993520497800 }
38
+ for_characters("(") { switch_to 23993520498240 }
39
+ for_characters("8", "9", "0", "1", "2", "3", "4", "5", "6", "7") { switch_to 23993520497360 }
40
+ for_characters(".") { switch_to 23993520496640 }
41
+ }
42
+
43
+ at_state(23993520478480) {
44
+ accept("\\^")
25
45
  }
26
46
 
27
- at_state(21967250) {
28
- accept("\\*")
47
+ at_state(23993520492400) {
48
+ accept("\n")
29
49
  }
30
50
 
31
- at_state(21968360) {
32
- accept("=")
33
- for_characters("=") { switch_to 21968040 }
51
+ at_state(23993520496640) {
52
+ for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 23993520496080 }
34
53
  }
35
54
 
36
- at_state(21969380) {
37
- accept("\\d*(\\.\\d+)?")
38
- for_characters("<") { switch_to 21967500 }
39
- for_characters(")") { switch_to 21961890 }
40
- for_characters(" ") { switch_to 21967770 }
41
- for_characters("\n") { switch_to 21968700 }
42
- for_characters("=") { switch_to 21968360 }
43
- for_characters("8", "9", "0", "1", "2", "3", "4", "5", "6", "7") { switch_to 21961100 }
44
- for_characters("J", "o", "p", "K", "q", "L", "r", "M", "s", "N", "t", "O", "a", "u", "P", "b", "Q", "c", "v", "R", "d", "w", "S", "e", "x", "T", "f", "y", "A", "U", "g", "z", "B", "h", "C", "V", "i", "D", "W", "j", "E", "X", "F", "Y", "k", "G", "Z", "l", "H", "m", "I", "n") { switch_to 21966980 }
45
- for_characters("*") { switch_to 21967250 }
46
- for_characters(",") { switch_to 21961360 }
47
- for_characters("!") { switch_to 21958210 }
48
- for_characters("/") { switch_to 21957550 }
49
- for_characters(".") { switch_to 21960630 }
50
- for_characters("-") { switch_to 21958430 }
51
- for_characters(">") { switch_to 21961620 }
52
- for_characters("+") { switch_to 21957990 }
53
- for_characters("(") { switch_to 21957330 }
54
- for_characters("^") { switch_to 21957770 }
55
- }
56
-
57
- at_state(21961360) {
55
+ at_state(23993520477600) {
58
56
  accept(",")
59
57
  }
60
58
 
61
- at_state(21961890) {
59
+ at_state(23993520478040) {
62
60
  accept("\\)")
63
61
  }
64
62
 
65
- at_state(21966980) {
66
- accept("\\w+")
67
- for_characters("v", "K", "V", "k", "L", "W", "w", "l", "A", "a", "B", "X", "x", "b", "M", "m", "C", "c", "n", "y", "N", "Y", "d", "o", "z", "O", "Z", "D", "e", "p", "E", "P", "f", "q", "F", "Q", "R", "g", "r", "G", "h", "s", "H", "S", "t", "I", "T", "i", "U", "j", "u", "J") { switch_to 21966980 }
63
+ at_state(23993520491540) {
64
+ accept("=")
65
+ for_characters("=") { switch_to 23993520490980 }
68
66
  }
69
67
 
70
- at_state(21957990) {
71
- accept("\\+")
68
+ at_state(23993520491960) {
69
+ accept("\\*")
72
70
  }
73
71
 
74
- at_state(21960630) {
75
- for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 21960320 }
72
+ at_state(23993520497800) {
73
+ accept("<")
76
74
  }
77
75
 
78
- at_state(21961620) {
79
- accept(">")
76
+ at_state(23993520498240) {
77
+ accept("\\(")
80
78
  }
81
79
 
82
- at_state(21967770) {
83
- accept(" ")
80
+ at_state(23993520479800) {
81
+ accept("\\/")
84
82
  }
85
83
 
86
- at_state(21968040) {
84
+ at_state(23993520490980) {
87
85
  accept("==")
88
86
  }
89
87
 
90
- at_state(21960320) {
91
- accept("\\d*(\\.\\d+)?")
92
- for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 21960320 }
88
+ at_state(23993520478920) {
89
+ accept(" ")
93
90
  }
94
91
 
95
- at_state(21957770) {
96
- accept("\\^")
92
+ at_state(23993520477160) {
93
+ accept("-")
97
94
  }
98
95
 
99
- at_state(21958210) {
96
+ at_state(23993520479360) {
100
97
  accept("!")
101
98
  }
102
99
 
103
- at_state(21961100) {
104
- accept("\\d*(\\.\\d+)?")
105
- for_characters("6", "7", "8", "9", "0", "1", "2", "3", "4", "5") { switch_to 21961100 }
106
- for_characters(".") { switch_to 21960630 }
100
+ at_state(23993520480240) {
101
+ accept("\\+")
102
+ }
103
+
104
+ at_state(23993520490080) {
105
+ accept("\\w+")
106
+ for_characters("k", "v", "V", "K", "A", "w", "l", "a", "W", "L", "b", "m", "M", "x", "B", "X", "Y", "c", "y", "n", "N", "C", "D", "o", "d", "z", "Z", "O", "P", "e", "E", "p", "Q", "q", "f", "F", "G", "g", "r", "R", "S", "H", "s", "h", "t", "T", "I", "i", "J", "j", "u", "U") { switch_to 23993520490080 }
107
107
  }
108
108
 
109
109
  end
@@ -4,876 +4,876 @@ class ChittagongParser < Dhaka::CompiledParser
4
4
 
5
5
  start_with 0
6
6
 
7
- at_state(105) {
8
- for_symbols("_End_") { reduce_with "program" }
7
+ at_state(91) {
8
+ for_symbols("newline") { shift_to 1 }
9
+ for_symbols("^") { shift_to 14 }
10
+ for_symbols("<") { shift_to 24 }
11
+ for_symbols("terms") { shift_to 92 }
12
+ for_symbols("+") { shift_to 22 }
13
+ for_symbols("-") { shift_to 26 }
14
+ for_symbols("/") { shift_to 20 }
15
+ for_symbols("*") { shift_to 16 }
16
+ for_symbols(">") { shift_to 12 }
17
+ for_symbols("==") { shift_to 18 }
9
18
  }
10
19
 
11
- at_state(67) {
12
- for_symbols("else") { shift_to 69 }
13
- for_symbols("end") { shift_to 68 }
14
- for_symbols("while") { shift_to 75 }
15
- for_symbols("if") { shift_to 52 }
16
- for_symbols("newline") { shift_to 2 }
17
- for_symbols("var_name") { shift_to 61 }
18
- for_symbols("print") { shift_to 5 }
19
- for_symbols("word_literal") { shift_to 30 }
20
- for_symbols("return") { shift_to 59 }
21
- for_symbols("function_name") { shift_to 55 }
22
- for_symbols("simple_statement") { shift_to 64 }
23
- for_symbols("function_body_statement") { shift_to 74 }
20
+ at_state(83) {
21
+ for_symbols("while") { shift_to 68 }
22
+ for_symbols("newline") { shift_to 51 }
23
+ for_symbols("return") { shift_to 86 }
24
+ for_symbols("if") { shift_to 74 }
25
+ for_symbols("simple_statement") { shift_to 85 }
26
+ for_symbols("var_name") { shift_to 44 }
27
+ for_symbols("word_literal") { shift_to 4 }
28
+ for_symbols("function_body_statement") { shift_to 66 }
29
+ for_symbols("function_name") { shift_to 40 }
30
+ for_symbols("print") { shift_to 88 }
31
+ for_symbols("end") { shift_to 84 }
24
32
  }
25
33
 
26
- at_state(54) {
27
- for_symbols("while") { shift_to 75 }
28
- for_symbols("if") { shift_to 52 }
29
- for_symbols("newline") { shift_to 2 }
30
- for_symbols("var_name") { shift_to 61 }
31
- for_symbols("print") { shift_to 5 }
32
- for_symbols("word_literal") { shift_to 30 }
33
- for_symbols("function_body") { shift_to 66 }
34
- for_symbols("return") { shift_to 59 }
35
- for_symbols("function_name") { shift_to 55 }
36
- for_symbols("simple_statement") { shift_to 64 }
37
- for_symbols("function_body_statement") { shift_to 65 }
34
+ at_state(72) {
35
+ for_symbols("while") { shift_to 68 }
36
+ for_symbols("newline") { shift_to 51 }
37
+ for_symbols("return") { shift_to 86 }
38
+ for_symbols("if") { shift_to 74 }
39
+ for_symbols("simple_statement") { shift_to 85 }
40
+ for_symbols("var_name") { shift_to 44 }
41
+ for_symbols("end") { shift_to 73 }
42
+ for_symbols("word_literal") { shift_to 4 }
43
+ for_symbols("function_body_statement") { shift_to 66 }
44
+ for_symbols("function_name") { shift_to 40 }
45
+ for_symbols("print") { shift_to 88 }
38
46
  }
39
47
 
40
- at_state(55) {
41
- for_symbols("(") { shift_to 56 }
48
+ at_state(68) {
49
+ for_symbols("(") { shift_to 6 }
50
+ for_symbols("numeric_literal") { shift_to 29 }
51
+ for_symbols("word_literal") { shift_to 4 }
52
+ for_symbols("function_name") { shift_to 7 }
53
+ for_symbols("expression") { shift_to 69 }
54
+ for_symbols("var_name") { shift_to 28 }
55
+ for_symbols("-") { shift_to 32 }
56
+ for_symbols("!") { shift_to 30 }
42
57
  }
43
58
 
44
- at_state(8) {
45
- for_symbols("(") { shift_to 9 }
59
+ at_state(49) {
60
+ for_symbols("_End_", "newline") { reduce_with "main_body_while_statement" }
46
61
  }
47
62
 
48
- at_state(40) {
49
- for_symbols("-") { shift_to 7 }
50
- for_symbols("!") { shift_to 34 }
51
- for_symbols("numeric_literal") { shift_to 6 }
52
- for_symbols("(") { shift_to 31 }
53
- for_symbols("word_literal") { shift_to 30 }
54
- for_symbols("var_name") { shift_to 29 }
55
- for_symbols("function_name") { shift_to 8 }
56
- for_symbols("expression") { shift_to 41 }
63
+ at_state(6) {
64
+ for_symbols("(") { shift_to 6 }
65
+ for_symbols("numeric_literal") { shift_to 29 }
66
+ for_symbols("word_literal") { shift_to 4 }
67
+ for_symbols("function_name") { shift_to 7 }
68
+ for_symbols("expression") { shift_to 36 }
69
+ for_symbols("var_name") { shift_to 28 }
70
+ for_symbols("-") { shift_to 32 }
71
+ for_symbols("!") { shift_to 30 }
57
72
  }
58
73
 
59
- at_state(12) {
60
- for_symbols("==") { shift_to 27 }
61
- for_symbols("*") { shift_to 15 }
62
- for_symbols(",", ")") { reduce_with "multiple_args" }
63
- for_symbols("<") { shift_to 25 }
64
- for_symbols("/") { shift_to 13 }
65
- for_symbols(">") { shift_to 23 }
66
- for_symbols("^") { shift_to 19 }
67
- for_symbols("+") { shift_to 21 }
68
- for_symbols("-") { shift_to 17 }
74
+ at_state(15) {
75
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "power" }
69
76
  }
70
77
 
71
- at_state(99) {
72
- for_symbols("while") { shift_to 88 }
73
- for_symbols("newline") { shift_to 2 }
74
- for_symbols("var_name") { shift_to 61 }
75
- for_symbols("print") { shift_to 5 }
76
- for_symbols("main_body") { shift_to 100 }
77
- for_symbols("word_literal") { shift_to 30 }
78
- for_symbols("if") { shift_to 40 }
79
- for_symbols("main_body_statement") { shift_to 87 }
80
- for_symbols("def") { shift_to 43 }
81
- for_symbols("function_name") { shift_to 55 }
82
- for_symbols("simple_statement") { shift_to 86 }
78
+ at_state(100) {
79
+ for_symbols("newline") { shift_to 51 }
80
+ for_symbols("var_name") { shift_to 44 }
81
+ for_symbols("def") { shift_to 52 }
82
+ for_symbols("word_literal") { shift_to 4 }
83
+ for_symbols("simple_statement") { shift_to 96 }
84
+ for_symbols("function_name") { shift_to 40 }
85
+ for_symbols("while") { shift_to 5 }
86
+ for_symbols("if") { shift_to 90 }
87
+ for_symbols("print") { shift_to 88 }
88
+ for_symbols("main_body_statement") { shift_to 50 }
89
+ for_symbols("end") { shift_to 101 }
83
90
  }
84
91
 
85
- at_state(75) {
86
- for_symbols("-") { shift_to 7 }
87
- for_symbols("!") { shift_to 34 }
88
- for_symbols("numeric_literal") { shift_to 6 }
89
- for_symbols("(") { shift_to 31 }
90
- for_symbols("expression") { shift_to 76 }
91
- for_symbols("word_literal") { shift_to 30 }
92
- for_symbols("var_name") { shift_to 29 }
93
- for_symbols("function_name") { shift_to 8 }
92
+ at_state(97) {
93
+ for_symbols("newline") { shift_to 1 }
94
+ for_symbols("terms") { shift_to 98 }
94
95
  }
95
96
 
96
- at_state(31) {
97
- for_symbols("-") { shift_to 7 }
98
- for_symbols("!") { shift_to 34 }
99
- for_symbols("numeric_literal") { shift_to 6 }
100
- for_symbols("(") { shift_to 31 }
101
- for_symbols("expression") { shift_to 32 }
102
- for_symbols("word_literal") { shift_to 30 }
103
- for_symbols("var_name") { shift_to 29 }
104
- for_symbols("function_name") { shift_to 8 }
97
+ at_state(53) {
98
+ for_symbols("(") { reduce_with "function_name" }
105
99
  }
106
100
 
107
- at_state(26) {
108
- for_symbols("*") { shift_to 15 }
109
- for_symbols("/") { shift_to 13 }
110
- for_symbols("==", ",", "_End_", "newline", ")") { reduce_with "less_than_comparison" }
111
- for_symbols("^") { shift_to 19 }
112
- for_symbols("+") { shift_to 21 }
113
- for_symbols("-") { shift_to 17 }
101
+ at_state(52) {
102
+ for_symbols("function_name") { shift_to 54 }
103
+ for_symbols("word_literal") { shift_to 53 }
114
104
  }
115
105
 
116
- at_state(43) {
117
- for_symbols("word_literal") { shift_to 85 }
118
- for_symbols("function_name") { shift_to 44 }
106
+ at_state(104) {
107
+ for_symbols("newline") { shift_to 51 }
108
+ for_symbols("var_name") { shift_to 44 }
109
+ for_symbols("def") { shift_to 52 }
110
+ for_symbols("word_literal") { shift_to 4 }
111
+ for_symbols("simple_statement") { shift_to 96 }
112
+ for_symbols("function_name") { shift_to 40 }
113
+ for_symbols("while") { shift_to 5 }
114
+ for_symbols("if") { shift_to 90 }
115
+ for_symbols("print") { shift_to 88 }
116
+ for_symbols("_End_") { reduce_with "some_terms" }
117
+ for_symbols("main_body_statement") { shift_to 50 }
119
118
  }
120
119
 
121
- at_state(28) {
122
- for_symbols("*") { shift_to 15 }
123
- for_symbols(",", "_End_", "newline", ")") { reduce_with "equality_comparison" }
124
- for_symbols("<") { shift_to 25 }
125
- for_symbols("/") { shift_to 13 }
126
- for_symbols(">") { shift_to 23 }
127
- for_symbols("^") { shift_to 19 }
128
- for_symbols("+") { shift_to 21 }
129
- for_symbols("-") { shift_to 17 }
120
+ at_state(89) {
121
+ for_symbols("^") { shift_to 14 }
122
+ for_symbols("<") { shift_to 24 }
123
+ for_symbols("+") { shift_to 22 }
124
+ for_symbols("-") { shift_to 26 }
125
+ for_symbols("/") { shift_to 20 }
126
+ for_symbols("_End_", "newline") { reduce_with "print_statement" }
127
+ for_symbols("*") { shift_to 16 }
128
+ for_symbols(">") { shift_to 12 }
129
+ for_symbols("==") { shift_to 18 }
130
130
  }
131
131
 
132
- at_state(6) {
133
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "literal" }
132
+ at_state(77) {
133
+ for_symbols("newline") { shift_to 1 }
134
+ for_symbols("terms") { shift_to 78 }
134
135
  }
135
136
 
136
- at_state(32) {
137
- for_symbols("==") { shift_to 27 }
138
- for_symbols("*") { shift_to 15 }
139
- for_symbols("<") { shift_to 25 }
140
- for_symbols("/") { shift_to 13 }
141
- for_symbols(">") { shift_to 23 }
142
- for_symbols(")") { shift_to 33 }
143
- for_symbols("^") { shift_to 19 }
144
- for_symbols("+") { shift_to 21 }
145
- for_symbols("-") { shift_to 17 }
137
+ at_state(76) {
138
+ for_symbols("while") { shift_to 68 }
139
+ for_symbols("newline") { shift_to 51 }
140
+ for_symbols("return") { shift_to 86 }
141
+ for_symbols("if") { shift_to 74 }
142
+ for_symbols("simple_statement") { shift_to 85 }
143
+ for_symbols("function_body_statement") { shift_to 63 }
144
+ for_symbols("var_name") { shift_to 44 }
145
+ for_symbols("word_literal") { shift_to 4 }
146
+ for_symbols("function_name") { shift_to 40 }
147
+ for_symbols("print") { shift_to 88 }
148
+ for_symbols("function_body") { shift_to 77 }
146
149
  }
147
150
 
148
- at_state(101) {
149
- for_symbols("while") { shift_to 88 }
150
- for_symbols("newline") { shift_to 2 }
151
- for_symbols("var_name") { shift_to 61 }
152
- for_symbols("print") { shift_to 5 }
153
- for_symbols("main_body_statement") { shift_to 94 }
154
- for_symbols("word_literal") { shift_to 30 }
155
- for_symbols("if") { shift_to 40 }
156
- for_symbols("end") { shift_to 102 }
157
- for_symbols("def") { shift_to 43 }
158
- for_symbols("function_name") { shift_to 55 }
159
- for_symbols("simple_statement") { shift_to 86 }
151
+ at_state(66) {
152
+ for_symbols("newline") { reduce_with "multiple_function_body_statements" }
160
153
  }
161
154
 
162
- at_state(88) {
163
- for_symbols("-") { shift_to 7 }
164
- for_symbols("!") { shift_to 34 }
165
- for_symbols("numeric_literal") { shift_to 6 }
166
- for_symbols("(") { shift_to 31 }
167
- for_symbols("word_literal") { shift_to 30 }
168
- for_symbols("var_name") { shift_to 29 }
169
- for_symbols("expression") { shift_to 89 }
170
- for_symbols("function_name") { shift_to 8 }
155
+ at_state(14) {
156
+ for_symbols("(") { shift_to 6 }
157
+ for_symbols("expression") { shift_to 15 }
158
+ for_symbols("numeric_literal") { shift_to 29 }
159
+ for_symbols("word_literal") { shift_to 4 }
160
+ for_symbols("function_name") { shift_to 7 }
161
+ for_symbols("var_name") { shift_to 28 }
162
+ for_symbols("-") { shift_to 32 }
163
+ for_symbols("!") { shift_to 30 }
171
164
  }
172
165
 
173
- at_state(41) {
174
- for_symbols("==") { shift_to 27 }
175
- for_symbols("*") { shift_to 15 }
176
- for_symbols("terms") { shift_to 42 }
177
- for_symbols("<") { shift_to 25 }
178
- for_symbols("/") { shift_to 13 }
179
- for_symbols(">") { shift_to 23 }
180
- for_symbols("newline") { shift_to 3 }
181
- for_symbols("^") { shift_to 19 }
182
- for_symbols("+") { shift_to 21 }
183
- for_symbols("-") { shift_to 17 }
166
+ at_state(59) {
167
+ for_symbols("arg_decl") { shift_to 60 }
168
+ for_symbols("word_literal") { shift_to 57 }
184
169
  }
185
170
 
186
- at_state(27) {
187
- for_symbols("-") { shift_to 7 }
188
- for_symbols("!") { shift_to 34 }
189
- for_symbols("numeric_literal") { shift_to 6 }
190
- for_symbols("(") { shift_to 31 }
191
- for_symbols("expression") { shift_to 28 }
192
- for_symbols("word_literal") { shift_to 30 }
193
- for_symbols("var_name") { shift_to 29 }
194
- for_symbols("function_name") { shift_to 8 }
171
+ at_state(105) {
172
+ for_symbols("newline") { shift_to 51 }
173
+ for_symbols("word_literal", "def", "print", "if", "while") { reduce_with "some_terms" }
195
174
  }
196
175
 
197
- at_state(9) {
198
- for_symbols("-") { shift_to 7 }
199
- for_symbols("!") { shift_to 34 }
200
- for_symbols(",", ")") { reduce_with "no_args" }
201
- for_symbols("numeric_literal") { shift_to 6 }
202
- for_symbols("(") { shift_to 31 }
203
- for_symbols("word_literal") { shift_to 30 }
204
- for_symbols("var_name") { shift_to 29 }
205
- for_symbols("function_name") { shift_to 8 }
206
- for_symbols("expression") { shift_to 37 }
207
- for_symbols("arg_list") { shift_to 10 }
176
+ at_state(19) {
177
+ for_symbols("^") { shift_to 14 }
178
+ for_symbols("<") { shift_to 24 }
179
+ for_symbols(",", "_End_", "newline", ")") { reduce_with "equality_comparison" }
180
+ for_symbols("+") { shift_to 22 }
181
+ for_symbols("-") { shift_to 26 }
182
+ for_symbols("/") { shift_to 20 }
183
+ for_symbols("*") { shift_to 16 }
184
+ for_symbols(">") { shift_to 12 }
208
185
  }
209
186
 
210
- at_state(60) {
211
- for_symbols("==") { shift_to 27 }
212
- for_symbols("*") { shift_to 15 }
213
- for_symbols("<") { shift_to 25 }
214
- for_symbols("/") { shift_to 13 }
215
- for_symbols("newline") { reduce_with "return_statement" }
216
- for_symbols(">") { shift_to 23 }
217
- for_symbols("^") { shift_to 19 }
218
- for_symbols("+") { shift_to 21 }
219
- for_symbols("-") { shift_to 17 }
187
+ at_state(33) {
188
+ for_symbols("^") { shift_to 14 }
189
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "negated_expression" }
220
190
  }
221
191
 
222
- at_state(73) {
223
- for_symbols("newline") { reduce_with "function_body_if_else_statement" }
192
+ at_state(31) {
193
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "negation" }
224
194
  }
225
195
 
226
- at_state(24) {
227
- for_symbols("*") { shift_to 15 }
228
- for_symbols("==", ",", "_End_", "newline", ")") { reduce_with "greater_than_comparison" }
229
- for_symbols("/") { shift_to 13 }
230
- for_symbols("^") { shift_to 19 }
231
- for_symbols("+") { shift_to 21 }
232
- for_symbols("-") { shift_to 17 }
196
+ at_state(99) {
197
+ for_symbols("newline") { shift_to 1 }
198
+ for_symbols("terms") { shift_to 100 }
233
199
  }
234
200
 
235
- at_state(65) {
236
- for_symbols("newline") { reduce_with "single_function_body_statement" }
201
+ at_state(74) {
202
+ for_symbols("(") { shift_to 6 }
203
+ for_symbols("numeric_literal") { shift_to 29 }
204
+ for_symbols("word_literal") { shift_to 4 }
205
+ for_symbols("function_name") { shift_to 7 }
206
+ for_symbols("expression") { shift_to 75 }
207
+ for_symbols("var_name") { shift_to 28 }
208
+ for_symbols("-") { shift_to 32 }
209
+ for_symbols("!") { shift_to 30 }
237
210
  }
238
211
 
239
- at_state(53) {
240
- for_symbols("==") { shift_to 27 }
241
- for_symbols("*") { shift_to 15 }
242
- for_symbols("<") { shift_to 25 }
243
- for_symbols("/") { shift_to 13 }
244
- for_symbols(">") { shift_to 23 }
245
- for_symbols("terms") { shift_to 54 }
246
- for_symbols("newline") { shift_to 3 }
247
- for_symbols("^") { shift_to 19 }
248
- for_symbols("+") { shift_to 21 }
249
- for_symbols("-") { shift_to 17 }
212
+ at_state(67) {
213
+ for_symbols("_End_", "newline") { reduce_with "function_definition" }
250
214
  }
251
215
 
252
- at_state(39) {
253
- for_symbols("==") { shift_to 27 }
254
- for_symbols("*") { shift_to 15 }
255
- for_symbols("<") { shift_to 25 }
256
- for_symbols("/") { shift_to 13 }
257
- for_symbols(">") { shift_to 23 }
258
- for_symbols("^") { shift_to 19 }
259
- for_symbols("+") { shift_to 21 }
260
- for_symbols("_End_", "newline") { reduce_with "print_statement" }
261
- for_symbols("-") { shift_to 17 }
216
+ at_state(37) {
217
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "parenthetized_expression" }
262
218
  }
263
219
 
264
- at_state(15) {
265
- for_symbols("-") { shift_to 7 }
266
- for_symbols("!") { shift_to 34 }
267
- for_symbols("numeric_literal") { shift_to 6 }
268
- for_symbols("(") { shift_to 31 }
269
- for_symbols("word_literal") { shift_to 30 }
270
- for_symbols("var_name") { shift_to 29 }
271
- for_symbols("function_name") { shift_to 8 }
272
- for_symbols("expression") { shift_to 16 }
220
+ at_state(12) {
221
+ for_symbols("(") { shift_to 6 }
222
+ for_symbols("numeric_literal") { shift_to 29 }
223
+ for_symbols("expression") { shift_to 13 }
224
+ for_symbols("word_literal") { shift_to 4 }
225
+ for_symbols("function_name") { shift_to 7 }
226
+ for_symbols("var_name") { shift_to 28 }
227
+ for_symbols("-") { shift_to 32 }
228
+ for_symbols("!") { shift_to 30 }
273
229
  }
274
230
 
275
- at_state(34) {
276
- for_symbols("expression") { shift_to 35 }
277
- for_symbols("-") { shift_to 7 }
278
- for_symbols("!") { shift_to 34 }
279
- for_symbols("numeric_literal") { shift_to 6 }
280
- for_symbols("(") { shift_to 31 }
281
- for_symbols("word_literal") { shift_to 30 }
282
- for_symbols("var_name") { shift_to 29 }
283
- for_symbols("function_name") { shift_to 8 }
231
+ at_state(60) {
232
+ for_symbols(",", ")") { reduce_with "multiple_arg_declarations" }
284
233
  }
285
234
 
286
- at_state(48) {
287
- for_symbols(",", ")") { reduce_with "arg_declaration" }
235
+ at_state(27) {
236
+ for_symbols("^") { shift_to 14 }
237
+ for_symbols("/") { shift_to 20 }
238
+ for_symbols("*") { shift_to 16 }
239
+ for_symbols("+", "==", ",", "-", "<", "_End_", ">", "newline", ")") { reduce_with "subtraction" }
288
240
  }
289
241
 
290
- at_state(91) {
291
- for_symbols("newline") { shift_to 3 }
292
- for_symbols("terms") { shift_to 92 }
242
+ at_state(103) {
243
+ for_symbols("_End_") { reduce_with "program" }
293
244
  }
294
245
 
295
- at_state(84) {
296
- for_symbols(",", ")") { reduce_with "single_arg_declaration" }
246
+ at_state(86) {
247
+ for_symbols("(") { shift_to 6 }
248
+ for_symbols("numeric_literal") { shift_to 29 }
249
+ for_symbols("word_literal") { shift_to 4 }
250
+ for_symbols("function_name") { shift_to 7 }
251
+ for_symbols("expression") { shift_to 87 }
252
+ for_symbols("var_name") { shift_to 28 }
253
+ for_symbols("-") { shift_to 32 }
254
+ for_symbols("!") { shift_to 30 }
297
255
  }
298
256
 
299
- at_state(83) {
300
- for_symbols("_End_", "newline") { reduce_with "function_definition" }
257
+ at_state(82) {
258
+ for_symbols("newline") { shift_to 1 }
259
+ for_symbols("terms") { shift_to 83 }
301
260
  }
302
261
 
303
- at_state(68) {
304
- for_symbols("newline") { reduce_with "function_body_if_statement" }
262
+ at_state(46) {
263
+ for_symbols("^") { shift_to 14 }
264
+ for_symbols("<") { shift_to 24 }
265
+ for_symbols("_End_", "newline") { reduce_with "assignment_statement" }
266
+ for_symbols("+") { shift_to 22 }
267
+ for_symbols("-") { shift_to 26 }
268
+ for_symbols("/") { shift_to 20 }
269
+ for_symbols("*") { shift_to 16 }
270
+ for_symbols(">") { shift_to 12 }
271
+ for_symbols("==") { shift_to 18 }
305
272
  }
306
273
 
307
- at_state(2) {
308
- for_symbols("word_literal", "end", "def", "print", "_End_", "else", "if", "newline", "return", "while") { reduce_with "multiple_terms" }
274
+ at_state(11) {
275
+ for_symbols("^") { shift_to 14 }
276
+ for_symbols("<") { shift_to 24 }
277
+ for_symbols(",", ")") { reduce_with "multiple_args" }
278
+ for_symbols("+") { shift_to 22 }
279
+ for_symbols("-") { shift_to 26 }
280
+ for_symbols("/") { shift_to 20 }
281
+ for_symbols("*") { shift_to 16 }
282
+ for_symbols(">") { shift_to 12 }
283
+ for_symbols("==") { shift_to 18 }
309
284
  }
310
285
 
311
- at_state(17) {
312
- for_symbols("-") { shift_to 7 }
313
- for_symbols("!") { shift_to 34 }
314
- for_symbols("numeric_literal") { shift_to 6 }
315
- for_symbols("(") { shift_to 31 }
316
- for_symbols("word_literal") { shift_to 30 }
317
- for_symbols("var_name") { shift_to 29 }
318
- for_symbols("function_name") { shift_to 8 }
319
- for_symbols("expression") { shift_to 18 }
286
+ at_state(16) {
287
+ for_symbols("(") { shift_to 6 }
288
+ for_symbols("numeric_literal") { shift_to 29 }
289
+ for_symbols("expression") { shift_to 17 }
290
+ for_symbols("word_literal") { shift_to 4 }
291
+ for_symbols("function_name") { shift_to 7 }
292
+ for_symbols("var_name") { shift_to 28 }
293
+ for_symbols("-") { shift_to 32 }
294
+ for_symbols("!") { shift_to 30 }
320
295
  }
321
296
 
322
- at_state(29) {
323
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "variable_reference" }
297
+ at_state(43) {
298
+ for_symbols("_End_", "newline") { reduce_with "function_call_statement" }
324
299
  }
325
300
 
326
- at_state(20) {
327
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "power" }
301
+ at_state(28) {
302
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "variable_reference" }
328
303
  }
329
304
 
330
- at_state(102) {
331
- for_symbols("_End_", "newline") { reduce_with "main_body_if_else_statement" }
305
+ at_state(78) {
306
+ for_symbols("while") { shift_to 68 }
307
+ for_symbols("newline") { shift_to 51 }
308
+ for_symbols("return") { shift_to 86 }
309
+ for_symbols("else") { shift_to 80 }
310
+ for_symbols("end") { shift_to 79 }
311
+ for_symbols("if") { shift_to 74 }
312
+ for_symbols("simple_statement") { shift_to 85 }
313
+ for_symbols("var_name") { shift_to 44 }
314
+ for_symbols("word_literal") { shift_to 4 }
315
+ for_symbols("function_body_statement") { shift_to 66 }
316
+ for_symbols("function_name") { shift_to 40 }
317
+ for_symbols("print") { shift_to 88 }
332
318
  }
333
319
 
334
- at_state(92) {
335
- for_symbols("while") { shift_to 88 }
336
- for_symbols("newline") { shift_to 2 }
337
- for_symbols("var_name") { shift_to 61 }
338
- for_symbols("print") { shift_to 5 }
339
- for_symbols("main_body_statement") { shift_to 94 }
340
- for_symbols("word_literal") { shift_to 30 }
341
- for_symbols("if") { shift_to 40 }
342
- for_symbols("end") { shift_to 93 }
343
- for_symbols("def") { shift_to 43 }
344
- for_symbols("function_name") { shift_to 55 }
345
- for_symbols("simple_statement") { shift_to 86 }
320
+ at_state(69) {
321
+ for_symbols("newline") { shift_to 1 }
322
+ for_symbols("^") { shift_to 14 }
323
+ for_symbols("<") { shift_to 24 }
324
+ for_symbols("terms") { shift_to 70 }
325
+ for_symbols("+") { shift_to 22 }
326
+ for_symbols("-") { shift_to 26 }
327
+ for_symbols("/") { shift_to 20 }
328
+ for_symbols("*") { shift_to 16 }
329
+ for_symbols(">") { shift_to 12 }
330
+ for_symbols("==") { shift_to 18 }
346
331
  }
347
332
 
348
- at_state(86) {
349
- for_symbols("_End_", "newline") { reduce_with "main_body_simple_statement" }
333
+ at_state(63) {
334
+ for_symbols("newline") { reduce_with "single_function_body_statement" }
350
335
  }
351
336
 
352
- at_state(85) {
353
- for_symbols("(") { reduce_with "function_name" }
337
+ at_state(94) {
338
+ for_symbols("newline") { shift_to 51 }
339
+ for_symbols("var_name") { shift_to 44 }
340
+ for_symbols("else") { shift_to 97 }
341
+ for_symbols("end") { shift_to 95 }
342
+ for_symbols("def") { shift_to 52 }
343
+ for_symbols("word_literal") { shift_to 4 }
344
+ for_symbols("simple_statement") { shift_to 96 }
345
+ for_symbols("function_name") { shift_to 40 }
346
+ for_symbols("while") { shift_to 5 }
347
+ for_symbols("if") { shift_to 90 }
348
+ for_symbols("print") { shift_to 88 }
349
+ for_symbols("main_body_statement") { shift_to 50 }
354
350
  }
355
351
 
356
- at_state(78) {
357
- for_symbols("newline") { shift_to 3 }
358
- for_symbols("terms") { shift_to 79 }
352
+ at_state(62) {
353
+ for_symbols("while") { shift_to 68 }
354
+ for_symbols("newline") { shift_to 51 }
355
+ for_symbols("return") { shift_to 86 }
356
+ for_symbols("if") { shift_to 74 }
357
+ for_symbols("simple_statement") { shift_to 85 }
358
+ for_symbols("function_body_statement") { shift_to 63 }
359
+ for_symbols("var_name") { shift_to 44 }
360
+ for_symbols("word_literal") { shift_to 4 }
361
+ for_symbols("function_name") { shift_to 40 }
362
+ for_symbols("print") { shift_to 88 }
363
+ for_symbols("function_body") { shift_to 64 }
359
364
  }
360
365
 
361
- at_state(33) {
362
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "parenthetized_expression" }
366
+ at_state(10) {
367
+ for_symbols("(") { shift_to 6 }
368
+ for_symbols("numeric_literal") { shift_to 29 }
369
+ for_symbols("word_literal") { shift_to 4 }
370
+ for_symbols("function_name") { shift_to 7 }
371
+ for_symbols("expression") { shift_to 11 }
372
+ for_symbols("var_name") { shift_to 28 }
373
+ for_symbols("-") { shift_to 32 }
374
+ for_symbols("!") { shift_to 30 }
363
375
  }
364
376
 
365
- at_state(37) {
366
- for_symbols("==") { shift_to 27 }
367
- for_symbols("*") { shift_to 15 }
368
- for_symbols("<") { shift_to 25 }
369
- for_symbols("/") { shift_to 13 }
370
- for_symbols(",", ")") { reduce_with "single_arg" }
371
- for_symbols(">") { shift_to 23 }
372
- for_symbols("^") { shift_to 19 }
373
- for_symbols("+") { shift_to 21 }
374
- for_symbols("-") { shift_to 17 }
377
+ at_state(0) {
378
+ for_symbols("newline") { shift_to 1 }
379
+ for_symbols("terms") { shift_to 105 }
380
+ for_symbols("opt_terms") { shift_to 2 }
381
+ for_symbols("word_literal", "def", "print", "if", "while") { reduce_with "no_terms" }
375
382
  }
376
383
 
377
- at_state(35) {
378
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "negation" }
384
+ at_state(80) {
385
+ for_symbols("newline") { shift_to 1 }
386
+ for_symbols("terms") { shift_to 81 }
379
387
  }
380
388
 
381
- at_state(70) {
382
- for_symbols("function_body") { shift_to 71 }
383
- for_symbols("while") { shift_to 75 }
384
- for_symbols("if") { shift_to 52 }
385
- for_symbols("newline") { shift_to 2 }
386
- for_symbols("var_name") { shift_to 61 }
387
- for_symbols("print") { shift_to 5 }
388
- for_symbols("word_literal") { shift_to 30 }
389
- for_symbols("return") { shift_to 59 }
390
- for_symbols("function_name") { shift_to 55 }
391
- for_symbols("simple_statement") { shift_to 64 }
392
- for_symbols("function_body_statement") { shift_to 65 }
389
+ at_state(79) {
390
+ for_symbols("newline") { reduce_with "function_body_if_statement" }
393
391
  }
394
392
 
395
- at_state(93) {
396
- for_symbols("_End_", "newline") { reduce_with "main_body_while_statement" }
393
+ at_state(75) {
394
+ for_symbols("newline") { shift_to 1 }
395
+ for_symbols("^") { shift_to 14 }
396
+ for_symbols("<") { shift_to 24 }
397
+ for_symbols("terms") { shift_to 76 }
398
+ for_symbols("+") { shift_to 22 }
399
+ for_symbols("-") { shift_to 26 }
400
+ for_symbols("/") { shift_to 20 }
401
+ for_symbols("*") { shift_to 16 }
402
+ for_symbols(">") { shift_to 12 }
403
+ for_symbols("==") { shift_to 18 }
397
404
  }
398
405
 
399
- at_state(89) {
400
- for_symbols("==") { shift_to 27 }
401
- for_symbols("*") { shift_to 15 }
402
- for_symbols("<") { shift_to 25 }
403
- for_symbols("/") { shift_to 13 }
404
- for_symbols(">") { shift_to 23 }
405
- for_symbols("newline") { shift_to 3 }
406
- for_symbols("^") { shift_to 19 }
407
- for_symbols("terms") { shift_to 90 }
408
- for_symbols("+") { shift_to 21 }
409
- for_symbols("-") { shift_to 17 }
406
+ at_state(47) {
407
+ for_symbols("newline") { shift_to 1 }
408
+ for_symbols("terms") { shift_to 48 }
410
409
  }
411
410
 
412
- at_state(61) {
413
- for_symbols("=") { shift_to 62 }
411
+ at_state(57) {
412
+ for_symbols(",", ")") { reduce_with "arg_declaration" }
414
413
  }
415
414
 
416
- at_state(25) {
417
- for_symbols("expression") { shift_to 26 }
418
- for_symbols("-") { shift_to 7 }
419
- for_symbols("!") { shift_to 34 }
420
- for_symbols("numeric_literal") { shift_to 6 }
421
- for_symbols("(") { shift_to 31 }
422
- for_symbols("word_literal") { shift_to 30 }
423
- for_symbols("var_name") { shift_to 29 }
424
- for_symbols("function_name") { shift_to 8 }
415
+ at_state(7) {
416
+ for_symbols("(") { shift_to 8 }
425
417
  }
426
418
 
427
- at_state(57) {
428
- for_symbols(")") { shift_to 58 }
429
- for_symbols(",") { shift_to 11 }
419
+ at_state(61) {
420
+ for_symbols("newline") { shift_to 1 }
421
+ for_symbols("terms") { shift_to 62 }
430
422
  }
431
423
 
432
- at_state(95) {
433
- for_symbols("terms") { shift_to 96 }
434
- for_symbols("newline") { shift_to 3 }
424
+ at_state(24) {
425
+ for_symbols("(") { shift_to 6 }
426
+ for_symbols("numeric_literal") { shift_to 29 }
427
+ for_symbols("word_literal") { shift_to 4 }
428
+ for_symbols("function_name") { shift_to 7 }
429
+ for_symbols("var_name") { shift_to 28 }
430
+ for_symbols("expression") { shift_to 25 }
431
+ for_symbols("-") { shift_to 32 }
432
+ for_symbols("!") { shift_to 30 }
435
433
  }
436
434
 
437
- at_state(74) {
438
- for_symbols("newline") { reduce_with "multiple_function_body_statements" }
435
+ at_state(2) {
436
+ for_symbols("main_body_statement") { shift_to 3 }
437
+ for_symbols("var_name") { shift_to 44 }
438
+ for_symbols("def") { shift_to 52 }
439
+ for_symbols("word_literal") { shift_to 4 }
440
+ for_symbols("simple_statement") { shift_to 96 }
441
+ for_symbols("main_body") { shift_to 102 }
442
+ for_symbols("function_name") { shift_to 40 }
443
+ for_symbols("while") { shift_to 5 }
444
+ for_symbols("if") { shift_to 90 }
445
+ for_symbols("print") { shift_to 88 }
439
446
  }
440
447
 
441
- at_state(69) {
442
- for_symbols("newline") { shift_to 3 }
443
- for_symbols("terms") { shift_to 70 }
448
+ at_state(102) {
449
+ for_symbols("newline") { shift_to 1 }
450
+ for_symbols("terms") { shift_to 104 }
451
+ for_symbols("_End_") { reduce_with "no_terms" }
452
+ for_symbols("opt_terms") { shift_to 103 }
444
453
  }
445
454
 
446
- at_state(77) {
447
- for_symbols("while") { shift_to 75 }
448
- for_symbols("if") { shift_to 52 }
449
- for_symbols("newline") { shift_to 2 }
450
- for_symbols("var_name") { shift_to 61 }
451
- for_symbols("print") { shift_to 5 }
452
- for_symbols("word_literal") { shift_to 30 }
453
- for_symbols("function_body") { shift_to 78 }
454
- for_symbols("return") { shift_to 59 }
455
- for_symbols("function_name") { shift_to 55 }
456
- for_symbols("simple_statement") { shift_to 64 }
457
- for_symbols("function_body_statement") { shift_to 65 }
455
+ at_state(96) {
456
+ for_symbols("_End_", "newline") { reduce_with "main_body_simple_statement" }
458
457
  }
459
458
 
460
- at_state(59) {
461
- for_symbols("-") { shift_to 7 }
462
- for_symbols("!") { shift_to 34 }
463
- for_symbols("numeric_literal") { shift_to 6 }
464
- for_symbols("(") { shift_to 31 }
465
- for_symbols("word_literal") { shift_to 30 }
466
- for_symbols("var_name") { shift_to 29 }
467
- for_symbols("function_name") { shift_to 8 }
468
- for_symbols("expression") { shift_to 60 }
459
+ at_state(73) {
460
+ for_symbols("newline") { reduce_with "function_body_while_statement" }
469
461
  }
470
462
 
471
- at_state(3) {
472
- for_symbols("word_literal", "end", "def", "print", "_End_", "else", "if", "newline", "return", "while") { reduce_with "single_term" }
463
+ at_state(51) {
464
+ for_symbols("word_literal", "def", "end", "print", "else", "if", "_End_", "return", "newline", "while") { reduce_with "multiple_terms" }
473
465
  }
474
466
 
475
- at_state(36) {
476
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "function_call_expression" }
467
+ at_state(13) {
468
+ for_symbols("^") { shift_to 14 }
469
+ for_symbols("+") { shift_to 22 }
470
+ for_symbols("-") { shift_to 26 }
471
+ for_symbols("/") { shift_to 20 }
472
+ for_symbols("*") { shift_to 16 }
473
+ for_symbols("==", ",", "_End_", "newline", ")") { reduce_with "greater_than_comparison" }
477
474
  }
478
475
 
479
- at_state(5) {
480
- for_symbols("-") { shift_to 7 }
481
- for_symbols("!") { shift_to 34 }
482
- for_symbols("numeric_literal") { shift_to 6 }
483
- for_symbols("(") { shift_to 31 }
484
- for_symbols("word_literal") { shift_to 30 }
485
- for_symbols("var_name") { shift_to 29 }
486
- for_symbols("function_name") { shift_to 8 }
487
- for_symbols("expression") { shift_to 39 }
476
+ at_state(3) {
477
+ for_symbols("_End_", "newline") { reduce_with "single_main_body_statement" }
488
478
  }
489
479
 
490
- at_state(58) {
491
- for_symbols("_End_", "newline") { reduce_with "function_call_statement" }
480
+ at_state(20) {
481
+ for_symbols("(") { shift_to 6 }
482
+ for_symbols("numeric_literal") { shift_to 29 }
483
+ for_symbols("word_literal") { shift_to 4 }
484
+ for_symbols("function_name") { shift_to 7 }
485
+ for_symbols("var_name") { shift_to 28 }
486
+ for_symbols("expression") { shift_to 21 }
487
+ for_symbols("-") { shift_to 32 }
488
+ for_symbols("!") { shift_to 30 }
492
489
  }
493
490
 
494
- at_state(23) {
495
- for_symbols("-") { shift_to 7 }
496
- for_symbols("!") { shift_to 34 }
497
- for_symbols("numeric_literal") { shift_to 6 }
498
- for_symbols("(") { shift_to 31 }
499
- for_symbols("expression") { shift_to 24 }
500
- for_symbols("word_literal") { shift_to 30 }
501
- for_symbols("var_name") { shift_to 29 }
502
- for_symbols("function_name") { shift_to 8 }
491
+ at_state(9) {
492
+ for_symbols(",") { shift_to 10 }
493
+ for_symbols(")") { shift_to 34 }
503
494
  }
504
495
 
505
- at_state(46) {
506
- for_symbols(")") { shift_to 50 }
507
- for_symbols(",") { shift_to 47 }
496
+ at_state(92) {
497
+ for_symbols("newline") { shift_to 51 }
498
+ for_symbols("main_body_statement") { shift_to 3 }
499
+ for_symbols("var_name") { shift_to 44 }
500
+ for_symbols("def") { shift_to 52 }
501
+ for_symbols("word_literal") { shift_to 4 }
502
+ for_symbols("main_body") { shift_to 93 }
503
+ for_symbols("simple_statement") { shift_to 96 }
504
+ for_symbols("function_name") { shift_to 40 }
505
+ for_symbols("while") { shift_to 5 }
506
+ for_symbols("if") { shift_to 90 }
507
+ for_symbols("print") { shift_to 88 }
508
508
  }
509
509
 
510
- at_state(66) {
511
- for_symbols("terms") { shift_to 67 }
512
- for_symbols("newline") { shift_to 3 }
510
+ at_state(81) {
511
+ for_symbols("while") { shift_to 68 }
512
+ for_symbols("newline") { shift_to 51 }
513
+ for_symbols("return") { shift_to 86 }
514
+ for_symbols("function_body") { shift_to 82 }
515
+ for_symbols("if") { shift_to 74 }
516
+ for_symbols("simple_statement") { shift_to 85 }
517
+ for_symbols("function_body_statement") { shift_to 63 }
518
+ for_symbols("var_name") { shift_to 44 }
519
+ for_symbols("word_literal") { shift_to 4 }
520
+ for_symbols("function_name") { shift_to 40 }
521
+ for_symbols("print") { shift_to 88 }
513
522
  }
514
523
 
515
- at_state(94) {
516
- for_symbols("_End_", "newline") { reduce_with "multiple_main_body_statements" }
524
+ at_state(39) {
525
+ for_symbols("newline") { shift_to 51 }
526
+ for_symbols("main_body_statement") { shift_to 3 }
527
+ for_symbols("var_name") { shift_to 44 }
528
+ for_symbols("def") { shift_to 52 }
529
+ for_symbols("word_literal") { shift_to 4 }
530
+ for_symbols("simple_statement") { shift_to 96 }
531
+ for_symbols("function_name") { shift_to 40 }
532
+ for_symbols("while") { shift_to 5 }
533
+ for_symbols("if") { shift_to 90 }
534
+ for_symbols("print") { shift_to 88 }
535
+ for_symbols("main_body") { shift_to 47 }
517
536
  }
518
537
 
519
- at_state(11) {
520
- for_symbols("-") { shift_to 7 }
521
- for_symbols("!") { shift_to 34 }
522
- for_symbols("numeric_literal") { shift_to 6 }
523
- for_symbols("(") { shift_to 31 }
524
- for_symbols("word_literal") { shift_to 30 }
525
- for_symbols("var_name") { shift_to 29 }
526
- for_symbols("function_name") { shift_to 8 }
527
- for_symbols("expression") { shift_to 12 }
538
+ at_state(17) {
539
+ for_symbols("^") { shift_to 14 }
540
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "multiplication" }
528
541
  }
529
542
 
530
- at_state(51) {
531
- for_symbols("function_body") { shift_to 81 }
532
- for_symbols("while") { shift_to 75 }
533
- for_symbols("if") { shift_to 52 }
534
- for_symbols("newline") { shift_to 2 }
535
- for_symbols("var_name") { shift_to 61 }
536
- for_symbols("print") { shift_to 5 }
537
- for_symbols("word_literal") { shift_to 30 }
538
- for_symbols("return") { shift_to 59 }
539
- for_symbols("function_name") { shift_to 55 }
540
- for_symbols("simple_statement") { shift_to 64 }
541
- for_symbols("function_body_statement") { shift_to 65 }
543
+ at_state(8) {
544
+ for_symbols("(") { shift_to 6 }
545
+ for_symbols("arg_list") { shift_to 9 }
546
+ for_symbols(",", ")") { reduce_with "no_args" }
547
+ for_symbols("numeric_literal") { shift_to 29 }
548
+ for_symbols("word_literal") { shift_to 4 }
549
+ for_symbols("function_name") { shift_to 7 }
550
+ for_symbols("var_name") { shift_to 28 }
551
+ for_symbols("-") { shift_to 32 }
552
+ for_symbols("!") { shift_to 30 }
553
+ for_symbols("expression") { shift_to 35 }
542
554
  }
543
555
 
544
- at_state(50) {
545
- for_symbols("terms") { shift_to 51 }
546
- for_symbols("newline") { shift_to 3 }
556
+ at_state(58) {
557
+ for_symbols(")") { shift_to 61 }
558
+ for_symbols(",") { shift_to 59 }
547
559
  }
548
560
 
549
- at_state(22) {
550
- for_symbols("*") { shift_to 15 }
551
- for_symbols("/") { shift_to 13 }
552
- for_symbols("^") { shift_to 19 }
553
- for_symbols("==", "+", ",", "-", "<", "_End_", ">", "newline", ")") { reduce_with "addition" }
561
+ at_state(98) {
562
+ for_symbols("newline") { shift_to 51 }
563
+ for_symbols("main_body_statement") { shift_to 3 }
564
+ for_symbols("main_body") { shift_to 99 }
565
+ for_symbols("var_name") { shift_to 44 }
566
+ for_symbols("def") { shift_to 52 }
567
+ for_symbols("word_literal") { shift_to 4 }
568
+ for_symbols("simple_statement") { shift_to 96 }
569
+ for_symbols("function_name") { shift_to 40 }
570
+ for_symbols("while") { shift_to 5 }
571
+ for_symbols("if") { shift_to 90 }
572
+ for_symbols("print") { shift_to 88 }
554
573
  }
555
574
 
556
- at_state(38) {
557
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "negated_expression" }
558
- for_symbols("^") { shift_to 19 }
575
+ at_state(22) {
576
+ for_symbols("(") { shift_to 6 }
577
+ for_symbols("numeric_literal") { shift_to 29 }
578
+ for_symbols("word_literal") { shift_to 4 }
579
+ for_symbols("function_name") { shift_to 7 }
580
+ for_symbols("var_name") { shift_to 28 }
581
+ for_symbols("-") { shift_to 32 }
582
+ for_symbols("!") { shift_to 30 }
583
+ for_symbols("expression") { shift_to 23 }
559
584
  }
560
585
 
561
- at_state(63) {
562
- for_symbols("==") { shift_to 27 }
563
- for_symbols("*") { shift_to 15 }
564
- for_symbols("<") { shift_to 25 }
565
- for_symbols("/") { shift_to 13 }
566
- for_symbols(">") { shift_to 23 }
567
- for_symbols("^") { shift_to 19 }
568
- for_symbols("_End_", "newline") { reduce_with "assignment_statement" }
569
- for_symbols("+") { shift_to 21 }
570
- for_symbols("-") { shift_to 17 }
586
+ at_state(50) {
587
+ for_symbols("_End_", "newline") { reduce_with "multiple_main_body_statements" }
571
588
  }
572
589
 
573
- at_state(100) {
574
- for_symbols("terms") { shift_to 101 }
575
- for_symbols("newline") { shift_to 3 }
590
+ at_state(30) {
591
+ for_symbols("(") { shift_to 6 }
592
+ for_symbols("numeric_literal") { shift_to 29 }
593
+ for_symbols("word_literal") { shift_to 4 }
594
+ for_symbols("function_name") { shift_to 7 }
595
+ for_symbols("expression") { shift_to 31 }
596
+ for_symbols("var_name") { shift_to 28 }
597
+ for_symbols("-") { shift_to 32 }
598
+ for_symbols("!") { shift_to 30 }
576
599
  }
577
600
 
578
- at_state(98) {
579
- for_symbols("terms") { shift_to 99 }
580
- for_symbols("newline") { shift_to 3 }
601
+ at_state(35) {
602
+ for_symbols("^") { shift_to 14 }
603
+ for_symbols("<") { shift_to 24 }
604
+ for_symbols(",", ")") { reduce_with "single_arg" }
605
+ for_symbols("+") { shift_to 22 }
606
+ for_symbols("-") { shift_to 26 }
607
+ for_symbols("/") { shift_to 20 }
608
+ for_symbols("*") { shift_to 16 }
609
+ for_symbols(">") { shift_to 12 }
610
+ for_symbols("==") { shift_to 18 }
581
611
  }
582
612
 
583
- at_state(97) {
584
- for_symbols("_End_", "newline") { reduce_with "main_body_if_statement" }
613
+ at_state(56) {
614
+ for_symbols(",", ")") { reduce_with "single_arg_declaration" }
585
615
  }
586
616
 
587
- at_state(76) {
588
- for_symbols("==") { shift_to 27 }
589
- for_symbols("*") { shift_to 15 }
590
- for_symbols("<") { shift_to 25 }
591
- for_symbols("/") { shift_to 13 }
592
- for_symbols(">") { shift_to 23 }
593
- for_symbols("newline") { shift_to 3 }
594
- for_symbols("^") { shift_to 19 }
595
- for_symbols("terms") { shift_to 77 }
596
- for_symbols("+") { shift_to 21 }
597
- for_symbols("-") { shift_to 17 }
617
+ at_state(32) {
618
+ for_symbols("(") { shift_to 6 }
619
+ for_symbols("expression") { shift_to 33 }
620
+ for_symbols("numeric_literal") { shift_to 29 }
621
+ for_symbols("word_literal") { shift_to 4 }
622
+ for_symbols("function_name") { shift_to 7 }
623
+ for_symbols("var_name") { shift_to 28 }
624
+ for_symbols("-") { shift_to 32 }
625
+ for_symbols("!") { shift_to 30 }
598
626
  }
599
627
 
600
- at_state(14) {
601
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "division" }
602
- for_symbols("^") { shift_to 19 }
628
+ at_state(48) {
629
+ for_symbols("newline") { shift_to 51 }
630
+ for_symbols("var_name") { shift_to 44 }
631
+ for_symbols("def") { shift_to 52 }
632
+ for_symbols("word_literal") { shift_to 4 }
633
+ for_symbols("simple_statement") { shift_to 96 }
634
+ for_symbols("function_name") { shift_to 40 }
635
+ for_symbols("end") { shift_to 49 }
636
+ for_symbols("while") { shift_to 5 }
637
+ for_symbols("if") { shift_to 90 }
638
+ for_symbols("print") { shift_to 88 }
639
+ for_symbols("main_body_statement") { shift_to 50 }
603
640
  }
604
641
 
605
- at_state(62) {
606
- for_symbols("expression") { shift_to 63 }
607
- for_symbols("-") { shift_to 7 }
608
- for_symbols("!") { shift_to 34 }
609
- for_symbols("numeric_literal") { shift_to 6 }
610
- for_symbols("(") { shift_to 31 }
611
- for_symbols("word_literal") { shift_to 30 }
612
- for_symbols("var_name") { shift_to 29 }
613
- for_symbols("function_name") { shift_to 8 }
642
+ at_state(87) {
643
+ for_symbols("^") { shift_to 14 }
644
+ for_symbols("<") { shift_to 24 }
645
+ for_symbols("+") { shift_to 22 }
646
+ for_symbols("-") { shift_to 26 }
647
+ for_symbols("newline") { reduce_with "return_statement" }
648
+ for_symbols("/") { shift_to 20 }
649
+ for_symbols("*") { shift_to 16 }
650
+ for_symbols(">") { shift_to 12 }
651
+ for_symbols("==") { shift_to 18 }
614
652
  }
615
653
 
616
- at_state(104) {
617
- for_symbols("while") { shift_to 88 }
618
- for_symbols("newline") { shift_to 2 }
619
- for_symbols("var_name") { shift_to 61 }
620
- for_symbols("print") { shift_to 5 }
621
- for_symbols("main_body_statement") { shift_to 94 }
622
- for_symbols("word_literal") { shift_to 30 }
623
- for_symbols("if") { shift_to 40 }
624
- for_symbols("def") { shift_to 43 }
625
- for_symbols("function_name") { shift_to 55 }
626
- for_symbols("_End_") { reduce_with "some_terms" }
627
- for_symbols("simple_statement") { shift_to 86 }
654
+ at_state(54) {
655
+ for_symbols("(") { shift_to 55 }
628
656
  }
629
657
 
630
- at_state(71) {
631
- for_symbols("terms") { shift_to 72 }
632
- for_symbols("newline") { shift_to 3 }
658
+ at_state(29) {
659
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "^", "newline", ")", "*") { reduce_with "literal" }
633
660
  }
634
661
 
635
- at_state(30) {
636
- for_symbols("(") { reduce_with "function_name" }
637
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", "=", ">", "^", "newline", ")", "*") { reduce_with "variable_name" }
662
+ at_state(101) {
663
+ for_symbols("_End_", "newline") { reduce_with "main_body_if_else_statement" }
638
664
  }
639
665
 
640
- at_state(44) {
641
- for_symbols("(") { shift_to 45 }
666
+ at_state(90) {
667
+ for_symbols("(") { shift_to 6 }
668
+ for_symbols("numeric_literal") { shift_to 29 }
669
+ for_symbols("expression") { shift_to 91 }
670
+ for_symbols("word_literal") { shift_to 4 }
671
+ for_symbols("function_name") { shift_to 7 }
672
+ for_symbols("var_name") { shift_to 28 }
673
+ for_symbols("-") { shift_to 32 }
674
+ for_symbols("!") { shift_to 30 }
642
675
  }
643
676
 
644
- at_state(21) {
645
- for_symbols("expression") { shift_to 22 }
646
- for_symbols("-") { shift_to 7 }
647
- for_symbols("!") { shift_to 34 }
648
- for_symbols("numeric_literal") { shift_to 6 }
649
- for_symbols("(") { shift_to 31 }
650
- for_symbols("word_literal") { shift_to 30 }
651
- for_symbols("var_name") { shift_to 29 }
652
- for_symbols("function_name") { shift_to 8 }
677
+ at_state(88) {
678
+ for_symbols("(") { shift_to 6 }
679
+ for_symbols("numeric_literal") { shift_to 29 }
680
+ for_symbols("word_literal") { shift_to 4 }
681
+ for_symbols("function_name") { shift_to 7 }
682
+ for_symbols("expression") { shift_to 89 }
683
+ for_symbols("var_name") { shift_to 28 }
684
+ for_symbols("-") { shift_to 32 }
685
+ for_symbols("!") { shift_to 30 }
653
686
  }
654
687
 
655
- at_state(80) {
656
- for_symbols("newline") { reduce_with "function_body_while_statement" }
688
+ at_state(85) {
689
+ for_symbols("newline") { reduce_with "function_body_simple_statement" }
657
690
  }
658
691
 
659
- at_state(79) {
660
- for_symbols("while") { shift_to 75 }
661
- for_symbols("if") { shift_to 52 }
662
- for_symbols("newline") { shift_to 2 }
663
- for_symbols("var_name") { shift_to 61 }
664
- for_symbols("print") { shift_to 5 }
665
- for_symbols("word_literal") { shift_to 30 }
666
- for_symbols("end") { shift_to 80 }
667
- for_symbols("return") { shift_to 59 }
668
- for_symbols("function_name") { shift_to 55 }
669
- for_symbols("simple_statement") { shift_to 64 }
670
- for_symbols("function_body_statement") { shift_to 74 }
692
+ at_state(70) {
693
+ for_symbols("while") { shift_to 68 }
694
+ for_symbols("newline") { shift_to 51 }
695
+ for_symbols("return") { shift_to 86 }
696
+ for_symbols("if") { shift_to 74 }
697
+ for_symbols("simple_statement") { shift_to 85 }
698
+ for_symbols("function_body_statement") { shift_to 63 }
699
+ for_symbols("var_name") { shift_to 44 }
700
+ for_symbols("word_literal") { shift_to 4 }
701
+ for_symbols("function_body") { shift_to 71 }
702
+ for_symbols("function_name") { shift_to 40 }
703
+ for_symbols("print") { shift_to 88 }
671
704
  }
672
705
 
673
- at_state(52) {
674
- for_symbols("-") { shift_to 7 }
675
- for_symbols("!") { shift_to 34 }
676
- for_symbols("numeric_literal") { shift_to 6 }
677
- for_symbols("(") { shift_to 31 }
678
- for_symbols("word_literal") { shift_to 30 }
679
- for_symbols("var_name") { shift_to 29 }
680
- for_symbols("expression") { shift_to 53 }
681
- for_symbols("function_name") { shift_to 8 }
706
+ at_state(1) {
707
+ for_symbols("word_literal", "def", "end", "print", "else", "if", "_End_", "return", "newline", "while") { reduce_with "single_term" }
682
708
  }
683
709
 
684
- at_state(1) {
685
- for_symbols("newline") { shift_to 2 }
686
- for_symbols("word_literal", "def", "print", "if", "while") { reduce_with "some_terms" }
710
+ at_state(38) {
711
+ for_symbols("newline") { shift_to 1 }
712
+ for_symbols("^") { shift_to 14 }
713
+ for_symbols("<") { shift_to 24 }
714
+ for_symbols("+") { shift_to 22 }
715
+ for_symbols("-") { shift_to 26 }
716
+ for_symbols("/") { shift_to 20 }
717
+ for_symbols("terms") { shift_to 39 }
718
+ for_symbols("*") { shift_to 16 }
719
+ for_symbols(">") { shift_to 12 }
720
+ for_symbols("==") { shift_to 18 }
687
721
  }
688
722
 
689
- at_state(4) {
690
- for_symbols("main_body") { shift_to 103 }
691
- for_symbols("while") { shift_to 88 }
692
- for_symbols("var_name") { shift_to 61 }
693
- for_symbols("print") { shift_to 5 }
694
- for_symbols("word_literal") { shift_to 30 }
695
- for_symbols("if") { shift_to 40 }
696
- for_symbols("main_body_statement") { shift_to 87 }
697
- for_symbols("def") { shift_to 43 }
698
- for_symbols("function_name") { shift_to 55 }
699
- for_symbols("simple_statement") { shift_to 86 }
723
+ at_state(25) {
724
+ for_symbols("^") { shift_to 14 }
725
+ for_symbols("+") { shift_to 22 }
726
+ for_symbols("-") { shift_to 26 }
727
+ for_symbols("/") { shift_to 20 }
728
+ for_symbols("==", ",", "_End_", "newline", ")") { reduce_with "less_than_comparison" }
729
+ for_symbols("*") { shift_to 16 }
700
730
  }
701
731
 
702
- at_state(49) {
703
- for_symbols(",", ")") { reduce_with "multiple_arg_declarations" }
732
+ at_state(40) {
733
+ for_symbols("(") { shift_to 41 }
704
734
  }
705
735
 
706
- at_state(16) {
707
- for_symbols("==", "+", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "multiplication" }
708
- for_symbols("^") { shift_to 19 }
736
+ at_state(64) {
737
+ for_symbols("newline") { shift_to 1 }
738
+ for_symbols("terms") { shift_to 65 }
709
739
  }
710
740
 
711
- at_state(18) {
712
- for_symbols("*") { shift_to 15 }
713
- for_symbols("/") { shift_to 13 }
714
- for_symbols("^") { shift_to 19 }
715
- for_symbols("==", "+", ",", "-", "<", "_End_", ">", "newline", ")") { reduce_with "subtraction" }
741
+ at_state(84) {
742
+ for_symbols("newline") { reduce_with "function_body_if_else_statement" }
716
743
  }
717
744
 
718
- at_state(87) {
719
- for_symbols("_End_", "newline") { reduce_with "single_main_body_statement" }
745
+ at_state(71) {
746
+ for_symbols("newline") { shift_to 1 }
747
+ for_symbols("terms") { shift_to 72 }
720
748
  }
721
749
 
722
- at_state(45) {
723
- for_symbols("arg_decl") { shift_to 84 }
724
- for_symbols("word_literal") { shift_to 48 }
725
- for_symbols(",", ")") { reduce_with "no_arg_decl" }
726
- for_symbols("arg_declarations") { shift_to 46 }
750
+ at_state(18) {
751
+ for_symbols("(") { shift_to 6 }
752
+ for_symbols("numeric_literal") { shift_to 29 }
753
+ for_symbols("word_literal") { shift_to 4 }
754
+ for_symbols("function_name") { shift_to 7 }
755
+ for_symbols("expression") { shift_to 19 }
756
+ for_symbols("var_name") { shift_to 28 }
757
+ for_symbols("-") { shift_to 32 }
758
+ for_symbols("!") { shift_to 30 }
727
759
  }
728
760
 
729
- at_state(7) {
730
- for_symbols("-") { shift_to 7 }
731
- for_symbols("!") { shift_to 34 }
732
- for_symbols("expression") { shift_to 38 }
733
- for_symbols("numeric_literal") { shift_to 6 }
734
- for_symbols("(") { shift_to 31 }
735
- for_symbols("word_literal") { shift_to 30 }
736
- for_symbols("var_name") { shift_to 29 }
737
- for_symbols("function_name") { shift_to 8 }
761
+ at_state(44) {
762
+ for_symbols("=") { shift_to 45 }
738
763
  }
739
764
 
740
- at_state(13) {
741
- for_symbols("-") { shift_to 7 }
742
- for_symbols("!") { shift_to 34 }
743
- for_symbols("numeric_literal") { shift_to 6 }
744
- for_symbols("(") { shift_to 31 }
745
- for_symbols("expression") { shift_to 14 }
746
- for_symbols("word_literal") { shift_to 30 }
747
- for_symbols("var_name") { shift_to 29 }
748
- for_symbols("function_name") { shift_to 8 }
765
+ at_state(55) {
766
+ for_symbols("arg_decl") { shift_to 56 }
767
+ for_symbols(",", ")") { reduce_with "no_arg_decl" }
768
+ for_symbols("arg_declarations") { shift_to 58 }
769
+ for_symbols("word_literal") { shift_to 57 }
749
770
  }
750
771
 
751
- at_state(19) {
752
- for_symbols("-") { shift_to 7 }
753
- for_symbols("!") { shift_to 34 }
754
- for_symbols("numeric_literal") { shift_to 6 }
755
- for_symbols("(") { shift_to 31 }
756
- for_symbols("expression") { shift_to 20 }
757
- for_symbols("word_literal") { shift_to 30 }
758
- for_symbols("var_name") { shift_to 29 }
759
- for_symbols("function_name") { shift_to 8 }
772
+ at_state(65) {
773
+ for_symbols("while") { shift_to 68 }
774
+ for_symbols("newline") { shift_to 51 }
775
+ for_symbols("return") { shift_to 86 }
776
+ for_symbols("end") { shift_to 67 }
777
+ for_symbols("if") { shift_to 74 }
778
+ for_symbols("simple_statement") { shift_to 85 }
779
+ for_symbols("var_name") { shift_to 44 }
780
+ for_symbols("word_literal") { shift_to 4 }
781
+ for_symbols("function_body_statement") { shift_to 66 }
782
+ for_symbols("function_name") { shift_to 40 }
783
+ for_symbols("print") { shift_to 88 }
760
784
  }
761
785
 
762
- at_state(90) {
763
- for_symbols("while") { shift_to 88 }
764
- for_symbols("newline") { shift_to 2 }
765
- for_symbols("var_name") { shift_to 61 }
766
- for_symbols("print") { shift_to 5 }
767
- for_symbols("word_literal") { shift_to 30 }
768
- for_symbols("main_body") { shift_to 91 }
769
- for_symbols("if") { shift_to 40 }
770
- for_symbols("main_body_statement") { shift_to 87 }
771
- for_symbols("def") { shift_to 43 }
772
- for_symbols("function_name") { shift_to 55 }
773
- for_symbols("simple_statement") { shift_to 86 }
786
+ at_state(21) {
787
+ for_symbols("^") { shift_to 14 }
788
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", ">", "newline", ")", "*") { reduce_with "division" }
774
789
  }
775
790
 
776
- at_state(82) {
777
- for_symbols("while") { shift_to 75 }
778
- for_symbols("if") { shift_to 52 }
779
- for_symbols("newline") { shift_to 2 }
780
- for_symbols("var_name") { shift_to 61 }
781
- for_symbols("print") { shift_to 5 }
782
- for_symbols("word_literal") { shift_to 30 }
783
- for_symbols("end") { shift_to 83 }
784
- for_symbols("return") { shift_to 59 }
785
- for_symbols("function_name") { shift_to 55 }
786
- for_symbols("simple_statement") { shift_to 64 }
787
- for_symbols("function_body_statement") { shift_to 74 }
791
+ at_state(95) {
792
+ for_symbols("_End_", "newline") { reduce_with "main_body_if_statement" }
788
793
  }
789
794
 
790
- at_state(81) {
791
- for_symbols("newline") { shift_to 3 }
792
- for_symbols("terms") { shift_to 82 }
795
+ at_state(93) {
796
+ for_symbols("newline") { shift_to 1 }
797
+ for_symbols("terms") { shift_to 94 }
793
798
  }
794
799
 
795
- at_state(64) {
796
- for_symbols("newline") { reduce_with "function_body_simple_statement" }
800
+ at_state(36) {
801
+ for_symbols("^") { shift_to 14 }
802
+ for_symbols("<") { shift_to 24 }
803
+ for_symbols(")") { shift_to 37 }
804
+ for_symbols("+") { shift_to 22 }
805
+ for_symbols("-") { shift_to 26 }
806
+ for_symbols("/") { shift_to 20 }
807
+ for_symbols("*") { shift_to 16 }
808
+ for_symbols(">") { shift_to 12 }
809
+ for_symbols("==") { shift_to 18 }
797
810
  }
798
811
 
799
- at_state(56) {
800
- for_symbols("-") { shift_to 7 }
801
- for_symbols("!") { shift_to 34 }
802
- for_symbols("arg_list") { shift_to 57 }
803
- for_symbols(",", ")") { reduce_with "no_args" }
804
- for_symbols("numeric_literal") { shift_to 6 }
805
- for_symbols("(") { shift_to 31 }
806
- for_symbols("word_literal") { shift_to 30 }
807
- for_symbols("var_name") { shift_to 29 }
808
- for_symbols("function_name") { shift_to 8 }
809
- for_symbols("expression") { shift_to 37 }
812
+ at_state(42) {
813
+ for_symbols(",") { shift_to 10 }
814
+ for_symbols(")") { shift_to 43 }
810
815
  }
811
816
 
812
- at_state(0) {
813
- for_symbols("opt_terms") { shift_to 4 }
814
- for_symbols("terms") { shift_to 1 }
815
- for_symbols("newline") { shift_to 3 }
816
- for_symbols("word_literal", "def", "print", "if", "while") { reduce_with "no_terms" }
817
+ at_state(26) {
818
+ for_symbols("(") { shift_to 6 }
819
+ for_symbols("numeric_literal") { shift_to 29 }
820
+ for_symbols("expression") { shift_to 27 }
821
+ for_symbols("word_literal") { shift_to 4 }
822
+ for_symbols("function_name") { shift_to 7 }
823
+ for_symbols("var_name") { shift_to 28 }
824
+ for_symbols("-") { shift_to 32 }
825
+ for_symbols("!") { shift_to 30 }
817
826
  }
818
827
 
819
- at_state(47) {
820
- for_symbols("arg_decl") { shift_to 49 }
821
- for_symbols("word_literal") { shift_to 48 }
828
+ at_state(5) {
829
+ for_symbols("(") { shift_to 6 }
830
+ for_symbols("expression") { shift_to 38 }
831
+ for_symbols("numeric_literal") { shift_to 29 }
832
+ for_symbols("word_literal") { shift_to 4 }
833
+ for_symbols("function_name") { shift_to 7 }
834
+ for_symbols("var_name") { shift_to 28 }
835
+ for_symbols("-") { shift_to 32 }
836
+ for_symbols("!") { shift_to 30 }
822
837
  }
823
838
 
824
- at_state(103) {
825
- for_symbols("opt_terms") { shift_to 105 }
826
- for_symbols("terms") { shift_to 104 }
827
- for_symbols("newline") { shift_to 3 }
828
- for_symbols("_End_") { reduce_with "no_terms" }
839
+ at_state(41) {
840
+ for_symbols("(") { shift_to 6 }
841
+ for_symbols("arg_list") { shift_to 42 }
842
+ for_symbols(",", ")") { reduce_with "no_args" }
843
+ for_symbols("numeric_literal") { shift_to 29 }
844
+ for_symbols("word_literal") { shift_to 4 }
845
+ for_symbols("function_name") { shift_to 7 }
846
+ for_symbols("var_name") { shift_to 28 }
847
+ for_symbols("-") { shift_to 32 }
848
+ for_symbols("!") { shift_to 30 }
849
+ for_symbols("expression") { shift_to 35 }
829
850
  }
830
851
 
831
- at_state(96) {
832
- for_symbols("else") { shift_to 98 }
833
- for_symbols("while") { shift_to 88 }
834
- for_symbols("end") { shift_to 97 }
835
- for_symbols("newline") { shift_to 2 }
836
- for_symbols("var_name") { shift_to 61 }
837
- for_symbols("print") { shift_to 5 }
838
- for_symbols("main_body_statement") { shift_to 94 }
839
- for_symbols("word_literal") { shift_to 30 }
840
- for_symbols("if") { shift_to 40 }
841
- for_symbols("def") { shift_to 43 }
842
- for_symbols("function_name") { shift_to 55 }
843
- for_symbols("simple_statement") { shift_to 86 }
852
+ at_state(45) {
853
+ for_symbols("(") { shift_to 6 }
854
+ for_symbols("numeric_literal") { shift_to 29 }
855
+ for_symbols("expression") { shift_to 46 }
856
+ for_symbols("word_literal") { shift_to 4 }
857
+ for_symbols("function_name") { shift_to 7 }
858
+ for_symbols("var_name") { shift_to 28 }
859
+ for_symbols("-") { shift_to 32 }
860
+ for_symbols("!") { shift_to 30 }
844
861
  }
845
862
 
846
- at_state(72) {
847
- for_symbols("while") { shift_to 75 }
848
- for_symbols("if") { shift_to 52 }
849
- for_symbols("end") { shift_to 73 }
850
- for_symbols("newline") { shift_to 2 }
851
- for_symbols("var_name") { shift_to 61 }
852
- for_symbols("print") { shift_to 5 }
853
- for_symbols("word_literal") { shift_to 30 }
854
- for_symbols("return") { shift_to 59 }
855
- for_symbols("function_name") { shift_to 55 }
856
- for_symbols("simple_statement") { shift_to 64 }
857
- for_symbols("function_body_statement") { shift_to 74 }
863
+ at_state(4) {
864
+ for_symbols("(") { reduce_with "function_name" }
865
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", "=", ">", "^", "newline", ")", "*") { reduce_with "variable_name" }
858
866
  }
859
867
 
860
- at_state(42) {
861
- for_symbols("while") { shift_to 88 }
862
- for_symbols("main_body") { shift_to 95 }
863
- for_symbols("newline") { shift_to 2 }
864
- for_symbols("var_name") { shift_to 61 }
865
- for_symbols("print") { shift_to 5 }
866
- for_symbols("word_literal") { shift_to 30 }
867
- for_symbols("if") { shift_to 40 }
868
- for_symbols("main_body_statement") { shift_to 87 }
869
- for_symbols("def") { shift_to 43 }
870
- for_symbols("function_name") { shift_to 55 }
871
- for_symbols("simple_statement") { shift_to 86 }
868
+ at_state(23) {
869
+ for_symbols("^") { shift_to 14 }
870
+ for_symbols("/") { shift_to 20 }
871
+ for_symbols("+", "==", ",", "-", "<", "_End_", ">", "newline", ")") { reduce_with "addition" }
872
+ for_symbols("*") { shift_to 16 }
872
873
  }
873
874
 
874
- at_state(10) {
875
- for_symbols(",") { shift_to 11 }
876
- for_symbols(")") { shift_to 36 }
875
+ at_state(34) {
876
+ for_symbols("+", "==", ",", "-", "/", "<", "_End_", "^", ">", "newline", ")", "*") { reduce_with "function_call_expression" }
877
877
  }
878
878
 
879
879
  end