2020-11-10 21:37:30 +00:00
|
|
|
/*
|
|
|
|
Serene --- Yet an other Lisp
|
|
|
|
|
|
|
|
Copyright (c) 2020 Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-11-14 10:51:25 +00:00
|
|
|
// Package ast provides the functionality and data structures around the
|
|
|
|
// Serene's AST.
|
|
|
|
package ast
|
2020-11-10 21:37:30 +00:00
|
|
|
|
2020-11-14 10:51:25 +00:00
|
|
|
type NodeType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
Nil NodeType = iota
|
2020-11-19 22:17:50 +00:00
|
|
|
Nothing
|
2021-01-14 18:17:38 +00:00
|
|
|
Bool
|
2020-12-25 22:01:59 +00:00
|
|
|
Instruction
|
2020-11-14 10:51:25 +00:00
|
|
|
Symbol
|
2020-12-15 19:08:51 +00:00
|
|
|
Keyword
|
2020-11-14 12:22:13 +00:00
|
|
|
Number
|
2020-11-14 10:51:25 +00:00
|
|
|
List
|
2020-11-19 19:14:06 +00:00
|
|
|
Fn
|
2020-12-15 19:08:51 +00:00
|
|
|
NativeFn
|
2020-12-12 20:26:26 +00:00
|
|
|
Namespace
|
2020-12-16 22:40:59 +00:00
|
|
|
String
|
2020-11-19 22:17:50 +00:00
|
|
|
Block // Dont' mistake it with block from other programming languages
|
2020-12-15 19:08:51 +00:00
|
|
|
|
2020-11-14 10:51:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ITypable interface {
|
|
|
|
GetType() NodeType
|
2020-11-10 21:37:30 +00:00
|
|
|
}
|