Merge branch 'pu/parser_tables_in_c' into wip
[nit.git] / src / parser / xss / main.xss
index a867481..ba1360b 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.
 
 $ include 'nodes.xss'
 $ include 'lexer.xss'
@@ -24,10 +23,10 @@ $ include 'prods.xss'
 
 $ output 'parser_abs.nit'
 # Raw AST node hierarchy.
-# This file was generated by SableCC (http://www.sablecc.org/). 
+# This file was generated by SableCC (http://www.sablecc.org/).
 package parser_abs
 
-import mmloader
+import location
 
 $ call make_abs_nodes()
 $ call make_abs_tokens()
@@ -44,13 +43,14 @@ intrude import $usermodule
 $ else
 intrude import parser_abs
 $ end
+private import tables
 $ call make_tokens()
 $ call make_lexer()
 $ end output
 
 $ output 'parser_prod.nit'
 # Production AST nodes full definition.
-# This file was generated by SableCC (http://www.sablecc.org/). 
+# This file was generated by SableCC (http://www.sablecc.org/).
 package parser_prod
 
 import lexer
@@ -59,26 +59,26 @@ intrude import $usermodule
 $ else
 intrude import parser_abs
 $ end
+private import tables
 
 $ call make_nodes()
 $ call make_prods()
 $ end output
 
-$ output 'parser_tables.nit'
-# Tables used by the parser.
-# This file was generated by SableCC (http://www.sablecc.org/). 
-package parser_tables
-
-$ call make_parser_tables()
-$ end output
-
 $ output 'parser.nit'
 # Parser.
-# This file was generated by SableCC (http://www.sablecc.org/). 
+# This file was generated by SableCC (http://www.sablecc.org/).
 package parser
 
 intrude import parser_prod
-intrude import parser_tables
 $ call make_parser()
 $ end output
 
+$ output 'tables_nit.c'
+/* This file was generated by SableCC (http://www.sablecc.org/). */
+#include <stdlib.h>
+#include "tables_nit.h"
+
+$ call make_lexer_table()
+$ call make_parser_table()
+$ end output