[Prime-cvs] CVS update: prime/lib/grammar

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 3月 7日 (月) 16:51:33 JST


Index: prime/lib/grammar/grammar.rb
diff -u prime/lib/grammar/grammar.rb:1.2 prime/lib/grammar/grammar.rb:1.3
--- prime/lib/grammar/grammar.rb:1.2	Fri Mar 26 02:19:50 2004
+++ prime/lib/grammar/grammar.rb	Mon Mar  7 16:51:33 2005
@@ -1,5 +1,5 @@
 # prime/grammar/grammar.rb
-# $Id: grammar.rb,v 1.2 2004/03/25 17:19:50 komatsu Exp $
+# $Id: grammar.rb,v 1.3 2005/03/07 07:51:33 komatsu Exp $
 #
 # Copyright (C) 2002 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -46,7 +46,7 @@
 
   def lookup_katsuyou (parent, string, prefix="")
     debug_message("lookup_katsuyou('#{parent}', '#{string}', '#{prefix})'")
-    if string == "" then # $B$b$C$H$7$C$+$j<BAu$7$h$&(B (parent $B$NBEEv @ -$N%A%'%C%/(B)
+    if string == "" then # もっとしっかり実装しよう (parent の妥当性のチェック)
       return [[""]]
     end
 
@@ -57,12 +57,15 @@
 	if string[0,ancillary.string.length] == ancillary.string then
 	  next_string = string[ancillary.string.length..-1]
 	  pos = (ancillary.name == "*" ? parent : ancillary.name)
+
+          prefix_string = prefix + ancillary.string
+#          prefix_string = prefix + " #{ancillary.string}(#{pos})"
 	  if ancillary.terminal then
-	    results.push([prefix + ancillary.string, next_string, pos])
+	    results.push([prefix_string, next_string, pos])
 	  end
 	  if next_string.length > 0 then
 	    results = results + lookup_katsuyou(ancillary.name, next_string,
-						prefix + ancillary.string)
+                                                prefix_string)
 	  end
 	end
       }


Prime-cvs メーリングリストの案内
Back to archive index