parser: move things from parser_prod to parser_nodes
[nit.git] / src / parser / xss / main.xss
1 $ // This file is part of NIT ( http://www.nitlanguage.org ).
2 $ //
3 $ // Copyright 2008 Jean Privat <jean@pryen.org>
4 $ // Based on algorithms developped for ( http://www.sablecc.org/ ).
5 $ //
6 $ // Licensed under the Apache License, Version 2.0 (the "License");
7 $ // you may not use this file except in compliance with the License.
8 $ // You may obtain a copy of the License at
9 $ //
10 $ //     http://www.apache.org/licenses/LICENSE-2.0
11 $ //
12 $ // Unless required by applicable law or agreed to in writing, software
13 $ // distributed under the License is distributed on an "AS IS" BASIS,
14 $ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 $ // See the License for the specific language governing permissions and
16 $ // limitations under the License.
17
18 $ include 'lexer.xss'
19 $ include 'parser.xss'
20 $ include 'tokens.xss'
21 $ include 'prods.xss'
22
23 $ output 'parser_abs.nit'
24 # Raw AST node hierarchy.
25 # This file was generated by SableCC (http://www.sablecc.org/).
26 package parser_abs
27
28 import location
29
30 $ call make_abs_tokens()
31 $ call make_abs_prods()
32 $ end output
33
34 $ output 'lexer.nit'
35 # Lexer and its tokens.
36 # This file was generated by SableCC (http://www.sablecc.org/).
37 package lexer
38
39 $ if $usermodule
40 intrude import $usermodule
41 $ else
42 intrude import parser_abs
43 $ end
44 private import tables
45 $ call make_tokens()
46 $ call make_lexer()
47 $ end output
48
49 $ output 'parser_prod.nit'
50 # Production AST nodes full definition.
51 # This file was generated by SableCC (http://www.sablecc.org/).
52 package parser_prod
53
54 import lexer
55 $ if $usermodule
56 intrude import $usermodule
57 $ else
58 intrude import parser_abs
59 $ end
60 private import tables
61
62 $ call make_prods()
63 $ end output
64
65 $ output 'parser.nit'
66 # Parser.
67 # This file was generated by SableCC (http://www.sablecc.org/).
68 package parser
69
70 intrude import parser_prod
71 import tables
72 $ call make_parser()
73 $ end output
74
75 $ output 'tables_nit.c'
76 /* This file was generated by SableCC (http://www.sablecc.org/). */
77 #include <stdlib.h>
78 #include "tables_nit.h"
79
80 $ call make_lexer_table()
81 $ call make_parser_table()
82 $ end output