History log of /system/tools/aidl/aidl_language.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f1471bd167215dad54d6a686a7e81d7d63c4ac83 12-Jan-2016 Ying Wang <wangying@google.com> Now the build system generates .cpp only for .ll/.yy

For .l/.y, it generates .c instead.
The generated header files are always ended with .h.

Bug: 26492989
Change-Id: Ic46cc775c2593d9740a29732f5b02c158f6070a3
/system/tools/aidl/aidl_language.cpp
0a62067f35e957493bc37c4b42dfdcfc16353831 04-Dec-2015 Elliott Hughes <enh@google.com> Track base/ -> android-base/ change.

Change-Id: I02b64b42c17d248c5fb2c4de4b0778a441e018e3
/system/tools/aidl/aidl_language.cpp
d40e2fed2c19850d53f1620322ac5cbca2c0e245 24-Nov-2015 Casey Dahlin <sadmac@google.com> Introduce integer constants

We can now declare a "const int" variable in an AIDL interface, in
addition to methods. These constants will become static members of the
interface/base class in the generated code.

Change-Id: I6b690ecbbe2acae37abb106510e42283f0753f26
Test: Unit and integration tests updated and pass
Bug: 23600061
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
c1f39b4ea30e7313eeb7f3d3fd5ec66ba00f2bb5 24-Nov-2015 Casey Dahlin <sadmac@google.com> Refactor top-level AST nodes v2

The previous version of this patch was tainted by parts of another
change to remove a memory leak, and ended up trying to treat a bare
pointer like a unique_ptr in a few places. This combines both changes in
to one.

Previous patch was b696437d842d59c0cc26411fa3d71cb91897c572:

We now return an AidlDocument from parsing. This type is non-polymorphic
and contains either a vector of parcelables or an interface. This gets
rid of all of our reinterpret_cast calls and the public item_type field.

Change-Id: I77fbb1d8448343bd02484d896289a514d636df25
Test: Unit tests pass
Bug: none
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
eedb29f028af472b90fa528c84d0d89100346e5c 24-Nov-2015 Bart Sears <bsears@google.com> Revert "Refactor top-level AST nodes"

This reverts commit b696437d842d59c0cc26411fa3d71cb91897c572.

Change-Id: Id5c716536299cfad4d13c5891d9be8b1fa2aceae
/system/tools/aidl/aidl_language.cpp
b696437d842d59c0cc26411fa3d71cb91897c572 17-Nov-2015 Casey Dahlin <sadmac@google.com> Refactor top-level AST nodes

We now return an AidlDocument from parsing. This type is non-polymorphic
and contains either a vector of parcelables or an interface. This gets
rid of all of our reinterpret_cast calls and the public item_type field.

Change-Id: Ia15ace677f79a153f8ebfad84ed43b08f4a3685f
Test: unit and integration tests pass
Bug: 25479378
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
8aa4d9f32dcfb37011d41417814c01bd2d7a473b 17-Nov-2015 Christopher Wiley <wiley@google.com> Add C++ header to AidlParcelable

In situations where a parcelable declaration includes a C++ header,
propagate that information to the AidlParcelable object. While here:

- remove support for the C++ type alias (the is keyword)
- consolidate AidlParcelable constructors to always use
AidlQualifiedName

Bug: 23600712
Test: unittests pass, integration tests pass

Change-Id: I058d8c2012bb0e5e07bbb6599ac5108f7866ad6e
/system/tools/aidl/aidl_language.cpp
90be4e3fe6d16ea8e8263b80989ef2ab4e6ef9c6 20-Oct-2015 Christopher Wiley <wiley@google.com> Fix segfault on missing package declaration

Add unittests to enforce this doesn't happen again. While here
add unittests for out params in oneway methods and make
ownership of AidlInterface pointers more explicit.

Also fix a bug where we would disallow returning void from functions
in C++ generation.

Bug: 24862770
Test: Unittests pass

Change-Id: I4fa67489ad1fff0d4453d38689e54b9f5ad08c43
/system/tools/aidl/aidl_language.cpp
d76067c52b6bc0587aa26ecae34a49e6cbdae404 20-Oct-2015 Christopher Wiley <wiley@google.com> Introduce GetSplitPackage() for AidlInterface and AidlParcelable

Bug: 24862770
Test: unittests

Change-Id: I9ef8279f03fd914e40d80939d242071c469a1864
/system/tools/aidl/aidl_language.cpp
cdbbc8c88426c8bf370547b661e770af6d5e1baa 15-Oct-2015 Casey Dahlin <sadmac@google.com> Kill buffer_type and extra_text_type

These are the last two C structs in the code. extra_text_type turns out to
be almost completely unnecessary, and buffer_type is more safely managed as
a class pointer anyway.

Change-Id: I1239f78e9e3de622603e98a55b62c76126e5e965
Test: Full Android build
Bug: 24950165
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
98a544b567e20f6c8492e1d4eb8869e759ae74d9 14-Oct-2015 Casey Dahlin <sadmac@google.com> Remove parse_helpers.cpp/h/unit tests

This test was very silly, and the contents of this file are better off
elsewhere.

Bug: 24948220
Change-Id: I800c9035806ba42038dab8a681755d0ce581a530
Test: Unit tests
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
2b2879b4cd04fe21853e8b18a6403c35778fb17d 14-Oct-2015 Casey Dahlin <sadmac@google.com> Don't include . in IDENTIFIER characters

We want to parse qualified names deliberately, not everywhere we need a
name.

Change-Id: Id20fc7e6fd8d3e4b54a5048bb54c6dccc4128f40
Test: Full Android Build
Bug: 24913789
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
59401da7787cbc224785c0a03c30f6392445c1ec 10-Oct-2015 Casey Dahlin <sadmac@google.com> Put parcelable members behind getters

Bug: 24410295
Change-Id: I28b70254c8e1846eaeab8523da5975843e86e0de
Test: Full android build
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
ad3392747003a30928da6cd206e41f66398c2062 06-Oct-2015 Christopher Wiley <wiley@google.com> Generate server side .cpp file

Bug: 24505488
Test: Unit tests, wrote some more

Change-Id: I89d18f0bb612f3a3ffadac41c6ff32b67d6552b7
/system/tools/aidl/aidl_language.cpp
fb7da2e62fe66b0a57ffbb0304f5884024a68f1c 09-Oct-2015 Casey Dahlin <sadmac@google.com> Put AidlInterface members behind methods

Change-Id: Ib367a9183e734a008acecf90c5f3f25e51e16b37
Test: Full android build
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
0edf34239909bbc16e884ea2517e5f3398185d0f 07-Oct-2015 Casey Dahlin <sadmac@google.com> Replace import_info struct with AidlInfo class

We extend this from AidlNode because we hope to make it part of the tree
someday instead of a second item of global state to register with the
parser.

Test: Unit tests
Bug: 24195596
Change-Id: I678a002855808469b08e726258b4daf13e3f6f00
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
4a2884b0e9414ed9dfee4e141e8bd462c07b442b 07-Oct-2015 Christopher Wiley <wiley@google.com> Read all files through IoDelegate

This allows us to easily fake out file IO in tests.

Bug: 24703046
Change-Id: I33a59c8e43489b03f27f99fb2949e58cc0311eb1
Test: unittests still pass, clean build of android passes
/system/tools/aidl/aidl_language.cpp
3c6df36e1b5b1b14a7f8863d05e67dfd6caa51f7 07-Oct-2015 Casey Dahlin <sadmac@google.com> Parse package names in parser not lexer

We also take this opportunity to neaten up the lexer code.

Change-Id: I0220f827144be768bcf771e240125e805c93d670
Test: Full android build
Bug: 24680682
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
308f9d49bb797858296193578b261af01d808f53 06-Oct-2015 Casey Dahlin <sadmac@google.com> Remove buffer_type from signature of AidlArgument

Change-Id: Ic7fb14198eb26d25fc24b832fdd77fe68070091f
Test: Unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
f7a421c02d43c3289ca45f0d5ccdf8d27e605f5a 06-Oct-2015 Casey Dahlin <sadmac@google.com> Use parser to find array brackets

Change-Id: Ib93032113c92fe23e1a7e4ac9b990a065f2b5d19
Test: Unit tests, Full Android Rebuild
Bugs: 24680682
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
f4a9311fa018c78a7b30a73bd8ebbaa33c701ae4 06-Oct-2015 Casey Dahlin <sadmac@google.com> Put data in AidlMethod behind getters and setters

Change-Id: I453ab9bcbbc610df4109d691283e7b872e0078a4
Test: Unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
f2d23f7f05252fa1a06a8f95bd9475fa9d414c0c 03-Oct-2015 Casey Dahlin <sadmac@google.com> Kill comments token in AidlMethod

Change-Id: I3df6629eaa5b56093d2453269d4b138987bee7ce
Test: unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
70078e6d2b1afd3d1a5f4370fd4e116e6d0510e1 01-Oct-2015 Casey Dahlin <sadmac@google.com> Kill AidlType->array_token

Change-Id: Ia2bfb8875f1b1766d53041f6e8d279e92103bf20
Test: unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
0ee3758e1f452a8bf99a5975b4f585035369d8fb 01-Oct-2015 Casey Dahlin <sadmac@google.com> Replace type_type struct with AidlType class

Change-Id: I642f55dba89681cd7dbf61880b4092c8d27050a6
Test: unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
fd6fb483fbe3b48948ade670ee838c6622110020 30-Sep-2015 Casey Dahlin <sadmac@google.com> Fold in/out/inout differentiation in to parser

This actually simplifies things a great deal, and means we don't need
buffer types back from the lexer for these three tokens. Small victories.

Change-Id: I5de6ef01852012ac60dd91238ba013662089ed0e
Test: unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
d127b50f07eed0cf78dfc956697031edea41043c 30-Sep-2015 Casey Dahlin <sadmac@google.com> Don't store AidlArgument name buffer_type

We now simply extract the string and store it sanely and destructably.

Test: unit tests
Bug: 24410295
Change-Id: I5a2588df688e019d66651a58ea5e5594de8a7e47
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
c378c9946ac42e225be4fe37d3b97e1b88a97304 30-Sep-2015 Casey Dahlin <sadmac@google.com> Stop storing the direction buffer

We pull the information out of the direction buffer_type immediately and pack
it safely in to privates where it can be accessed with sane accessors.

Test: unit tests
Bug: 24410295
Change-Id: I84e4cf50aad9202210fc9c3db5dd78858991ecd7
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
030977aecb0b253ec1a1d55cdc18930069cb6390 29-Sep-2015 Casey Dahlin <sadmac@google.com> Remove usage of malloc in favor of new

This reverts commit b2116869ba878222d607807be594366b6e9392f7.

Test: unittests
Bug: 24469748
Change-Id: I82de5a12cf851ffdacc2c7969a2429746ba7a772
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
bc7a50a9bb4b97affc05f872d0cce02e54861e23 29-Sep-2015 Casey Dahlin <sadmac@google.com> Turn arg_type into a class called AIDLArgument

We also get rid of its linked list property and use std::vector to store lists
of arguments in method_type.

We still expose most of the same data publicly, but there's going to be a lot
of high-touch changes coming with this transition so it's better to break the
change set here.

Change-Id: I71a3dfe1e0fb9cd9437ec81de681b72137fc02cf
Test: unit tests
Bug: 24410295
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
b2116869ba878222d607807be594366b6e9392f7 29-Sep-2015 Christopher Wiley <wiley@google.com> Revert "Remove usage of malloc in favor of new"

This reverts commit b992b450093546d275d2da4b544a611700536e29.

The build's address sanitizer is complaining that we're calling delete[] on a 3 byte region allocated with malloc().

Change-Id: I03e667e1b64a9b298607d0709747c02c8f7d0da6
/system/tools/aidl/aidl_language.cpp
b992b450093546d275d2da4b544a611700536e29 28-Sep-2015 Casey Dahlin <sadmac@google.com> Remove usage of malloc in favor of new

Change-Id: Iee22541081caf78e295f7a05e248bfdee0bc8770
Test: unittests
Bug: 24469748
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
89d4484c67b1866eefb63524f20b6009a96aac49 25-Sep-2015 Casey Dahlin <sadmac@google.com> Add parsing of in-memory strings

Some times, specifically in unit tests, we might want to parse a string
instead of an actual file. And now we can!

Change-Id: Iafdb0f0c1c4002c281de8e819da07a32b10694bf
Test: unit tests
Bug: 24385461
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
082f1d172dbc9de990a04c26b55972faf812771b 21-Sep-2015 Casey Dahlin <sadmac@google.com> Implement code generation for server header

Bug: 23599760
Change-Id: I81a8804c87f0d8e915f6ba584862fb578a7a19e8
Test: Ran against example easybinder interface
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
9980181fae4239b0161878de2947ff2ccc8d5f82 16-Sep-2015 Casey Dahlin <sadmac@google.com> Make RunParser return consistent/consistently used

Change-Id: I054e296fe9922c19d9c79adb1a11c8f138ad0191
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
5b869809aa00204d0b17dbb618dd2db203d53ff2 16-Sep-2015 Christopher Wiley <wiley@google.com> Fix segfault on missing package statement

Constructing a string from nullptr is undefined behavior.

Change-Id: Iacd42e9f6b5d43f8da613982f291a4e3f9073940
/system/tools/aidl/aidl_language.cpp
f690be5044a56fdf75bb0bcae640074ec97023cd 15-Sep-2015 Christopher Wiley <wiley@google.com> Minor cleanup of aidl.cpp

1) Move some helper functions to parse_helpers.cpp
2) Refactor some helper functions to take advantage of C++ built ins
3) Add unittest coverage of refactored logic
4) clang-format -i -style=Google parse_helpers.cpp
5) Move remaining helper functions of aidl.cpp into anonymous namespace

Change-Id: I3a2cf7be113ac7f71a1a3502b12a8ed910509546
/system/tools/aidl/aidl_language.cpp
e25074935064cf06d30568ca61f2aaa0f75f0b9a 15-Sep-2015 Casey Dahlin <sadmac@google.com> Kill psGlobal and g_callbacks

No more callbacks. No more unsafe pointer cast (fixes Bug 23977313).

The best part is that the entire YACC/FLEX portion is now behind an object
from the rest of the program's POV.

Test: Ran unit tests
Change-Id: I9e38953bd0e65b8f1fad87ff2df049643ef6cc73
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
fdeb0f4b96b6c39b1b9ed3358634f180f9e6df06 12-Sep-2015 Christopher Wiley <wiley@google.com> Abstract away file IO when writing generated code

This allows us to write unittests of Java/Cpp AST elements without
doing file I/O each time. Introduce a CodeWriter class which
may write to either a string or a file dependening on the contect.

While here, mark the write methods as const.

Test: Compiles, unittests pass, added new unittest demonstrating usage.
Bug: 23598995

Change-Id: I240ede41f0f9c04c0d14d1a3680ce5ab332babbc
/system/tools/aidl/aidl_language.cpp
07b9dde78e002aab6682129ab597e357453a5f66 11-Sep-2015 Casey Dahlin <sadmac@google.com> Revert change to win32 isatty stub

This is attempting to fix build breakage caused by redefining the isatty stub
for win32.

Change-Id: I5f854934cb9d2b2981f6349045e85d9ad737aa77
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
fd2e08a10eee8c4103bddf7cd197e94e1815216c 11-Sep-2015 Casey Dahlin <sadmac@google.com> Convert to C++ Bison output

We have to step up to a GLR parser to do this without exceptions (for no
reason other than Bison happens to use exceptions for the LALR(1) template and
not for the GLR one), but this should let us smooth out integration going
forward.

Change-Id: Iff44662914b4a65dfa5612d07c3a1ede07e6e4a9
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
dd69181114098550f84186442ef453754570075d 10-Sep-2015 Casey Dahlin <sadmac@google.com> First pass on reentrant C++-ish parser

We're flipping Flex/Bison in to reentrant mode, cutting down on global
variables, and exposing a more C++-like interface earlier. This is the first
phase. There's still a couple of weird hacks to deal with the previous code's
reckless disregard for scope sanity, but the outline of things to come is
starting to appear, and this CL really doesn't need to get any bigger.

Change-Id: Ife2d70db026d7ab1319bdf6c586959315666d0bb
Signed-off-by: Casey Dahlin <sadmac@google.com>
/system/tools/aidl/aidl_language.cpp
549b6e27c013ec44272be15b3da47da39721864d 17-Aug-2015 Elliott Hughes <enh@google.com> Replace HAVE_MS_C_RUNTIME with _WIN32 in frameworks/base/tools.

Change-Id: Ideef62acbf53a442167c9b8038021affffef9e8a
/system/tools/aidl/aidl_language.cpp
ffa1686a7a8964d1f6e08ee2ab3e5eb42eb5f0b3 24-Jan-2014 Adam Lesinski <adamlesinski@google.com> Revert "Move frameworks/base/tools/ to frameworks/tools/"

This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
/system/tools/aidl/aidl_language.cpp
be354814711cbbb3bcf7467fc69d53fcf9363093 28-Aug-2013 Mike Lockwood <lockwood@google.com> Move frameworks/base/tools/ to frameworks/tools/

Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
/system/tools/aidl/aidl_language.cpp
46c012c3806a4b5c5c46539ea5070cc56e1bdb4b 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/system/tools/aidl/aidl_language.cpp