README: document nit_env.sh
[nit.git] / lib / gen_nit.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Support to generate and otherwise manipulate Nit code
16 module gen_nit
17
18 redef class Sys
19 # Reserved keywords in the Nit language
20 var keywords: Set[String] is lazy do return new HashSet[String].from([
21 "abort", "abstract", "and", "assert", "break", "class", "continue",
22 "do", "else", "end", "enum", "extern", "false", "implies", "import",
23 "init", "interface", "intrude", "if", "in", "is", "isa", "isset",
24 "for", "label", "loop", "module", "new", "not", "null", "nullable",
25 "or", "package", "private", "protected", "public", "return", "self",
26 "super", "then", "true", "type", "var", "while"])
27
28 # Top-level methods from the `Object` class
29 #
30 # This is a non-exaustive list that targets conflict-prone names.
31 var methods_in_object: Array[String] is lazy do return [
32 "class_name", "get_time", "hash", "inspect", "inspect_head",
33 "is_same_type", "is_same_instance", "object_id", "output",
34 "output_class_name", "sys", "to_s"]
35
36 # Methods in the `Pointer` class
37 #
38 # This is a non-exaustive list that targets conflict-prone names.
39 var methods_in_pointer: Array[String] is lazy do return methods_in_object + [
40 "free"]
41 end