summaryrefslogtreecommitdiff
path: root/tools/aidl/AST.cpp
diff options
context:
space:
mode:
author Joe Onorato <joeo@google.com> 2011-08-30 17:24:17 -0700
committer Mike Lockwood <lockwood@google.com> 2012-02-10 10:51:20 -0800
commitfdfe2ff8c60c367a4eb7cecb4cbe1d62b41a8c20 (patch)
tree33ff6ed8e57f31aebadd5e04c7f97dae01917ea9 /tools/aidl/AST.cpp
parenta8f767a2395c0127b7f5adb9e207fdd994144e17 (diff)
Checkpoint adding @home RPC support to aidl
Diffstat (limited to 'tools/aidl/AST.cpp')
-rwxr-xr-xtools/aidl/AST.cpp46
1 files changed, 45 insertions, 1 deletions
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,11 +393,29 @@ 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; i<n; i++) {
+ Expression* expression = (Expression*)va_arg(args, void*);
+ this->arguments.push_back(expression);
+ }
+}
+
+void
NewExpression::Write(FILE* to)
{
fprintf(to, "new %s(", this->type->InstantiableName().c_str());
@@ -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;