From fdfe2ff8c60c367a4eb7cecb4cbe1d62b41a8c20 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Tue, 30 Aug 2011 17:24:17 -0700 Subject: Checkpoint adding @home RPC support to aidl --- tools/aidl/AST.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'tools/aidl/AST.cpp') diff --git a/tools/aidl/AST.cpp b/tools/aidl/AST.cpp index 752ef7cc8480..42102f8fe0ac 100755 --- a/tools/aidl/AST.cpp +++ b/tools/aidl/AST.cpp @@ -111,6 +111,21 @@ LiteralExpression::Write(FILE* to) fprintf(to, "%s", this->value.c_str()); } +StringLiteralExpression::StringLiteralExpression(const string& v) + :value(v) +{ +} + +StringLiteralExpression::~StringLiteralExpression() +{ +} + +void +StringLiteralExpression::Write(FILE* to) +{ + fprintf(to, "\"%s\"", this->value.c_str()); +} + Variable::Variable() :type(NULL), name(), @@ -277,6 +292,17 @@ MethodCall::MethodCall(const string& n) { } +MethodCall::MethodCall(const string& n, int argc = 0, ...) + :obj(NULL), + clazz(NULL), + name(n) +{ + va_list args; + va_start(args, argc); + init(argc, args); + va_end(args); +} + MethodCall::MethodCall(Expression* o, const string& n) :obj(o), clazz(NULL), @@ -367,10 +393,28 @@ NewExpression::NewExpression(Type* t) { } +NewExpression::NewExpression(Type* t, int argc = 0, ...) + :type(t) +{ + va_list args; + va_start(args, argc); + init(argc, args); + va_end(args); +} + NewExpression::~NewExpression() { } +void +NewExpression::init(int n, va_list args) +{ + for (int i=0; iarguments.push_back(expression); + } +} + void NewExpression::Write(FILE* to) { @@ -678,7 +722,7 @@ Method::Write(FILE* to) fprintf(to, "%s\n", this->comment.c_str()); } - WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | FINAL | OVERRIDE); + WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | ABSTRACT | FINAL | OVERRIDE); if (this->returnType != NULL) { string dim; -- cgit v1.2.3-59-g8ed1b