@@ -25,14 +25,21 @@ class Argument {
2525// Represents the "prototype" for a function, which captures its name, and its
2626// argument names (thus implicitly the number of arguments the function takes).
2727class FunctionInterface : public Node {
28- VariableList *args_;
29- TypeDeclarationList *returnTypes_;
3028public:
31- FunctionInterface (VariableList *args = 0 , TypeDeclarationList *returnTypes = 0 )
32- : Node(TFunctionInterface), args_(args), returnTypes_(returnTypes) {}
29+ FunctionInterface (VariableList *args = 0 ,
30+ TypeDeclarationList *returnTypes = 0 ,
31+ bool isPublic = false )
32+ : Node(TFunctionInterface), args_(args), returnTypes_(returnTypes), isPublic_(isPublic) {}
3333
3434 VariableList *args () const { return args_; }
3535 TypeDeclarationList *returnTypes () const { return returnTypes_; }
36+
37+ bool isPublic () const { return isPublic_; }
38+ void setIsPublic (bool isPublic) { isPublic_ = isPublic; }
39+
40+ bool declaresReturnTypes () const {
41+ return returnTypes_ != 0 && returnTypes_->size () != 0 ;
42+ }
3643
3744 virtual std::string toString (int level = 0 ) const {
3845 std::ostringstream ss;
@@ -59,6 +66,11 @@ class FunctionInterface : public Node {
5966 ss << ' >' ;
6067 return ss.str ();
6168 }
69+
70+ private:
71+ VariableList *args_;
72+ TypeDeclarationList *returnTypes_;
73+ bool isPublic_;
6274};
6375
6476// Represents a function definition.
0 commit comments