forked from thepowersgang/mrustc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d29fda
commit e1a5155
Showing
11 changed files
with
102 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
*/ | ||
#ifndef AST_PATH_HPP_INCLUDED | ||
#define AST_PATH_HPP_INCLUDED | ||
|
||
#include <string> | ||
#include <stdexcept> | ||
|
||
class TypeRef; | ||
|
||
namespace AST { | ||
|
||
class TypeParam | ||
{ | ||
public: | ||
TypeParam(bool is_lifetime, ::std::string name); | ||
void addLifetimeBound(::std::string name); | ||
void addTypeBound(TypeRef type); | ||
}; | ||
|
||
typedef ::std::vector<TypeParam> TypeParams; | ||
typedef ::std::pair< ::std::string, TypeRef> StructItem; | ||
|
||
class PathNode | ||
{ | ||
::std::string m_name; | ||
::std::vector<TypeRef> m_params; | ||
public: | ||
PathNode(::std::string name, ::std::vector<TypeRef> args); | ||
const ::std::string& name() const; | ||
const ::std::vector<TypeRef>& args() const; | ||
}; | ||
|
||
class Path | ||
{ | ||
public: | ||
Path(); | ||
struct TagAbsolute {}; | ||
Path(TagAbsolute); | ||
|
||
void append(PathNode node) {} | ||
size_t length() const {return 0;} | ||
|
||
PathNode& operator[](size_t idx) { throw ::std::out_of_range("Path []"); } | ||
}; | ||
|
||
} // namespace AST | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
*/ | ||
#ifndef COMMON_HPP_INCLUDED | ||
#define COMMON_HPP_INCLUDED | ||
|
||
#define FOREACH(basetype, it, src) for(basetype::const_iterator it = src.begin(); it != src.end(); ++ it) | ||
#define FOREACH_M(basetype, it, src) for(basetype::iterator it = src.begin(); it != src.end(); ++ it) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
*/ | ||
#include "types.hpp" | ||
#include "ast/ast.hpp" | ||
|
||
TypeRef::TypeRef(TypeRef::TagSizedArray, TypeRef inner, AST::Expr size_expr) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
#include <vector> | ||
#include "coretypes.hpp" | ||
#include "ast/path.hpp" | ||
|
||
namespace AST { | ||
class Expr; | ||
|