parser: use xss comments to clean make output
[nit.git] / src / parser / xss / prods.xss
index cd2f9df..c258b5b 100644 (file)
@@ -1,20 +1,19 @@
-/* This file is part of NIT ( http://www.nitlanguage.org ).
- *
- * Copyright 2008 Jean Privat <jean@pryen.org>
- * Based on algorithms developped for ( http://www.sablecc.org/ ).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+$ // This file is part of NIT ( http://www.nitlanguage.org ).
+$ //
+$ // Copyright 2008 Jean Privat <jean@pryen.org>
+$ // Based on algorithms developped for ( http://www.sablecc.org/ ).
+$ //
+$ // Licensed under the Apache License, Version 2.0 (the "License");
+$ // you may not use this file except in compliance with the License.
+$ // You may obtain a copy of the License at
+$ //
+$ //     http://www.apache.org/licenses/LICENSE-2.0
+$ //
+$ // Unless required by applicable law or agreed to in writing, software
+$ // distributed under the License is distributed on an "AS IS" BASIS,
+$ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+$ // See the License for the specific language governing permissions and
+$ // limitations under the License.
 
 $ template make_abs_prods()
 $ set baseprod = {//prod/@ename}
@@ -28,12 +27,12 @@ class @ename
 special ${../@ename}
 $ foreach {elem}
 $   if @is_list
-    readable writable attr _n_@name: List[@etype] = new List[@etype]
+    readable writable var _n_@name: List[@etype] = new List[@etype]
 $   else
 $   if @modifier
-    readable writable attr _n_@name: nullable @etype = null
+    readable writable var _n_@name: nullable @etype = null
 $   else
-    readable writable attr _n_@name: @etype
+    readable writable var _n_@name: @etype
 $   end
 $   end
 $ end
@@ -42,8 +41,8 @@ $ end
 
 class Start
 special Prod
-    readable writable attr _n_base: nullable $baseprod 
-    readable writable attr _n_eof: EOF 
+    readable writable var _n_base: nullable $baseprod
+    readable writable var _n_eof: EOF
 end
 $ end template
 
@@ -54,7 +53,7 @@ redef class @ename
 $ foreach {elem}
 $   if @is_list
 $   else
-    redef meth n_@name=(n)
+    redef fun n_@name=(n)
     do
         _n_@name = n
 $   if @modifier
@@ -74,9 +73,9 @@ $ if {count(elem)!=0}
     init init_${translate(@ename,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")} (
 $ foreach {elem}
 $   if {@is_list}
-            n_@{name}: Collection[Object] [-sep ','-] # Should be Collection[@etype]
+            n_@{name}: Collection[Object][-sep ','-] # Should be Collection[@etype]
 $   else
-            n_@{name}: nullable @etype [-sep ','-]
+            n_@{name}: nullable @etype[-sep ','-]
 $   end
 $ end
     )
@@ -106,7 +105,7 @@ $   end
 $ end
     end
 
-    redef meth replace_child(old_child: PNode, new_child: nullable PNode)
+    redef fun replace_child(old_child: PNode, new_child: nullable PNode)
     do
 $ foreach {elem}
 $   if @is_list
@@ -141,43 +140,43 @@ $   end
 $ end foreach
     end
 
-    redef meth visit_all(v: Visitor)
+    redef fun visit_all(v: Visitor)
     do
 $   foreach {elem}
 $     if @is_list
             for n in _n_@{name} do
-                v.visit(n)
+                v.enter_visit(n)
            end
 $     else
 $       if @modifier
         if _n_@{name} != null then
-            v.visit(_n_@{name}.as(not null))
+            v.enter_visit(_n_@{name}.as(not null))
         end
 $       else
-        v.visit(_n_@{name})
+        v.enter_visit(_n_@{name})
 $       end
 $     end
 $   end foreach
     end
 
-    redef meth visit_all_reverse(v: Visitor)
+    redef fun visit_all_reverse(v: Visitor)
     do
 $   foreach {elem}
 $     if @is_list
        do
            var i = _n_@{name}.length
             while i >= 0 do
-                v.visit(_n_@{name}[i])
+                v.enter_visit(_n_@{name}[i])
                i = i - 1
            end
        end
 $     else
 $       if @modifier
         if _n_@{name} != null then
-            v.visit(_n_@{name}.as(not null))
+            v.enter_visit(_n_@{name}.as(not null))
         end
 $       else
-        v.visit(_n_@{name})
+        v.enter_visit(_n_@{name})
 $       end
 $     end
 $   end foreach
@@ -194,7 +193,7 @@ redef class Start
         _n_eof = n_eof
     end
 
-    redef meth replace_child(old_child: PNode, new_child: nullable PNode)
+    redef fun replace_child(old_child: PNode, new_child: nullable PNode)
     do
         if _n_base == old_child then
             if new_child == null then
@@ -208,17 +207,17 @@ redef class Start
        end
     end
 
-    redef meth visit_all(v: Visitor)
+    redef fun visit_all(v: Visitor)
     do
         if _n_base != null then
-            v.visit(_n_base.as(not null))
+            v.enter_visit(_n_base.as(not null))
         end
     end
 
-    redef meth visit_all_reverse(v: Visitor)
+    redef fun visit_all_reverse(v: Visitor)
     do
         if _n_base != null then
-            v.visit(_n_base.as(not null))
+            v.enter_visit(_n_base.as(not null))
         end
     end
 end