From a05187d849d11efca8c69aee77bda5db85546ecb Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 4 Dec 2008 20:06:28 +0100 Subject: [PATCH] Adds some type nodes to the ast --- src/ast/generator.cc | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/ast/generator.cc b/src/ast/generator.cc index 57e31c7..4216ef6 100644 --- a/src/ast/generator.cc +++ b/src/ast/generator.cc @@ -4,16 +4,46 @@ static ast::generator::Node nodes[] = { {"Node", "", {""}}, - {"Function", "Node", { + /* Types */ + {"Type", "Node", { {"std::string", "name"}, - {"ast::Type*", "returnType"}, - {"std::vector", "params"}, + {"unsigned", "size"}, + {"bool", "const"}, {""} } }, - {"Type", "Node", { - {"std::string", "name"}, + {"Number", "Type", { + {""} + } + }, + + {"Integer", "Number", { + {""} + } + }, + + {"Float", "Number", { + {""} + } + }, + + {"Pointer", "Type", { + {"ast::Type*", "type"}, + {""} + } + }, + + {"Enum", "Type", { + {"ast::Type*", "type"}, + {"unsigned", "count"}, + /* FIXME: elements */ + {""} + } + }, + + {"Array", "Type", { + {"ast::Type*", "type"}, {""} } }, @@ -25,11 +55,21 @@ static ast::generator::Node nodes[] = { } }, + /* Expressions */ {"Exp", "Node", { {""} } }, + /* Functions */ + {"Function", "Node", { + {"std::string", "name"}, + {"ast::Type*", "returnType"}, + {"std::vector", "params"}, + {""} + } + }, + {"", ""} }; -- 2.11.4.GIT