Assign-2
This commit is contained in:
BIN
Assignment-2/.DS_Store
vendored
Normal file
BIN
Assignment-2/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Assignment-2/Dark Green Modern Pizza Promo Instagram Post.pdf
Normal file
BIN
Assignment-2/Dark Green Modern Pizza Promo Instagram Post.pdf
Normal file
Binary file not shown.
@@ -1 +1,7 @@
|
||||
# Readme File
|
||||
|
||||
LCA parser use the jva 8 grammer provided
|
||||
```bash
|
||||
javac -cp .:javaparser-1.0.0.jar LCA_JP1_0_0.java
|
||||
java -cp .:javaparser-1.0.0.jar test.java
|
||||
```
|
||||
BIN
Assignment-2/javaparser-1.0.0-src.zip
Normal file
BIN
Assignment-2/javaparser-1.0.0-src.zip
Normal file
Binary file not shown.
674
Assignment-2/javaparser-1.0.0-src/COPYING
Normal file
674
Assignment-2/javaparser-1.0.0-src/COPYING
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
Java 1.5 parser and Abstract Syntax Tree
|
||||
Copyright (C) 2007 Júlio Vilmar Gesser
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Java 1.5 parser and Abstract Syntax Tree Copyright (C) 2007 Júlio Vilmar Gesser
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
165
Assignment-2/javaparser-1.0.0-src/COPYING.LESSER
Normal file
165
Assignment-2/javaparser-1.0.0-src/COPYING.LESSER
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
557
Assignment-2/javaparser-1.0.0-src/java_1_5.html
Normal file
557
Assignment-2/javaparser-1.0.0-src/java_1_5.html
Normal file
@@ -0,0 +1,557 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>BNF for java_1_5.jj </TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1 ALIGN=CENTER>BNF for java_1_5.jj </H1>
|
||||
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">CompilationUnit</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod2">PackageDeclaration</A> )? ( <A HREF="#prod3">ImportDeclaration</A> )* ( <A HREF="#prod4">TypeDeclaration</A> )* ( <EOF> | "\u001a" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">PackageDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod5">Annotation</A> )* "package" <A HREF="#prod6">Name</A> ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">ImportDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"import" ( "static" )? <A HREF="#prod6">Name</A> ( "." "*" )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">Modifiers</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "public" | "static" | "protected" | "private" | "final" | "abstract" | "synchronized" | "native" | "transient" | "volatile" | "strictfp" | <A HREF="#prod5">Annotation</A> ) )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">TypeDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ";" | <A HREF="#prod7">Modifiers</A> ( <A HREF="#prod8">ClassOrInterfaceDeclaration</A> | <A HREF="#prod9">EnumDeclaration</A> | <A HREF="#prod10">AnnotationTypeDeclaration</A> ) )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">ClassOrInterfaceDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "class" | "interface" ) <IDENTIFIER> ( <A HREF="#prod11">TypeParameters</A> )? ( <A HREF="#prod12">ExtendsList</A> )? ( <A HREF="#prod13">ImplementsList</A> )? <A HREF="#prod14">ClassOrInterfaceBody</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">ExtendsList</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"extends" <A HREF="#prod15">ClassOrInterfaceType</A> ( "," <A HREF="#prod15">ClassOrInterfaceType</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">ImplementsList</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"implements" <A HREF="#prod15">ClassOrInterfaceType</A> ( "," <A HREF="#prod15">ClassOrInterfaceType</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">EnumDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"enum" <IDENTIFIER> ( <A HREF="#prod13">ImplementsList</A> )? "{" ( <A HREF="#prod16">EnumConstantDeclaration</A> ( "," <A HREF="#prod16">EnumConstantDeclaration</A> )* )? ( "," )? ( ( ";" ( <A HREF="#prod17">ClassOrInterfaceBodyDeclaration</A> )* ) )? "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">EnumConstantDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod5">Annotation</A> )* <IDENTIFIER> ( <A HREF="#prod18">Arguments</A> )? ( <A HREF="#prod14">ClassOrInterfaceBody</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">TypeParameters</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"<" <A HREF="#prod19">TypeParameter</A> ( "," <A HREF="#prod19">TypeParameter</A> )* ">"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">TypeParameter</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ( <A HREF="#prod20">TypeBound</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">TypeBound</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"extends" <A HREF="#prod15">ClassOrInterfaceType</A> ( "&" <A HREF="#prod15">ClassOrInterfaceType</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">ClassOrInterfaceBody</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"{" ( <A HREF="#prod17">ClassOrInterfaceBodyDeclaration</A> )* "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">ClassOrInterfaceBodyDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod21">InitializerDeclaration</A> | <A HREF="#prod7">Modifiers</A> ( <A HREF="#prod8">ClassOrInterfaceDeclaration</A> | <A HREF="#prod9">EnumDeclaration</A> | <A HREF="#prod10">AnnotationTypeDeclaration</A> | <A HREF="#prod22">ConstructorDeclaration</A> | <A HREF="#prod23">FieldDeclaration</A> | <A HREF="#prod24">MethodDeclaration</A> ) | ";" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">FieldDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod25">Type</A> <A HREF="#prod26">VariableDeclarator</A> ( "," <A HREF="#prod26">VariableDeclarator</A> )* ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod26">VariableDeclarator</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod27">VariableDeclaratorId</A> ( "=" <A HREF="#prod28">VariableInitializer</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod27">VariableDeclaratorId</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ( "[" "]" )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod28">VariableInitializer</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod29">ArrayInitializer</A> | <A HREF="#prod30">Expression</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod29">ArrayInitializer</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"{" ( <A HREF="#prod28">VariableInitializer</A> ( "," <A HREF="#prod28">VariableInitializer</A> )* )? ( "," )? "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">MethodDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod11">TypeParameters</A> )? <A HREF="#prod31">ResultType</A> <IDENTIFIER> <A HREF="#prod32">FormalParameters</A> ( "[" "]" )* ( "throws" <A HREF="#prod33">NameList</A> )? ( <A HREF="#prod34">Block</A> | ";" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod32">FormalParameters</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"(" ( <A HREF="#prod35">FormalParameter</A> ( "," <A HREF="#prod35">FormalParameter</A> )* )? ")"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod35">FormalParameter</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">Modifiers</A> <A HREF="#prod25">Type</A> ( "..." )? <A HREF="#prod27">VariableDeclaratorId</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">ConstructorDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod11">TypeParameters</A> )? <IDENTIFIER> <A HREF="#prod32">FormalParameters</A> ( "throws" <A HREF="#prod33">NameList</A> )? "{" ( <A HREF="#prod36">ExplicitConstructorInvocation</A> )? <A HREF="#prod37">Statements</A> "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod36">ExplicitConstructorInvocation</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ( <A HREF="#prod38">TypeArguments</A> )? "this" <A HREF="#prod18">Arguments</A> ";" | ( <A HREF="#prod39">PrimaryExpressionWithoutSuperSuffix</A> "." )? ( <A HREF="#prod38">TypeArguments</A> )? "super" <A HREF="#prod18">Arguments</A> ";" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod37">Statements</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod40">BlockStatement</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">InitializerDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "static" )? <A HREF="#prod34">Block</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod25">Type</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod41">ReferenceType</A> | <A HREF="#prod42">PrimitiveType</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod41">ReferenceType</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod42">PrimitiveType</A> ( "[" "]" )+ | <A HREF="#prod15">ClassOrInterfaceType</A> ( "[" "]" )* )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">ClassOrInterfaceType</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ( <A HREF="#prod38">TypeArguments</A> )? ( "." <IDENTIFIER> ( <A HREF="#prod38">TypeArguments</A> )? )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod38">TypeArguments</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"<" <A HREF="#prod43">TypeArgument</A> ( "," <A HREF="#prod43">TypeArgument</A> )* ">"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod43">TypeArgument</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod41">ReferenceType</A> | <A HREF="#prod44">Wildcard</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod44">Wildcard</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"?" ( "extends" <A HREF="#prod41">ReferenceType</A> | "super" <A HREF="#prod41">ReferenceType</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod42">PrimitiveType</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "boolean" | "char" | "byte" | "short" | "int" | "long" | "float" | "double" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod31">ResultType</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "void" | <A HREF="#prod25">Type</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">Name</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ( "." <IDENTIFIER> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod33">NameList</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Name</A> ( "," <A HREF="#prod6">Name</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod30">Expression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod45">ConditionalExpression</A> ( <A HREF="#prod46">AssignmentOperator</A> <A HREF="#prod30">Expression</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod46">AssignmentOperator</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|=" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod45">ConditionalExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod47">ConditionalOrExpression</A> ( "?" <A HREF="#prod30">Expression</A> ":" <A HREF="#prod45">ConditionalExpression</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod47">ConditionalOrExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod48">ConditionalAndExpression</A> ( "||" <A HREF="#prod48">ConditionalAndExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod48">ConditionalAndExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod49">InclusiveOrExpression</A> ( "&&" <A HREF="#prod49">InclusiveOrExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod49">InclusiveOrExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod50">ExclusiveOrExpression</A> ( "|" <A HREF="#prod50">ExclusiveOrExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod50">ExclusiveOrExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod51">AndExpression</A> ( "^" <A HREF="#prod51">AndExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod51">AndExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod52">EqualityExpression</A> ( "&" <A HREF="#prod52">EqualityExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod52">EqualityExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod53">InstanceOfExpression</A> ( ( "==" | "!=" ) <A HREF="#prod53">InstanceOfExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod53">InstanceOfExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod54">RelationalExpression</A> ( "instanceof" <A HREF="#prod25">Type</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod54">RelationalExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod55">ShiftExpression</A> ( ( "<" | ">" | "<=" | ">=" ) <A HREF="#prod55">ShiftExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod55">ShiftExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod56">AdditiveExpression</A> ( ( "<<" | <A HREF="#prod57">RSIGNEDSHIFT</A> | <A HREF="#prod58">RUNSIGNEDSHIFT</A> ) <A HREF="#prod56">AdditiveExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod56">AdditiveExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod59">MultiplicativeExpression</A> ( ( "+" | "-" ) <A HREF="#prod59">MultiplicativeExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod59">MultiplicativeExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod60">UnaryExpression</A> ( ( "*" | "/" | "%" ) <A HREF="#prod60">UnaryExpression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod60">UnaryExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "+" | "-" ) <A HREF="#prod60">UnaryExpression</A> | <A HREF="#prod61">PreIncrementExpression</A> | <A HREF="#prod62">PreDecrementExpression</A> | <A HREF="#prod63">UnaryExpressionNotPlusMinus</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod61">PreIncrementExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"++" <A HREF="#prod64">PrimaryExpression</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod62">PreDecrementExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"--" <A HREF="#prod64">PrimaryExpression</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod63">UnaryExpressionNotPlusMinus</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "~" | "!" ) <A HREF="#prod60">UnaryExpression</A> | <A HREF="#prod65">CastExpression</A> | <A HREF="#prod66">PostfixExpression</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod67">CastLookahead</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"(" <A HREF="#prod25">Type</A> "[" "]"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"(" <A HREF="#prod25">Type</A> ")" <A HREF="#prod60">UnaryExpression</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod66">PostfixExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod64">PrimaryExpression</A> ( ( "++" | "--" ) )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod65">CastExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"(" <A HREF="#prod25">Type</A> ")" <A HREF="#prod60">UnaryExpression</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod64">PrimaryExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod68">PrimaryPrefix</A> ( <A HREF="#prod69">PrimarySuffix</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod39">PrimaryExpressionWithoutSuperSuffix</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod68">PrimaryPrefix</A> ( <A HREF="#prod70">PrimarySuffixWithoutSuper</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod68">PrimaryPrefix</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod71">Literal</A> | "this" | "super" "." ( <A HREF="#prod38">TypeArguments</A> )? <IDENTIFIER> ( <A HREF="#prod18">Arguments</A> )? | "(" <A HREF="#prod30">Expression</A> ")" | <A HREF="#prod72">AllocationExpression</A> | <A HREF="#prod31">ResultType</A> "." "class" | <IDENTIFIER> ( <A HREF="#prod18">Arguments</A> )? )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod69">PrimarySuffix</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod70">PrimarySuffixWithoutSuper</A> | "." "super" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod70">PrimarySuffixWithoutSuper</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "." ( "this" | <A HREF="#prod72">AllocationExpression</A> | ( <A HREF="#prod38">TypeArguments</A> )? <IDENTIFIER> ( <A HREF="#prod18">Arguments</A> )? ) | "[" <A HREF="#prod30">Expression</A> "]" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod71">Literal</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <INTEGER_LITERAL> | <LONG_LITERAL> | <FLOATING_POINT_LITERAL> | <CHARACTER_LITERAL> | <STRING_LITERAL> | <A HREF="#prod73">BooleanLiteral</A> | <A HREF="#prod74">NullLiteral</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod73">BooleanLiteral</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "true" | "false" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod74">NullLiteral</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"null"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">Arguments</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"(" ( <A HREF="#prod75">ArgumentList</A> )? ")"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod75">ArgumentList</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod30">Expression</A> ( "," <A HREF="#prod30">Expression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod72">AllocationExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"new" ( <A HREF="#prod42">PrimitiveType</A> <A HREF="#prod76">ArrayDimsAndInits</A> | ( <A HREF="#prod38">TypeArguments</A> )? <A HREF="#prod15">ClassOrInterfaceType</A> ( <A HREF="#prod76">ArrayDimsAndInits</A> | <A HREF="#prod18">Arguments</A> ( <A HREF="#prod14">ClassOrInterfaceBody</A> )? ) )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod76">ArrayDimsAndInits</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "[" <A HREF="#prod30">Expression</A> "]" )+ ( "[" "]" )* | ( "[" "]" )+ <A HREF="#prod29">ArrayInitializer</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod77">Statement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod78">LabeledStatement</A> | <A HREF="#prod79">AssertStatement</A> | <A HREF="#prod34">Block</A> | <A HREF="#prod80">EmptyStatement</A> | <A HREF="#prod81">StatementExpression</A> | <A HREF="#prod82">SwitchStatement</A> | <A HREF="#prod83">IfStatement</A> | <A HREF="#prod84">WhileStatement</A> | <A HREF="#prod85">DoStatement</A> | <A HREF="#prod86">ForStatement</A> | <A HREF="#prod87">BreakStatement</A> | <A HREF="#prod88">ContinueStatement</A> | <A HREF="#prod89">ReturnStatement</A> | <A HREF="#prod90">ThrowStatement</A> | <A HREF="#prod91">SynchronizedStatement</A> | <A HREF="#prod92">TryStatement</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod79">AssertStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"assert" <A HREF="#prod30">Expression</A> ( ":" <A HREF="#prod30">Expression</A> )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod78">LabeledStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ":" <A HREF="#prod77">Statement</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod34">Block</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"{" <A HREF="#prod37">Statements</A> "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod40">BlockStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod7">Modifiers</A> <A HREF="#prod8">ClassOrInterfaceDeclaration</A> | <A HREF="#prod93">VariableDeclarationExpression</A> ";" | <A HREF="#prod77">Statement</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod93">VariableDeclarationExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">Modifiers</A> <A HREF="#prod25">Type</A> <A HREF="#prod26">VariableDeclarator</A> ( "," <A HREF="#prod26">VariableDeclarator</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod80">EmptyStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod81">StatementExpression</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod61">PreIncrementExpression</A> | <A HREF="#prod62">PreDecrementExpression</A> | <A HREF="#prod64">PrimaryExpression</A> ( "++" | "--" | <A HREF="#prod46">AssignmentOperator</A> <A HREF="#prod30">Expression</A> )? ) ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod82">SwitchStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"switch" "(" <A HREF="#prod30">Expression</A> ")" "{" ( <A HREF="#prod94">SwitchEntry</A> )* "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod94">SwitchEntry</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( "case" <A HREF="#prod30">Expression</A> | "default" ) ":" <A HREF="#prod37">Statements</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod83">IfStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"if" "(" <A HREF="#prod30">Expression</A> ")" <A HREF="#prod77">Statement</A> ( "else" <A HREF="#prod77">Statement</A> )?</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod84">WhileStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"while" "(" <A HREF="#prod30">Expression</A> ")" <A HREF="#prod77">Statement</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod85">DoStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"do" <A HREF="#prod77">Statement</A> "while" "(" <A HREF="#prod30">Expression</A> ")" ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod86">ForStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"for" "(" ( <A HREF="#prod93">VariableDeclarationExpression</A> ":" <A HREF="#prod30">Expression</A> | ( <A HREF="#prod95">ForInit</A> )? ";" ( <A HREF="#prod30">Expression</A> )? ";" ( <A HREF="#prod96">ForUpdate</A> )? ) ")" <A HREF="#prod77">Statement</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod95">ForInit</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod93">VariableDeclarationExpression</A> | <A HREF="#prod97">ExpressionList</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod97">ExpressionList</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod30">Expression</A> ( "," <A HREF="#prod30">Expression</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod96">ForUpdate</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod97">ExpressionList</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod87">BreakStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"break" ( <IDENTIFIER> )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod88">ContinueStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"continue" ( <IDENTIFIER> )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod89">ReturnStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"return" ( <A HREF="#prod30">Expression</A> )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod90">ThrowStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"throw" <A HREF="#prod30">Expression</A> ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod91">SynchronizedStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"synchronized" "(" <A HREF="#prod30">Expression</A> ")" <A HREF="#prod34">Block</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod92">TryStatement</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"try" <A HREF="#prod34">Block</A> ( ( "catch" "(" <A HREF="#prod35">FormalParameter</A> ")" <A HREF="#prod34">Block</A> )+ ( "finally" <A HREF="#prod34">Block</A> )? | "finally" <A HREF="#prod34">Block</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod58">RUNSIGNEDSHIFT</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ">" ">" ">" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod57">RSIGNEDSHIFT</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ">" ">" )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">Annotation</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod98">NormalAnnotation</A> | <A HREF="#prod99">SingleMemberAnnotation</A> | <A HREF="#prod100">MarkerAnnotation</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod98">NormalAnnotation</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"@" <A HREF="#prod6">Name</A> "(" ( <A HREF="#prod101">MemberValuePairs</A> )? ")"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod100">MarkerAnnotation</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"@" <A HREF="#prod6">Name</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod99">SingleMemberAnnotation</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"@" <A HREF="#prod6">Name</A> "(" <A HREF="#prod102">MemberValue</A> ")"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod101">MemberValuePairs</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod103">MemberValuePair</A> ( "," <A HREF="#prod103">MemberValuePair</A> )*</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod103">MemberValuePair</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> "=" <A HREF="#prod102">MemberValue</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod102">MemberValue</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod5">Annotation</A> | <A HREF="#prod104">MemberValueArrayInitializer</A> | <A HREF="#prod45">ConditionalExpression</A> )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod104">MemberValueArrayInitializer</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"{" ( <A HREF="#prod102">MemberValue</A> ( "," <A HREF="#prod102">MemberValue</A> )* )? ( "," )? "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">AnnotationTypeDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"@" "interface" <IDENTIFIER> <A HREF="#prod105">AnnotationTypeBody</A></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod105">AnnotationTypeBody</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"{" ( <A HREF="#prod106">AnnotationBodyDeclaration</A> )* "}"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod106">AnnotationBodyDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>( ";" | <A HREF="#prod7">Modifiers</A> ( <A HREF="#prod107">AnnotationTypeMemberDeclaration</A> | <A HREF="#prod8">ClassOrInterfaceDeclaration</A> | <A HREF="#prod9">EnumDeclaration</A> | <A HREF="#prod10">AnnotationTypeDeclaration</A> | <A HREF="#prod23">FieldDeclaration</A> ) )</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod107">AnnotationTypeMemberDeclaration</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod25">Type</A> <IDENTIFIER> "(" ")" ( <A HREF="#prod108">DefaultValue</A> )? ";"</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod108">DefaultValue</A></TD>
|
||||
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
|
||||
<TD ALIGN=LEFT VALIGN=BASELINE>"default" <A HREF="#prod102">MemberValue</A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
128
Assignment-2/javaparser-1.0.0-src/readme.txt
Normal file
128
Assignment-2/javaparser-1.0.0-src/readme.txt
Normal file
@@ -0,0 +1,128 @@
|
||||
+-------------------------------------------------------------------------------+
|
||||
| Java 1.5 parser and Abstract Syntax Tree. |
|
||||
+-------------------------------------------------------------------------------+
|
||||
| Copyright (C) 2007 Júlio Vilmar Gesser |
|
||||
| jgesser@gmail.com |
|
||||
| http://code.google.com/p/javaparser/ |
|
||||
+-------------------------------------------------------------------------------+
|
||||
| This program is free software: you can redistribute it and/or modify |
|
||||
| it under the terms of the GNU Lesser General Public License as published by |
|
||||
| the Free Software Foundation, either version 3 of the License, or |
|
||||
| (at your option) any later version. |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU Lesser General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Lesser General Public License |
|
||||
| along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
+-------------------------------------------------------------------------------+
|
||||
|
||||
This package contains a Java 1.5 Parser with AST generation and visitor support.
|
||||
The AST records the source code structure, javadoc and comments. Soon will be
|
||||
possible change the AST nodes or create new ones to modify source code like refactoring.
|
||||
This parser is based on Sreenivasa Viswanadha Java 1.5 parser.
|
||||
|
||||
Visit the project site, there you can get help, view some sample codes, report
|
||||
bugs and feature enhacement and download the latest version:
|
||||
http://code.google.com/p/javaparser/
|
||||
|
||||
|
||||
People who helped to improve this parser
|
||||
(Thank you all, sorry if I miss someone)
|
||||
------------------------------------------
|
||||
|
||||
Dmitry Kichinsky
|
||||
John Li
|
||||
Leon Poyyayil
|
||||
Keffin Barnaby
|
||||
Marc-Philippe Huget
|
||||
Samuel Stanojevic
|
||||
Sreenivasa Viswanadha
|
||||
Stephan Heiss
|
||||
Vadim TSES'KO
|
||||
|
||||
|
||||
Version history
|
||||
---------------
|
||||
|
||||
1.0.0 (2008-06-25)
|
||||
- Changed version numbering, starting version 1.0.0
|
||||
- Javadoc done for packages:
|
||||
- japa.parser
|
||||
- japa.parser.ast
|
||||
- Corrected bug when parsing in multithread:
|
||||
- JavaParser.setCacheParser(false) must be called before to use the parser concurrent
|
||||
|
||||
2008-06-19
|
||||
- No code changes, added binary distribution to download page
|
||||
|
||||
2008-06-11
|
||||
- Bug corrected: NPE in VoidVisitorAdapter
|
||||
- http://code.google.com/p/javaparser/issues/detail?id=2
|
||||
|
||||
2008-06-09
|
||||
- Added Adapters for de visitors
|
||||
|
||||
2008-05-28
|
||||
- This project now is published at Google Code:
|
||||
- http://code.google.com/p/javaparser/
|
||||
|
||||
2008-05-25
|
||||
- Added support for comments and javadoc to the tree.
|
||||
- Javadocs are stored directly to members (BodyDeclaration and all deriveds (classes, methods, fields, etc.)), accessible by the method getJavadoc().
|
||||
- All comments are stored in the CompilationUnit, accessible by the method getComments().
|
||||
|
||||
2008-04-01
|
||||
- Changed all nodes public attributes to be private and created getters to access them
|
||||
- Changed the methods of the Node getLine e getColumn to getBeginLine and getBeginColumn
|
||||
- Added the methods getEndLine and getEndColumn to the Node class (works only in the BlockNode)
|
||||
|
||||
2007-12-22
|
||||
- Corrected ConditionalExpression bug
|
||||
|
||||
2007-10-21
|
||||
- Added LGPL License
|
||||
|
||||
2007-10-21
|
||||
- Bugs corrected:
|
||||
- Created PackageDeclaration member of CompilationUnit to add suport for annotations in the package declaration
|
||||
- Parameterized anonymous constructor invocation
|
||||
- Explicit constructor invotation Type Arguments
|
||||
- ctrl+z ("\u001A") ar end of compilation unit
|
||||
|
||||
2007-10-09
|
||||
- EnumConstantDeclaration annotation support corrected
|
||||
- Parssing Java Unicode escape characters suport added
|
||||
|
||||
2007-10-03
|
||||
- Bug corrected: "MotifComboPopup.this.super()" statement was generating parser error
|
||||
|
||||
2007-10-01
|
||||
- Bug corrected: Casting signed primitive values
|
||||
double d = (double) -1;
|
||||
^
|
||||
|
||||
2007-08-06
|
||||
- Bug with the ingle line comments in the final of the unit corrected
|
||||
|
||||
2007-07-31
|
||||
- Fixed the bug with the following expression:
|
||||
Class c = (int.class);
|
||||
|
||||
2007-06-26
|
||||
- Bug fixes from Leon Poyyayil work
|
||||
- suport for hex floating point
|
||||
- unicode digits in indentifier
|
||||
- MemberValueArrayInitializer
|
||||
|
||||
2007-03-09
|
||||
- Long and Integer literal MIN_VALUE bug
|
||||
|
||||
2007-02-24
|
||||
- '\0' bug fixed
|
||||
|
||||
2007-02-01
|
||||
- Many bug fixes
|
||||
- Added line/column to nodes
|
||||
@@ -0,0 +1,586 @@
|
||||
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.0 */
|
||||
package japa.parser;
|
||||
|
||||
/**
|
||||
* An implementation of interface CharStream, where the stream is assumed to
|
||||
* contain only ASCII characters (with java-like unicode escape processing).
|
||||
*/
|
||||
|
||||
public class JavaCharStream
|
||||
{
|
||||
public static final boolean staticFlag = false;
|
||||
static final int hexval(char c) throws java.io.IOException {
|
||||
switch(c)
|
||||
{
|
||||
case '0' :
|
||||
return 0;
|
||||
case '1' :
|
||||
return 1;
|
||||
case '2' :
|
||||
return 2;
|
||||
case '3' :
|
||||
return 3;
|
||||
case '4' :
|
||||
return 4;
|
||||
case '5' :
|
||||
return 5;
|
||||
case '6' :
|
||||
return 6;
|
||||
case '7' :
|
||||
return 7;
|
||||
case '8' :
|
||||
return 8;
|
||||
case '9' :
|
||||
return 9;
|
||||
|
||||
case 'a' :
|
||||
case 'A' :
|
||||
return 10;
|
||||
case 'b' :
|
||||
case 'B' :
|
||||
return 11;
|
||||
case 'c' :
|
||||
case 'C' :
|
||||
return 12;
|
||||
case 'd' :
|
||||
case 'D' :
|
||||
return 13;
|
||||
case 'e' :
|
||||
case 'E' :
|
||||
return 14;
|
||||
case 'f' :
|
||||
case 'F' :
|
||||
return 15;
|
||||
}
|
||||
|
||||
throw new java.io.IOException(); // Should never come here
|
||||
}
|
||||
|
||||
public int bufpos = -1;
|
||||
int bufsize;
|
||||
int available;
|
||||
int tokenBegin;
|
||||
protected int bufline[];
|
||||
protected int bufcolumn[];
|
||||
|
||||
protected int column = 0;
|
||||
protected int line = 1;
|
||||
|
||||
protected boolean prevCharIsCR = false;
|
||||
protected boolean prevCharIsLF = false;
|
||||
|
||||
protected java.io.Reader inputStream;
|
||||
|
||||
protected char[] nextCharBuf;
|
||||
protected char[] buffer;
|
||||
protected int maxNextCharInd = 0;
|
||||
protected int nextCharInd = -1;
|
||||
protected int inBuf = 0;
|
||||
protected int tabSize = 8;
|
||||
|
||||
protected void setTabSize(int i) { tabSize = i; }
|
||||
protected int getTabSize(int i) { return tabSize; }
|
||||
|
||||
protected void ExpandBuff(boolean wrapAround)
|
||||
{
|
||||
char[] newbuffer = new char[bufsize + 2048];
|
||||
int newbufline[] = new int[bufsize + 2048];
|
||||
int newbufcolumn[] = new int[bufsize + 2048];
|
||||
|
||||
try
|
||||
{
|
||||
if (wrapAround)
|
||||
{
|
||||
System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
|
||||
System.arraycopy(buffer, 0, newbuffer,
|
||||
bufsize - tokenBegin, bufpos);
|
||||
buffer = newbuffer;
|
||||
|
||||
System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
|
||||
System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
|
||||
bufline = newbufline;
|
||||
|
||||
System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
|
||||
System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
|
||||
bufcolumn = newbufcolumn;
|
||||
|
||||
bufpos += (bufsize - tokenBegin);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
|
||||
buffer = newbuffer;
|
||||
|
||||
System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
|
||||
bufline = newbufline;
|
||||
|
||||
System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
|
||||
bufcolumn = newbufcolumn;
|
||||
|
||||
bufpos -= tokenBegin;
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
throw new Error(t.getMessage());
|
||||
}
|
||||
|
||||
available = (bufsize += 2048);
|
||||
tokenBegin = 0;
|
||||
}
|
||||
|
||||
protected void FillBuff() throws java.io.IOException
|
||||
{
|
||||
int i;
|
||||
if (maxNextCharInd == 4096)
|
||||
maxNextCharInd = nextCharInd = 0;
|
||||
|
||||
try {
|
||||
if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
|
||||
4096 - maxNextCharInd)) == -1)
|
||||
{
|
||||
inputStream.close();
|
||||
throw new java.io.IOException();
|
||||
}
|
||||
else
|
||||
maxNextCharInd += i;
|
||||
return;
|
||||
}
|
||||
catch(java.io.IOException e) {
|
||||
if (bufpos != 0)
|
||||
{
|
||||
--bufpos;
|
||||
backup(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bufline[bufpos] = line;
|
||||
bufcolumn[bufpos] = column;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
protected char ReadByte() throws java.io.IOException
|
||||
{
|
||||
if (++nextCharInd >= maxNextCharInd)
|
||||
FillBuff();
|
||||
|
||||
return nextCharBuf[nextCharInd];
|
||||
}
|
||||
|
||||
public char BeginToken() throws java.io.IOException
|
||||
{
|
||||
if (inBuf > 0)
|
||||
{
|
||||
--inBuf;
|
||||
|
||||
if (++bufpos == bufsize)
|
||||
bufpos = 0;
|
||||
|
||||
tokenBegin = bufpos;
|
||||
return buffer[bufpos];
|
||||
}
|
||||
|
||||
tokenBegin = 0;
|
||||
bufpos = -1;
|
||||
|
||||
return readChar();
|
||||
}
|
||||
|
||||
protected void AdjustBuffSize()
|
||||
{
|
||||
if (available == bufsize)
|
||||
{
|
||||
if (tokenBegin > 2048)
|
||||
{
|
||||
bufpos = 0;
|
||||
available = tokenBegin;
|
||||
}
|
||||
else
|
||||
ExpandBuff(false);
|
||||
}
|
||||
else if (available > tokenBegin)
|
||||
available = bufsize;
|
||||
else if ((tokenBegin - available) < 2048)
|
||||
ExpandBuff(true);
|
||||
else
|
||||
available = tokenBegin;
|
||||
}
|
||||
|
||||
protected void UpdateLineColumn(char c)
|
||||
{
|
||||
column++;
|
||||
|
||||
if (prevCharIsLF)
|
||||
{
|
||||
prevCharIsLF = false;
|
||||
line += (column = 1);
|
||||
}
|
||||
else if (prevCharIsCR)
|
||||
{
|
||||
prevCharIsCR = false;
|
||||
if (c == '\n')
|
||||
{
|
||||
prevCharIsLF = true;
|
||||
}
|
||||
else
|
||||
line += (column = 1);
|
||||
}
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r' :
|
||||
prevCharIsCR = true;
|
||||
break;
|
||||
case '\n' :
|
||||
prevCharIsLF = true;
|
||||
break;
|
||||
case '\t' :
|
||||
column--;
|
||||
column += (tabSize - (column % tabSize));
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
bufline[bufpos] = line;
|
||||
bufcolumn[bufpos] = column;
|
||||
}
|
||||
|
||||
public char readChar() throws java.io.IOException
|
||||
{
|
||||
if (inBuf > 0)
|
||||
{
|
||||
--inBuf;
|
||||
|
||||
if (++bufpos == bufsize)
|
||||
bufpos = 0;
|
||||
|
||||
return buffer[bufpos];
|
||||
}
|
||||
|
||||
char c;
|
||||
|
||||
if (++bufpos == available)
|
||||
AdjustBuffSize();
|
||||
|
||||
if ((buffer[bufpos] = c = ReadByte()) == '\\')
|
||||
{
|
||||
UpdateLineColumn(c);
|
||||
|
||||
int backSlashCnt = 1;
|
||||
|
||||
for (;;) // Read all the backslashes
|
||||
{
|
||||
if (++bufpos == available)
|
||||
AdjustBuffSize();
|
||||
|
||||
try
|
||||
{
|
||||
if ((buffer[bufpos] = c = ReadByte()) != '\\')
|
||||
{
|
||||
UpdateLineColumn(c);
|
||||
// found a non-backslash char.
|
||||
if ((c == 'u') && ((backSlashCnt & 1) == 1))
|
||||
{
|
||||
if (--bufpos < 0)
|
||||
bufpos = bufsize - 1;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
backup(backSlashCnt);
|
||||
return '\\';
|
||||
}
|
||||
}
|
||||
catch(java.io.IOException e)
|
||||
{
|
||||
if (backSlashCnt > 1)
|
||||
backup(backSlashCnt);
|
||||
|
||||
return '\\';
|
||||
}
|
||||
|
||||
UpdateLineColumn(c);
|
||||
backSlashCnt++;
|
||||
}
|
||||
|
||||
// Here, we have seen an odd number of backslash's followed by a 'u'
|
||||
try
|
||||
{
|
||||
while ((c = ReadByte()) == 'u')
|
||||
++column;
|
||||
|
||||
buffer[bufpos] = c = (char)(hexval(c) << 12 |
|
||||
hexval(ReadByte()) << 8 |
|
||||
hexval(ReadByte()) << 4 |
|
||||
hexval(ReadByte()));
|
||||
|
||||
column += 4;
|
||||
}
|
||||
catch(java.io.IOException e)
|
||||
{
|
||||
throw new Error("Invalid escape character at line " + line +
|
||||
" column " + column + ".");
|
||||
}
|
||||
|
||||
if (backSlashCnt == 1)
|
||||
return c;
|
||||
else
|
||||
{
|
||||
backup(backSlashCnt - 1);
|
||||
return '\\';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateLineColumn(c);
|
||||
return (c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see #getEndColumn
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
public int getColumn() {
|
||||
return bufcolumn[bufpos];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see #getEndLine
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
public int getLine() {
|
||||
return bufline[bufpos];
|
||||
}
|
||||
|
||||
public int getEndColumn() {
|
||||
return bufcolumn[bufpos];
|
||||
}
|
||||
|
||||
public int getEndLine() {
|
||||
return bufline[bufpos];
|
||||
}
|
||||
|
||||
public int getBeginColumn() {
|
||||
return bufcolumn[tokenBegin];
|
||||
}
|
||||
|
||||
public int getBeginLine() {
|
||||
return bufline[tokenBegin];
|
||||
}
|
||||
|
||||
public void backup(int amount) {
|
||||
|
||||
inBuf += amount;
|
||||
if ((bufpos -= amount) < 0)
|
||||
bufpos += bufsize;
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.Reader dstream,
|
||||
int startline, int startcolumn, int buffersize)
|
||||
{
|
||||
inputStream = dstream;
|
||||
line = startline;
|
||||
column = startcolumn - 1;
|
||||
|
||||
available = bufsize = buffersize;
|
||||
buffer = new char[buffersize];
|
||||
bufline = new int[buffersize];
|
||||
bufcolumn = new int[buffersize];
|
||||
nextCharBuf = new char[4096];
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.Reader dstream,
|
||||
int startline, int startcolumn)
|
||||
{
|
||||
this(dstream, startline, startcolumn, 4096);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.Reader dstream)
|
||||
{
|
||||
this(dstream, 1, 1, 4096);
|
||||
}
|
||||
public void ReInit(java.io.Reader dstream,
|
||||
int startline, int startcolumn, int buffersize)
|
||||
{
|
||||
inputStream = dstream;
|
||||
line = startline;
|
||||
column = startcolumn - 1;
|
||||
|
||||
if (buffer == null || buffersize != buffer.length)
|
||||
{
|
||||
available = bufsize = buffersize;
|
||||
buffer = new char[buffersize];
|
||||
bufline = new int[buffersize];
|
||||
bufcolumn = new int[buffersize];
|
||||
nextCharBuf = new char[4096];
|
||||
}
|
||||
prevCharIsLF = prevCharIsCR = false;
|
||||
tokenBegin = inBuf = maxNextCharInd = 0;
|
||||
nextCharInd = bufpos = -1;
|
||||
}
|
||||
|
||||
public void ReInit(java.io.Reader dstream,
|
||||
int startline, int startcolumn)
|
||||
{
|
||||
ReInit(dstream, startline, startcolumn, 4096);
|
||||
}
|
||||
|
||||
public void ReInit(java.io.Reader dstream)
|
||||
{
|
||||
ReInit(dstream, 1, 1, 4096);
|
||||
}
|
||||
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
|
||||
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.InputStream dstream, int startline,
|
||||
int startcolumn, int buffersize)
|
||||
{
|
||||
this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
|
||||
int startcolumn) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
this(dstream, encoding, startline, startcolumn, 4096);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.InputStream dstream, int startline,
|
||||
int startcolumn)
|
||||
{
|
||||
this(dstream, startline, startcolumn, 4096);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
this(dstream, encoding, 1, 1, 4096);
|
||||
}
|
||||
|
||||
public JavaCharStream(java.io.InputStream dstream)
|
||||
{
|
||||
this(dstream, 1, 1, 4096);
|
||||
}
|
||||
|
||||
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
|
||||
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
|
||||
}
|
||||
|
||||
public void ReInit(java.io.InputStream dstream, int startline,
|
||||
int startcolumn, int buffersize)
|
||||
{
|
||||
ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
|
||||
}
|
||||
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
|
||||
int startcolumn) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
ReInit(dstream, encoding, startline, startcolumn, 4096);
|
||||
}
|
||||
public void ReInit(java.io.InputStream dstream, int startline,
|
||||
int startcolumn)
|
||||
{
|
||||
ReInit(dstream, startline, startcolumn, 4096);
|
||||
}
|
||||
public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
|
||||
{
|
||||
ReInit(dstream, encoding, 1, 1, 4096);
|
||||
}
|
||||
|
||||
public void ReInit(java.io.InputStream dstream)
|
||||
{
|
||||
ReInit(dstream, 1, 1, 4096);
|
||||
}
|
||||
|
||||
public String GetImage()
|
||||
{
|
||||
if (bufpos >= tokenBegin)
|
||||
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
|
||||
else
|
||||
return new String(buffer, tokenBegin, bufsize - tokenBegin) +
|
||||
new String(buffer, 0, bufpos + 1);
|
||||
}
|
||||
|
||||
public char[] GetSuffix(int len)
|
||||
{
|
||||
char[] ret = new char[len];
|
||||
|
||||
if ((bufpos + 1) >= len)
|
||||
System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
|
||||
else
|
||||
{
|
||||
System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
|
||||
len - bufpos - 1);
|
||||
System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void Done()
|
||||
{
|
||||
nextCharBuf = null;
|
||||
buffer = null;
|
||||
bufline = null;
|
||||
bufcolumn = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to adjust line and column numbers for the start of a token.
|
||||
*/
|
||||
public void adjustBeginLineColumn(int newLine, int newCol)
|
||||
{
|
||||
int start = tokenBegin;
|
||||
int len;
|
||||
|
||||
if (bufpos >= tokenBegin)
|
||||
{
|
||||
len = bufpos - tokenBegin + inBuf + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
|
||||
}
|
||||
|
||||
int i = 0, j = 0, k = 0;
|
||||
int nextColDiff = 0, columnDiff = 0;
|
||||
|
||||
while (i < len &&
|
||||
bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
|
||||
{
|
||||
bufline[j] = newLine;
|
||||
nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
|
||||
bufcolumn[j] = newCol + columnDiff;
|
||||
columnDiff = nextColDiff;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i < len)
|
||||
{
|
||||
bufline[j] = newLine++;
|
||||
bufcolumn[j] = newCol + columnDiff;
|
||||
|
||||
while (i++ < len)
|
||||
{
|
||||
if (bufline[j = start % bufsize] != bufline[++start % bufsize])
|
||||
bufline[j] = newLine++;
|
||||
else
|
||||
bufline[j] = newLine;
|
||||
}
|
||||
}
|
||||
|
||||
line = bufline[j];
|
||||
column = bufcolumn[j];
|
||||
}
|
||||
|
||||
}
|
||||
7813
Assignment-2/javaparser-1.0.0-src/src/japa/parser/JavaParser.java
Normal file
7813
Assignment-2/javaparser-1.0.0-src/src/japa/parser/JavaParser.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,281 @@
|
||||
/* Generated By:JavaCC: Do not edit this line. JavaParserConstants.java */
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package japa.parser;
|
||||
|
||||
public interface JavaParserConstants {
|
||||
|
||||
int EOF = 0;
|
||||
int SINGLE_LINE_COMMENT = 6;
|
||||
int JAVA_DOC_COMMENT = 9;
|
||||
int MULTI_LINE_COMMENT = 10;
|
||||
int ABSTRACT = 12;
|
||||
int ASSERT = 13;
|
||||
int BOOLEAN = 14;
|
||||
int BREAK = 15;
|
||||
int BYTE = 16;
|
||||
int CASE = 17;
|
||||
int CATCH = 18;
|
||||
int CHAR = 19;
|
||||
int CLASS = 20;
|
||||
int CONST = 21;
|
||||
int CONTINUE = 22;
|
||||
int _DEFAULT = 23;
|
||||
int DO = 24;
|
||||
int DOUBLE = 25;
|
||||
int ELSE = 26;
|
||||
int ENUM = 27;
|
||||
int EXTENDS = 28;
|
||||
int FALSE = 29;
|
||||
int FINAL = 30;
|
||||
int FINALLY = 31;
|
||||
int FLOAT = 32;
|
||||
int FOR = 33;
|
||||
int GOTO = 34;
|
||||
int IF = 35;
|
||||
int IMPLEMENTS = 36;
|
||||
int IMPORT = 37;
|
||||
int INSTANCEOF = 38;
|
||||
int INT = 39;
|
||||
int INTERFACE = 40;
|
||||
int LONG = 41;
|
||||
int NATIVE = 42;
|
||||
int NEW = 43;
|
||||
int NULL = 44;
|
||||
int PACKAGE = 45;
|
||||
int PRIVATE = 46;
|
||||
int PROTECTED = 47;
|
||||
int PUBLIC = 48;
|
||||
int RETURN = 49;
|
||||
int SHORT = 50;
|
||||
int STATIC = 51;
|
||||
int STRICTFP = 52;
|
||||
int SUPER = 53;
|
||||
int SWITCH = 54;
|
||||
int SYNCHRONIZED = 55;
|
||||
int THIS = 56;
|
||||
int THROW = 57;
|
||||
int THROWS = 58;
|
||||
int TRANSIENT = 59;
|
||||
int TRUE = 60;
|
||||
int TRY = 61;
|
||||
int VOID = 62;
|
||||
int VOLATILE = 63;
|
||||
int WHILE = 64;
|
||||
int LONG_LITERAL = 65;
|
||||
int INTEGER_LITERAL = 66;
|
||||
int DECIMAL_LITERAL = 67;
|
||||
int HEX_LITERAL = 68;
|
||||
int OCTAL_LITERAL = 69;
|
||||
int FLOATING_POINT_LITERAL = 70;
|
||||
int DECIMAL_FLOATING_POINT_LITERAL = 71;
|
||||
int DECIMAL_EXPONENT = 72;
|
||||
int HEXADECIMAL_FLOATING_POINT_LITERAL = 73;
|
||||
int HEXADECIMAL_EXPONENT = 74;
|
||||
int CHARACTER_LITERAL = 75;
|
||||
int STRING_LITERAL = 76;
|
||||
int IDENTIFIER = 77;
|
||||
int LETTER = 78;
|
||||
int PART_LETTER = 79;
|
||||
int LPAREN = 80;
|
||||
int RPAREN = 81;
|
||||
int LBRACE = 82;
|
||||
int RBRACE = 83;
|
||||
int LBRACKET = 84;
|
||||
int RBRACKET = 85;
|
||||
int SEMICOLON = 86;
|
||||
int COMMA = 87;
|
||||
int DOT = 88;
|
||||
int AT = 89;
|
||||
int ASSIGN = 90;
|
||||
int LT = 91;
|
||||
int BANG = 92;
|
||||
int TILDE = 93;
|
||||
int HOOK = 94;
|
||||
int COLON = 95;
|
||||
int EQ = 96;
|
||||
int LE = 97;
|
||||
int GE = 98;
|
||||
int NE = 99;
|
||||
int SC_OR = 100;
|
||||
int SC_AND = 101;
|
||||
int INCR = 102;
|
||||
int DECR = 103;
|
||||
int PLUS = 104;
|
||||
int MINUS = 105;
|
||||
int STAR = 106;
|
||||
int SLASH = 107;
|
||||
int BIT_AND = 108;
|
||||
int BIT_OR = 109;
|
||||
int XOR = 110;
|
||||
int REM = 111;
|
||||
int LSHIFT = 112;
|
||||
int PLUSASSIGN = 113;
|
||||
int MINUSASSIGN = 114;
|
||||
int STARASSIGN = 115;
|
||||
int SLASHASSIGN = 116;
|
||||
int ANDASSIGN = 117;
|
||||
int ORASSIGN = 118;
|
||||
int XORASSIGN = 119;
|
||||
int REMASSIGN = 120;
|
||||
int LSHIFTASSIGN = 121;
|
||||
int RSIGNEDSHIFTASSIGN = 122;
|
||||
int RUNSIGNEDSHIFTASSIGN = 123;
|
||||
int ELLIPSIS = 124;
|
||||
int RUNSIGNEDSHIFT = 125;
|
||||
int RSIGNEDSHIFT = 126;
|
||||
int GT = 127;
|
||||
|
||||
int DEFAULT = 0;
|
||||
int IN_JAVA_DOC_COMMENT = 1;
|
||||
int IN_MULTI_LINE_COMMENT = 2;
|
||||
|
||||
String[] tokenImage = {
|
||||
"<EOF>",
|
||||
"\" \"",
|
||||
"\"\\t\"",
|
||||
"\"\\n\"",
|
||||
"\"\\r\"",
|
||||
"\"\\f\"",
|
||||
"<SINGLE_LINE_COMMENT>",
|
||||
"<token of kind 7>",
|
||||
"\"/*\"",
|
||||
"\"*/\"",
|
||||
"\"*/\"",
|
||||
"<token of kind 11>",
|
||||
"\"abstract\"",
|
||||
"\"assert\"",
|
||||
"\"boolean\"",
|
||||
"\"break\"",
|
||||
"\"byte\"",
|
||||
"\"case\"",
|
||||
"\"catch\"",
|
||||
"\"char\"",
|
||||
"\"class\"",
|
||||
"\"const\"",
|
||||
"\"continue\"",
|
||||
"\"default\"",
|
||||
"\"do\"",
|
||||
"\"double\"",
|
||||
"\"else\"",
|
||||
"\"enum\"",
|
||||
"\"extends\"",
|
||||
"\"false\"",
|
||||
"\"final\"",
|
||||
"\"finally\"",
|
||||
"\"float\"",
|
||||
"\"for\"",
|
||||
"\"goto\"",
|
||||
"\"if\"",
|
||||
"\"implements\"",
|
||||
"\"import\"",
|
||||
"\"instanceof\"",
|
||||
"\"int\"",
|
||||
"\"interface\"",
|
||||
"\"long\"",
|
||||
"\"native\"",
|
||||
"\"new\"",
|
||||
"\"null\"",
|
||||
"\"package\"",
|
||||
"\"private\"",
|
||||
"\"protected\"",
|
||||
"\"public\"",
|
||||
"\"return\"",
|
||||
"\"short\"",
|
||||
"\"static\"",
|
||||
"\"strictfp\"",
|
||||
"\"super\"",
|
||||
"\"switch\"",
|
||||
"\"synchronized\"",
|
||||
"\"this\"",
|
||||
"\"throw\"",
|
||||
"\"throws\"",
|
||||
"\"transient\"",
|
||||
"\"true\"",
|
||||
"\"try\"",
|
||||
"\"void\"",
|
||||
"\"volatile\"",
|
||||
"\"while\"",
|
||||
"<LONG_LITERAL>",
|
||||
"<INTEGER_LITERAL>",
|
||||
"<DECIMAL_LITERAL>",
|
||||
"<HEX_LITERAL>",
|
||||
"<OCTAL_LITERAL>",
|
||||
"<FLOATING_POINT_LITERAL>",
|
||||
"<DECIMAL_FLOATING_POINT_LITERAL>",
|
||||
"<DECIMAL_EXPONENT>",
|
||||
"<HEXADECIMAL_FLOATING_POINT_LITERAL>",
|
||||
"<HEXADECIMAL_EXPONENT>",
|
||||
"<CHARACTER_LITERAL>",
|
||||
"<STRING_LITERAL>",
|
||||
"<IDENTIFIER>",
|
||||
"<LETTER>",
|
||||
"<PART_LETTER>",
|
||||
"\"(\"",
|
||||
"\")\"",
|
||||
"\"{\"",
|
||||
"\"}\"",
|
||||
"\"[\"",
|
||||
"\"]\"",
|
||||
"\";\"",
|
||||
"\",\"",
|
||||
"\".\"",
|
||||
"\"@\"",
|
||||
"\"=\"",
|
||||
"\"<\"",
|
||||
"\"!\"",
|
||||
"\"~\"",
|
||||
"\"?\"",
|
||||
"\":\"",
|
||||
"\"==\"",
|
||||
"\"<=\"",
|
||||
"\">=\"",
|
||||
"\"!=\"",
|
||||
"\"||\"",
|
||||
"\"&&\"",
|
||||
"\"++\"",
|
||||
"\"--\"",
|
||||
"\"+\"",
|
||||
"\"-\"",
|
||||
"\"*\"",
|
||||
"\"/\"",
|
||||
"\"&\"",
|
||||
"\"|\"",
|
||||
"\"^\"",
|
||||
"\"%\"",
|
||||
"\"<<\"",
|
||||
"\"+=\"",
|
||||
"\"-=\"",
|
||||
"\"*=\"",
|
||||
"\"/=\"",
|
||||
"\"&=\"",
|
||||
"\"|=\"",
|
||||
"\"^=\"",
|
||||
"\"%=\"",
|
||||
"\"<<=\"",
|
||||
"\">>=\"",
|
||||
"\">>>=\"",
|
||||
"\"...\"",
|
||||
"\">>>\"",
|
||||
"\">>\"",
|
||||
"\">\"",
|
||||
"\"\\u001a\"",
|
||||
};
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,201 @@
|
||||
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
|
||||
package japa.parser;
|
||||
|
||||
/**
|
||||
* This exception is thrown when parse errors are encountered.
|
||||
* You can explicitly create objects of this exception type by
|
||||
* calling the method generateParseException in the generated
|
||||
* parser.
|
||||
*
|
||||
* You can modify this class to customize your error reporting
|
||||
* mechanisms so long as you retain the public fields.
|
||||
*/
|
||||
public class ParseException extends Exception {
|
||||
|
||||
/**
|
||||
* This constructor is used by the method "generateParseException"
|
||||
* in the generated parser. Calling this constructor generates
|
||||
* a new object of this type with the fields "currentToken",
|
||||
* "expectedTokenSequences", and "tokenImage" set. The boolean
|
||||
* flag "specialConstructor" is also set to true to indicate that
|
||||
* this constructor was used to create this object.
|
||||
* This constructor calls its super class with the empty string
|
||||
* to force the "toString" method of parent class "Throwable" to
|
||||
* print the error message in the form:
|
||||
* ParseException: <result of getMessage>
|
||||
*/
|
||||
public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
|
||||
super("");
|
||||
specialConstructor = true;
|
||||
currentToken = currentTokenVal;
|
||||
expectedTokenSequences = expectedTokenSequencesVal;
|
||||
tokenImage = tokenImageVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* The following constructors are for use by you for whatever
|
||||
* purpose you can think of. Constructing the exception in this
|
||||
* manner makes the exception behave in the normal way - i.e., as
|
||||
* documented in the class "Throwable". The fields "errorToken",
|
||||
* "expectedTokenSequences", and "tokenImage" do not contain
|
||||
* relevant information. The JavaCC generated code does not use
|
||||
* these constructors.
|
||||
*/
|
||||
|
||||
public ParseException() {
|
||||
super();
|
||||
specialConstructor = false;
|
||||
}
|
||||
|
||||
public ParseException(Token currentTokenVal, String message) {
|
||||
super(message);
|
||||
currentToken = currentTokenVal;
|
||||
specialConstructor = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This variable determines which constructor was used to create
|
||||
* this object and thereby affects the semantics of the
|
||||
* "getMessage" method (see below).
|
||||
*/
|
||||
protected boolean specialConstructor;
|
||||
|
||||
/**
|
||||
* This is the last token that has been consumed successfully. If
|
||||
* this object has been created due to a parse error, the token
|
||||
* followng this token will (therefore) be the first error token.
|
||||
*/
|
||||
public Token currentToken;
|
||||
|
||||
/**
|
||||
* Each entry in this array is an array of integers. Each array
|
||||
* of integers represents a sequence of tokens (by their ordinal
|
||||
* values) that is expected at this point of the parse.
|
||||
*/
|
||||
public int[][] expectedTokenSequences;
|
||||
|
||||
/**
|
||||
* This is a reference to the "tokenImage" array of the generated
|
||||
* parser within which the parse error occurred. This array is
|
||||
* defined in the generated ...Constants interface.
|
||||
*/
|
||||
public String[] tokenImage;
|
||||
|
||||
/**
|
||||
* This method has the standard behavior when this object has been
|
||||
* created using the standard constructors. Otherwise, it uses
|
||||
* "currentToken" and "expectedTokenSequences" to generate a parse
|
||||
* error message and returns it. If this object has been created
|
||||
* due to a parse error, and you do not catch it (it gets thrown
|
||||
* from the parser), then this method is called during the printing
|
||||
* of the final stack trace, and hence the correct error message
|
||||
* gets displayed.
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
if (!specialConstructor) {
|
||||
if (currentToken == null) {
|
||||
return super.getMessage();
|
||||
}
|
||||
StringBuilder ret = new StringBuilder();
|
||||
ret.append(super.getMessage());
|
||||
ret.append(": \"");
|
||||
ret.append(currentToken.image);
|
||||
ret.append("\" at line ");
|
||||
ret.append(currentToken.beginLine);
|
||||
ret.append(", column ");
|
||||
ret.append(currentToken.beginColumn);
|
||||
return ret.toString();
|
||||
}
|
||||
StringBuffer expected = new StringBuffer();
|
||||
int maxSize = 0;
|
||||
for (int i = 0; i < expectedTokenSequences.length; i++) {
|
||||
if (maxSize < expectedTokenSequences[i].length) {
|
||||
maxSize = expectedTokenSequences[i].length;
|
||||
}
|
||||
for (int j = 0; j < expectedTokenSequences[i].length; j++) {
|
||||
expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
|
||||
}
|
||||
if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
|
||||
expected.append("...");
|
||||
}
|
||||
expected.append(eol).append(" ");
|
||||
}
|
||||
String retval = "Encountered \"";
|
||||
Token tok = currentToken.next;
|
||||
for (int i = 0; i < maxSize; i++) {
|
||||
if (i != 0)
|
||||
retval += " ";
|
||||
if (tok.kind == 0) {
|
||||
retval += tokenImage[0];
|
||||
break;
|
||||
}
|
||||
retval += add_escapes(tok.image);
|
||||
tok = tok.next;
|
||||
}
|
||||
retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
|
||||
retval += "." + eol;
|
||||
if (expectedTokenSequences.length == 1) {
|
||||
retval += "Was expecting:" + eol + " ";
|
||||
} else {
|
||||
retval += "Was expecting one of:" + eol + " ";
|
||||
}
|
||||
retval += expected.toString();
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* The end of line string for this machine.
|
||||
*/
|
||||
protected String eol = System.getProperty("line.separator", "\n");
|
||||
|
||||
/**
|
||||
* Used to convert raw characters to their escaped version
|
||||
* when these raw version cannot be used as part of an ASCII
|
||||
* string literal.
|
||||
*/
|
||||
protected String add_escapes(String str) {
|
||||
StringBuffer retval = new StringBuffer();
|
||||
char ch;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
switch (str.charAt(i)) {
|
||||
case 0:
|
||||
continue;
|
||||
case '\b':
|
||||
retval.append("\\b");
|
||||
continue;
|
||||
case '\t':
|
||||
retval.append("\\t");
|
||||
continue;
|
||||
case '\n':
|
||||
retval.append("\\n");
|
||||
continue;
|
||||
case '\f':
|
||||
retval.append("\\f");
|
||||
continue;
|
||||
case '\r':
|
||||
retval.append("\\r");
|
||||
continue;
|
||||
case '\"':
|
||||
retval.append("\\\"");
|
||||
continue;
|
||||
case '\'':
|
||||
retval.append("\\\'");
|
||||
continue;
|
||||
case '\\':
|
||||
retval.append("\\\\");
|
||||
continue;
|
||||
default:
|
||||
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
|
||||
String s = "0000" + Integer.toString(ch, 16);
|
||||
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
|
||||
} else {
|
||||
retval.append(ch);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return retval.toString();
|
||||
}
|
||||
|
||||
}
|
||||
88
Assignment-2/javaparser-1.0.0-src/src/japa/parser/Token.java
Normal file
88
Assignment-2/javaparser-1.0.0-src/src/japa/parser/Token.java
Normal file
@@ -0,0 +1,88 @@
|
||||
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
|
||||
package japa.parser;
|
||||
|
||||
/**
|
||||
* Describes the input token stream.
|
||||
*/
|
||||
|
||||
public class Token {
|
||||
|
||||
/**
|
||||
* An integer that describes the kind of this token. This numbering
|
||||
* system is determined by JavaCCParser, and a table of these numbers is
|
||||
* stored in the file ...Constants.java.
|
||||
*/
|
||||
public int kind;
|
||||
|
||||
/**
|
||||
* beginLine and beginColumn describe the position of the first character
|
||||
* of this token; endLine and endColumn describe the position of the
|
||||
* last character of this token.
|
||||
*/
|
||||
public int beginLine, beginColumn, endLine, endColumn;
|
||||
|
||||
/**
|
||||
* The string image of the token.
|
||||
*/
|
||||
public String image;
|
||||
|
||||
/**
|
||||
* A reference to the next regular (non-special) token from the input
|
||||
* stream. If this is the last token from the input stream, or if the
|
||||
* token manager has not read tokens beyond this one, this field is
|
||||
* set to null. This is true only if this token is also a regular
|
||||
* token. Otherwise, see below for a description of the contents of
|
||||
* this field.
|
||||
*/
|
||||
public Token next;
|
||||
|
||||
/**
|
||||
* This field is used to access special tokens that occur prior to this
|
||||
* token, but after the immediately preceding regular (non-special) token.
|
||||
* If there are no such special tokens, this field is set to null.
|
||||
* When there are more than one such special token, this field refers
|
||||
* to the last of these special tokens, which in turn refers to the next
|
||||
* previous special token through its specialToken field, and so on
|
||||
* until the first special token (whose specialToken field is null).
|
||||
* The next fields of special tokens refer to other special tokens that
|
||||
* immediately follow it (without an intervening regular token). If there
|
||||
* is no such token, this field is null.
|
||||
*/
|
||||
public Token specialToken;
|
||||
|
||||
/**
|
||||
* Returns the image.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new Token object, by default. However, if you want, you
|
||||
* can create and return subclass objects based on the value of ofKind.
|
||||
* Simply add the cases to the switch for all those special cases.
|
||||
* For example, if you have a subclass of Token called IDToken that
|
||||
* you want to create if ofKind is ID, simlpy add something like :
|
||||
*
|
||||
* case MyParserConstants.ID : return new IDToken();
|
||||
*
|
||||
* to the following switch statement. Then you can cast matchedToken
|
||||
* variable to the appropriate type and use it in your lexical actions.
|
||||
*/
|
||||
public static final Token newToken(int ofKind) {
|
||||
switch (ofKind) {
|
||||
default:
|
||||
return new Token();
|
||||
case JavaParserConstants.RUNSIGNEDSHIFT:
|
||||
case JavaParserConstants.RSIGNEDSHIFT:
|
||||
case JavaParserConstants.GT:
|
||||
return new GTToken();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GTToken extends Token {
|
||||
|
||||
int realKind = JavaParserConstants.GT;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
|
||||
package japa.parser;
|
||||
|
||||
public class TokenMgrError extends Error
|
||||
{
|
||||
/*
|
||||
* Ordinals for various reasons why an Error of this type can be thrown.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Lexical error occured.
|
||||
*/
|
||||
static final int LEXICAL_ERROR = 0 ;
|
||||
|
||||
/**
|
||||
* An attempt wass made to create a second instance of a static token manager.
|
||||
*/
|
||||
static final int STATIC_LEXER_ERROR = 1;
|
||||
|
||||
/**
|
||||
* Tried to change to an invalid lexical state.
|
||||
*/
|
||||
static final int INVALID_LEXICAL_STATE = 2;
|
||||
|
||||
/**
|
||||
* Detected (and bailed out of) an infinite loop in the token manager.
|
||||
*/
|
||||
static final int LOOP_DETECTED = 3;
|
||||
|
||||
/**
|
||||
* Indicates the reason why the exception is thrown. It will have
|
||||
* one of the above 4 values.
|
||||
*/
|
||||
int errorCode;
|
||||
|
||||
/**
|
||||
* Replaces unprintable characters by their espaced (or unicode escaped)
|
||||
* equivalents in the given string
|
||||
*/
|
||||
protected static final String addEscapes(String str) {
|
||||
StringBuffer retval = new StringBuffer();
|
||||
char ch;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
switch (str.charAt(i))
|
||||
{
|
||||
case 0 :
|
||||
continue;
|
||||
case '\b':
|
||||
retval.append("\\b");
|
||||
continue;
|
||||
case '\t':
|
||||
retval.append("\\t");
|
||||
continue;
|
||||
case '\n':
|
||||
retval.append("\\n");
|
||||
continue;
|
||||
case '\f':
|
||||
retval.append("\\f");
|
||||
continue;
|
||||
case '\r':
|
||||
retval.append("\\r");
|
||||
continue;
|
||||
case '\"':
|
||||
retval.append("\\\"");
|
||||
continue;
|
||||
case '\'':
|
||||
retval.append("\\\'");
|
||||
continue;
|
||||
case '\\':
|
||||
retval.append("\\\\");
|
||||
continue;
|
||||
default:
|
||||
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
|
||||
String s = "0000" + Integer.toString(ch, 16);
|
||||
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
|
||||
} else {
|
||||
retval.append(ch);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return retval.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a detailed message for the Error when it is thrown by the
|
||||
* token manager to indicate a lexical error.
|
||||
* Parameters :
|
||||
* EOFSeen : indicates if EOF caused the lexicl error
|
||||
* curLexState : lexical state in which this error occured
|
||||
* errorLine : line number when the error occured
|
||||
* errorColumn : column number when the error occured
|
||||
* errorAfter : prefix that was seen before this error occured
|
||||
* curchar : the offending character
|
||||
* Note: You can customize the lexical error message by modifying this method.
|
||||
*/
|
||||
protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
|
||||
return("Lexical error at line " +
|
||||
errorLine + ", column " +
|
||||
errorColumn + ". Encountered: " +
|
||||
(EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
|
||||
"after : \"" + addEscapes(errorAfter) + "\"");
|
||||
}
|
||||
|
||||
/**
|
||||
* You can also modify the body of this method to customize your error messages.
|
||||
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
|
||||
* of end-users concern, so you can return something like :
|
||||
*
|
||||
* "Internal Error : Please file a bug report .... "
|
||||
*
|
||||
* from this method for such cases in the release version of your parser.
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return super.getMessage();
|
||||
}
|
||||
|
||||
/*
|
||||
* Constructors of various flavors follow.
|
||||
*/
|
||||
|
||||
public TokenMgrError() {
|
||||
}
|
||||
|
||||
public TokenMgrError(String message, int reason) {
|
||||
super(message);
|
||||
errorCode = reason;
|
||||
}
|
||||
|
||||
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
|
||||
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 23/05/2008
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* <p>AST node that represent block comments.</p>
|
||||
*
|
||||
* Block comments can has multi lines and are delimited
|
||||
* by "/*" and "*/".
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class BlockComment extends Comment {
|
||||
|
||||
public BlockComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) {
|
||||
super(beginLine, beginColumn, endLine, endColumn, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 23/05/2008
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.body.JavadocComment;
|
||||
|
||||
/**
|
||||
* Abstract class for all AST nodes that represent comments.
|
||||
*
|
||||
* @see BlockComment
|
||||
* @see LineComment
|
||||
* @see JavadocComment
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class Comment extends Node {
|
||||
|
||||
private final String content;
|
||||
|
||||
public Comment(int beginLine, int beginColumn, int endLine, int endColumn, String content) {
|
||||
super(beginLine, beginColumn, endLine, endColumn);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the text of the comment.
|
||||
* @return text of the comment
|
||||
*/
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.body.AnnotationDeclaration;
|
||||
import japa.parser.ast.body.ClassOrInterfaceDeclaration;
|
||||
import japa.parser.ast.body.EmptyTypeDeclaration;
|
||||
import japa.parser.ast.body.EnumDeclaration;
|
||||
import japa.parser.ast.body.JavadocComment;
|
||||
import japa.parser.ast.body.TypeDeclaration;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>This class represents the entire compilation unit. Each java
|
||||
* file denotes a compilation unit.</p>
|
||||
*
|
||||
* The CompilationUnit is constructed following the syntax:<br>
|
||||
* <code>
|
||||
* <table>
|
||||
* <tr valign=baseline>
|
||||
* <td align=right>CompilationUnit</td>
|
||||
* <td align=center>::=</td>
|
||||
* <td align=left>
|
||||
* ( {@link PackageDeclaration} )?<br>
|
||||
* ( {@link ImportDeclaration} )*<br>
|
||||
* ( {@link TypeDeclaration} )*<br>
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </code>
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class CompilationUnit extends Node {
|
||||
|
||||
private final PackageDeclaration pakage;
|
||||
|
||||
private final List<ImportDeclaration> imports;
|
||||
|
||||
private final List<TypeDeclaration> types;
|
||||
|
||||
private final List<Comment> comments;
|
||||
|
||||
public CompilationUnit(int line, int column, PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration> types, List<Comment> comments) {
|
||||
super(line, column);
|
||||
this.pakage = pakage;
|
||||
this.imports = imports;
|
||||
this.types = types;
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the package declaration of this compilation unit.<br>
|
||||
* If this compilation unit has no package declaration (default package),
|
||||
* <code>null</code> is returned.
|
||||
* @return the package declaration or <code>null</code>
|
||||
*/
|
||||
public PackageDeclaration getPakage() {
|
||||
return pakage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of imports declared in this compilation unit or
|
||||
* <code>null</code> if there is no import.
|
||||
* @return the list of imports or <code>null</code> if there is no import
|
||||
*/
|
||||
public List<ImportDeclaration> getImports() {
|
||||
return imports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of types declared in this compilation unit.<br>
|
||||
* If there is no types declared, <code>null</code> is returned.
|
||||
* @return the list of types or <code>null</code> null if there is no type
|
||||
* @see AnnotationDeclaration
|
||||
* @see ClassOrInterfaceDeclaration
|
||||
* @see EmptyTypeDeclaration
|
||||
* @see EnumDeclaration
|
||||
*/
|
||||
public List<TypeDeclaration> getTypes() {
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list containing all comments declared in this compilation unit.
|
||||
* Including javadocs, line comments and block comments of all types,
|
||||
* inner-classes and other members.<br>
|
||||
* If there is no comment, <code>null</code> is returned.
|
||||
* @return list with all comments of this compilation unit of <code>null</code>
|
||||
* @see JavadocComment
|
||||
* @see LineComment
|
||||
* @see BlockComment
|
||||
*/
|
||||
public List<Comment> getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.expr.NameExpr;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* <p>This class represents a import declaration. Imports are
|
||||
* optional for the {@link CompilationUnit}.</p>
|
||||
*
|
||||
* The ImportDeclaration is constructed following the syntax:<br>
|
||||
* <code>
|
||||
* <table>
|
||||
* <tr valign=baseline>
|
||||
* <td align=right>ImportDeclaration</td>
|
||||
* <td align=center>::=</td>
|
||||
* <td align=left>
|
||||
* "import" ( "static" )? {@link NameExpr} ( "." "*" )? ";"
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </code>
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ImportDeclaration extends Node {
|
||||
|
||||
private final NameExpr name;
|
||||
|
||||
private final boolean isStatic;
|
||||
|
||||
private final boolean isAsterisk;
|
||||
|
||||
public ImportDeclaration(int line, int column, NameExpr name, boolean isStatic, boolean isAsterisk) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.isStatic = isStatic;
|
||||
this.isAsterisk = isAsterisk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the name of the import.
|
||||
* @return the name of the import
|
||||
*/
|
||||
public NameExpr getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the import is static.
|
||||
* @return <code>true</code> if the import is static, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean isStatic() {
|
||||
return isStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the import ends with "*".
|
||||
* @return <code>true</code> if the import ends with "*", <code>false</code> otherwise
|
||||
*/
|
||||
public boolean isAsterisk() {
|
||||
return isAsterisk;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 23/05/2008
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* <p>AST node that represent line comments.</p>
|
||||
*
|
||||
* Line comments are started with "//" and finish at
|
||||
* the end of the line ("\n").
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class LineComment extends Comment {
|
||||
|
||||
public LineComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) {
|
||||
super(beginLine, beginColumn, endLine, endColumn, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
142
Assignment-2/javaparser-1.0.0-src/src/japa/parser/ast/Node.java
Normal file
142
Assignment-2/javaparser-1.0.0-src/src/japa/parser/ast/Node.java
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.visitor.DumpVisitor;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* Abstract class for all nodes of the AST.
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class Node {
|
||||
|
||||
private final int beginLine;
|
||||
|
||||
private final int beginColumn;
|
||||
|
||||
private final int endLine;
|
||||
|
||||
private final int endColumn;
|
||||
|
||||
/**
|
||||
* This attribute can store additional information from semantic analysis.
|
||||
*/
|
||||
private Object data;
|
||||
|
||||
@Deprecated
|
||||
public Node(int line, int column) {
|
||||
this.beginLine = line;
|
||||
this.beginColumn = column;
|
||||
this.endLine = line;
|
||||
this.endColumn = column;
|
||||
}
|
||||
|
||||
public Node(int beginLine, int beginColumn, int endLine, int endColumn) {
|
||||
this.beginLine = beginLine;
|
||||
this.beginColumn = beginColumn;
|
||||
this.endLine = endLine;
|
||||
this.endColumn = endColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to retrieve additional information associated to this node.
|
||||
*/
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to store additional information to this node.
|
||||
*/
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the begin line of this node.
|
||||
* @return the begin line of this node
|
||||
*/
|
||||
public final int getBeginLine() {
|
||||
return beginLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the begin column of this node.
|
||||
* @return the begin column of this node
|
||||
*/
|
||||
public final int getBeginColumn() {
|
||||
return beginColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the end line of this node.
|
||||
* @return the end line of this node
|
||||
*/
|
||||
public final int getEndLine() {
|
||||
return endLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the end column of this node.
|
||||
* @return the end column of this node
|
||||
*/
|
||||
public final int getEndColumn() {
|
||||
return endColumn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept method for visitor support.
|
||||
* @param <A> the type the argument passed for the visitor
|
||||
* @param v the visitor implementation
|
||||
* @param arg any value relevant for the visitor
|
||||
*/
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept method for visitor support.
|
||||
* @param <R> the type the return value of the visitor
|
||||
* @param <A> the type the argument passed for the visitor
|
||||
* @param v the visitor implementation
|
||||
* @param arg any value relevant for the visitor
|
||||
* @return the result of the visit
|
||||
*/
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the String representation of this node.
|
||||
* @return the String representation of this node
|
||||
*/
|
||||
@Override
|
||||
public final String toString() {
|
||||
DumpVisitor visitor = new DumpVisitor();
|
||||
accept(visitor, null);
|
||||
return visitor.getSource();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 17/10/2007
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.expr.NameExpr;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>This class represents the package declaration. The package
|
||||
* declaration is optional for the {@link CompilationUnit}.</p>
|
||||
*
|
||||
* The PackageDeclaration is constructed following the syntax:<br>
|
||||
* <code>
|
||||
* <table>
|
||||
* <tr valign=baseline>
|
||||
* <td align=right>PackageDeclaration</td>
|
||||
* <td align=center>::=</td>
|
||||
* <td align=left>
|
||||
* ( {@link AnnotationExpr} )* "package" {@link NameExpr} ) ";"
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </code>
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class PackageDeclaration extends Node {
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final NameExpr name;
|
||||
|
||||
public PackageDeclaration(int line, int column, List<AnnotationExpr> annotations, NameExpr name) {
|
||||
super(line, column);
|
||||
this.annotations = annotations;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of annotations declared before the package
|
||||
* declaration. Return <code>null</code> if there are no annotations.
|
||||
* @return list of annotations or <code>null</code>
|
||||
*/
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the package.
|
||||
* @return the name of the package
|
||||
*/
|
||||
public NameExpr getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast;
|
||||
|
||||
import japa.parser.ast.type.ClassOrInterfaceType;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>This class represents the declaration of a genetics argument.</p>
|
||||
*
|
||||
* The TypeParameter is constructed following the syntax:<br>
|
||||
* <code>
|
||||
* <table>
|
||||
* <tr valign=baseline>
|
||||
* <td align=right>TypeParameter</td>
|
||||
* <td align=center>::=</td>
|
||||
* <td align=left>
|
||||
* <IDENTIFIER> ( "extends" {@link ClassOrInterfaceType} ( "&" {@link ClassOrInterfaceType} )* )?
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </code>
|
||||
*
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class TypeParameter extends Node {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<ClassOrInterfaceType> typeBound;
|
||||
|
||||
public TypeParameter(int line, int column, String name, List<ClassOrInterfaceType> typeBound) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.typeBound = typeBound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the paramenter.
|
||||
* @return the name of the paramenter
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of {@link ClassOrInterfaceType} that this parameter
|
||||
* extends. Return <code>null</code> null if there are no type.
|
||||
* @return list of types that this paramente extends or <code>null</code>
|
||||
*/
|
||||
public List<ClassOrInterfaceType> getTypeBound() {
|
||||
return typeBound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class AnnotationDeclaration extends TypeDeclaration {
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
public AnnotationDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, String name, List<BodyDeclaration> members) {
|
||||
super(line, column, javaDoc, name, modifiers, members);
|
||||
this.annotations = annotations;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class AnnotationMemberDeclaration extends BodyDeclaration {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final Expression defaultValue;
|
||||
|
||||
public AnnotationMemberDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, Type type, String name, Expression defaultValue) {
|
||||
super(line, column, javaDoc);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Expression getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class BodyDeclaration extends Node {
|
||||
|
||||
private final JavadocComment javaDoc;
|
||||
|
||||
public BodyDeclaration(int line, int column, JavadocComment javaDoc) {
|
||||
super(line, column);
|
||||
this.javaDoc = javaDoc;
|
||||
}
|
||||
|
||||
public JavadocComment getJavaDoc() {
|
||||
return javaDoc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.TypeParameter;
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.type.ClassOrInterfaceType;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ClassOrInterfaceDeclaration extends TypeDeclaration {
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final boolean isInterface;
|
||||
|
||||
private final List<TypeParameter> typeParameters;
|
||||
|
||||
private final List<ClassOrInterfaceType> extendsList;
|
||||
|
||||
private final List<ClassOrInterfaceType> implementsList;
|
||||
|
||||
public ClassOrInterfaceDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, boolean isInterface, String name, List<TypeParameter> typeParameters, List<ClassOrInterfaceType> extendsList, List<ClassOrInterfaceType> implementsList, List<BodyDeclaration> members) {
|
||||
super(line, column, javaDoc, name, modifiers, members);
|
||||
this.annotations = annotations;
|
||||
this.isInterface = isInterface;
|
||||
this.typeParameters = typeParameters;
|
||||
this.extendsList = extendsList;
|
||||
this.implementsList = implementsList;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public boolean isInterface() {
|
||||
return isInterface;
|
||||
}
|
||||
|
||||
public List<TypeParameter> getTypeParameters() {
|
||||
return typeParameters;
|
||||
}
|
||||
|
||||
public List<ClassOrInterfaceType> getExtends() {
|
||||
return extendsList;
|
||||
}
|
||||
|
||||
public List<ClassOrInterfaceType> getImplements() {
|
||||
return implementsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.TypeParameter;
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.expr.NameExpr;
|
||||
import japa.parser.ast.stmt.BlockStmt;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ConstructorDeclaration extends BodyDeclaration {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final List<TypeParameter> typeParameters;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<Parameter> parameters;
|
||||
|
||||
private final List<NameExpr> throws_;
|
||||
|
||||
private final BlockStmt block;
|
||||
|
||||
public ConstructorDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, String name, List<Parameter> parameters, List<NameExpr> throws_, BlockStmt block) {
|
||||
super(line, column, javaDoc);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.typeParameters = typeParameters;
|
||||
this.name = name;
|
||||
this.parameters = parameters;
|
||||
this.throws_ = throws_;
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public List<TypeParameter> getTypeParameters() {
|
||||
return typeParameters;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Parameter> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public List<NameExpr> getThrows() {
|
||||
return throws_;
|
||||
}
|
||||
|
||||
public BlockStmt getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EmptyMemberDeclaration extends BodyDeclaration {
|
||||
|
||||
public EmptyMemberDeclaration(int line, int column, JavadocComment javaDoc) {
|
||||
super(line, column, javaDoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 20/01/2007
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EmptyTypeDeclaration extends TypeDeclaration {
|
||||
|
||||
public EmptyTypeDeclaration(int line, int column, JavadocComment javaDoc) {
|
||||
super(line, column, javaDoc, null, 0, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EnumConstantDeclaration extends BodyDeclaration {
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<Expression> args;
|
||||
|
||||
private final List<BodyDeclaration> classBody;
|
||||
|
||||
public EnumConstantDeclaration(int line, int column, JavadocComment javaDoc, List<AnnotationExpr> annotations, String name, List<Expression> args, List<BodyDeclaration> classBody) {
|
||||
super(line, column, javaDoc);
|
||||
this.annotations = annotations;
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
this.classBody = classBody;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Expression> getArgs() {
|
||||
return args;
|
||||
}
|
||||
|
||||
public List<BodyDeclaration> getClassBody() {
|
||||
return classBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.type.ClassOrInterfaceType;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EnumDeclaration extends TypeDeclaration {
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final List<ClassOrInterfaceType> implementsList;
|
||||
|
||||
private final List<EnumConstantDeclaration> entries;
|
||||
|
||||
public EnumDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, String name, List<ClassOrInterfaceType> implementsList, List<EnumConstantDeclaration> entries, List<BodyDeclaration> members) {
|
||||
super(line, column, javaDoc, name, modifiers, members);
|
||||
this.annotations = annotations;
|
||||
this.implementsList = implementsList;
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public List<ClassOrInterfaceType> getImplements() {
|
||||
return implementsList;
|
||||
}
|
||||
|
||||
public List<EnumConstantDeclaration> getEntries() {
|
||||
return entries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class FieldDeclaration extends BodyDeclaration {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final List<VariableDeclarator> variables;
|
||||
|
||||
public FieldDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, Type type, List<VariableDeclarator> variables) {
|
||||
super(line, column, javaDoc);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.type = type;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<VariableDeclarator> getVariables() {
|
||||
return variables;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.stmt.BlockStmt;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class InitializerDeclaration extends BodyDeclaration {
|
||||
|
||||
private final boolean isStatic;
|
||||
|
||||
private final BlockStmt block;
|
||||
|
||||
public InitializerDeclaration(int line, int column, JavadocComment javaDoc, boolean isStatic, BlockStmt block) {
|
||||
super(line, column, javaDoc);
|
||||
this.isStatic = isStatic;
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public boolean isStatic() {
|
||||
return isStatic;
|
||||
}
|
||||
|
||||
public BlockStmt getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 23/05/2008
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.Comment;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class JavadocComment extends Comment {
|
||||
|
||||
public JavadocComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) {
|
||||
super(beginLine, beginColumn, endLine, endColumn, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.TypeParameter;
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.expr.NameExpr;
|
||||
import japa.parser.ast.stmt.BlockStmt;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class MethodDeclaration extends BodyDeclaration {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final List<TypeParameter> typeParameters;
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<Parameter> parameters;
|
||||
|
||||
private final int arrayCount;
|
||||
|
||||
private final List<NameExpr> throws_;
|
||||
|
||||
private final BlockStmt body;
|
||||
|
||||
public MethodDeclaration(int line, int column, JavadocComment javaDoc, int modifiers, List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, Type type, String name, List<Parameter> parameters, int arrayCount, List<NameExpr> throws_, BlockStmt block) {
|
||||
super(line, column, javaDoc);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.typeParameters = typeParameters;
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.parameters = parameters;
|
||||
this.arrayCount = arrayCount;
|
||||
this.throws_ = throws_;
|
||||
this.body = block;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public List<TypeParameter> getTypeParameters() {
|
||||
return typeParameters;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Parameter> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public int getArrayCount() {
|
||||
return arrayCount;
|
||||
}
|
||||
|
||||
public List<NameExpr> getThrows() {
|
||||
return throws_;
|
||||
}
|
||||
|
||||
public BlockStmt getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ParseException;
|
||||
import japa.parser.Token;
|
||||
|
||||
/**
|
||||
* Class to hold modifiers.
|
||||
*/
|
||||
public final class ModifierSet {
|
||||
|
||||
private ModifierSet() {
|
||||
}
|
||||
|
||||
/* Definitions of the bits in the modifiers field. */
|
||||
public static final int PUBLIC = 0x0001;
|
||||
|
||||
public static final int PROTECTED = 0x0002;
|
||||
|
||||
public static final int PRIVATE = 0x0004;
|
||||
|
||||
public static final int ABSTRACT = 0x0008;
|
||||
|
||||
public static final int STATIC = 0x0010;
|
||||
|
||||
public static final int FINAL = 0x0020;
|
||||
|
||||
public static final int SYNCHRONIZED = 0x0040;
|
||||
|
||||
public static final int NATIVE = 0x0080;
|
||||
|
||||
public static final int TRANSIENT = 0x0100;
|
||||
|
||||
public static final int VOLATILE = 0x0200;
|
||||
|
||||
public static final int STRICTFP = 0x1000;
|
||||
|
||||
/** A set of accessors that indicate whether the specified modifier
|
||||
is in the set. */
|
||||
|
||||
public static boolean isPublic(int modifiers) {
|
||||
return (modifiers & PUBLIC) != 0;
|
||||
}
|
||||
|
||||
public static boolean isProtected(int modifiers) {
|
||||
return (modifiers & PROTECTED) != 0;
|
||||
}
|
||||
|
||||
public static boolean isPrivate(int modifiers) {
|
||||
return (modifiers & PRIVATE) != 0;
|
||||
}
|
||||
|
||||
public static boolean isStatic(int modifiers) {
|
||||
return (modifiers & STATIC) != 0;
|
||||
}
|
||||
|
||||
public static boolean isAbstract(int modifiers) {
|
||||
return (modifiers & ABSTRACT) != 0;
|
||||
}
|
||||
|
||||
public static boolean isFinal(int modifiers) {
|
||||
return (modifiers & FINAL) != 0;
|
||||
}
|
||||
|
||||
public static boolean isNative(int modifiers) {
|
||||
return (modifiers & NATIVE) != 0;
|
||||
}
|
||||
|
||||
public static boolean isStrictfp(int modifiers) {
|
||||
return (modifiers & STRICTFP) != 0;
|
||||
}
|
||||
|
||||
public static boolean isSynchronized(int modifiers) {
|
||||
return (modifiers & SYNCHRONIZED) != 0;
|
||||
}
|
||||
|
||||
public static boolean isTransient(int modifiers) {
|
||||
return (modifiers & TRANSIENT) != 0;
|
||||
}
|
||||
|
||||
public static boolean isVolatile(int modifiers) {
|
||||
return (modifiers & VOLATILE) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given modifier.
|
||||
*/
|
||||
public static int addModifier(int modifiers, int mod) {
|
||||
return modifiers |= mod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the given modifier.
|
||||
*/
|
||||
public static int removeModifier(int modifiers, int mod) {
|
||||
return modifiers &= ~mod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given modifier.
|
||||
*/
|
||||
public static int addModifier(int modifiers, int mod, Token token) throws ParseException {
|
||||
if ((modifiers & mod) != 0) {
|
||||
throw new ParseException(token, "Duplicated modifier");
|
||||
}
|
||||
return modifiers |= mod;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 03/11/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
import japa.parser.ast.expr.AnnotationExpr;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class Parameter extends Node {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final boolean isVarArgs;
|
||||
|
||||
private final VariableDeclaratorId id;
|
||||
|
||||
public Parameter(int line, int column, int modifiers, List<AnnotationExpr> annotations, Type type, boolean isVarArgs, VariableDeclaratorId id) {
|
||||
super(line, column);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.type = type;
|
||||
this.isVarArgs = isVarArgs;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isVarArgs() {
|
||||
return isVarArgs;
|
||||
}
|
||||
|
||||
public VariableDeclaratorId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class TypeDeclaration extends BodyDeclaration {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<BodyDeclaration> members;
|
||||
|
||||
public TypeDeclaration(int line, int column, JavadocComment javaDoc, String name, int modifiers, List<BodyDeclaration> members) {
|
||||
super(line, column, javaDoc);
|
||||
this.name = name;
|
||||
this.modifiers = modifiers;
|
||||
this.members = members;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<BodyDeclaration> getMembers() {
|
||||
return members;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class VariableDeclarator extends Node {
|
||||
|
||||
private final VariableDeclaratorId id;
|
||||
|
||||
private final Expression init;
|
||||
|
||||
public VariableDeclarator(int line, int column, VariableDeclaratorId id, Expression init) {
|
||||
super(line, column);
|
||||
this.id = id;
|
||||
this.init = init;
|
||||
}
|
||||
|
||||
public VariableDeclaratorId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Expression getInit() {
|
||||
return init;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.body;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class VariableDeclaratorId extends Node {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final int arrayCount;
|
||||
|
||||
public VariableDeclaratorId(int line, int column, String name, int arrayCount) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.arrayCount = arrayCount;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getArrayCount() {
|
||||
return arrayCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class AnnotationExpr extends Expression {
|
||||
|
||||
public AnnotationExpr(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ArrayAccessExpr extends Expression {
|
||||
|
||||
private final Expression name;
|
||||
|
||||
private final Expression index;
|
||||
|
||||
public ArrayAccessExpr(int line, int column, Expression name, Expression index) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public Expression getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Expression getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ArrayCreationExpr extends Expression {
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
private final int arrayCount;
|
||||
|
||||
private final ArrayInitializerExpr initializer;
|
||||
|
||||
private final List<Expression> dimensions;
|
||||
|
||||
public ArrayCreationExpr(int line, int column, Type type, List<Type> typeArgs, int arrayCount, ArrayInitializerExpr initializer) {
|
||||
super(line, column);
|
||||
this.type = type;
|
||||
this.typeArgs = typeArgs;
|
||||
this.arrayCount = arrayCount;
|
||||
this.initializer = initializer;
|
||||
this.dimensions = null;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
public int getArrayCount() {
|
||||
return arrayCount;
|
||||
}
|
||||
|
||||
public ArrayInitializerExpr getInitializer() {
|
||||
return initializer;
|
||||
}
|
||||
|
||||
public List<Expression> getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public ArrayCreationExpr(int line, int column, Type type, List<Type> typeArgs, List<Expression> dimensions, int arrayCount) {
|
||||
super(line, column);
|
||||
this.type = type;
|
||||
this.typeArgs = typeArgs;
|
||||
this.arrayCount = arrayCount;
|
||||
this.dimensions = dimensions;
|
||||
this.initializer = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ArrayInitializerExpr extends Expression {
|
||||
|
||||
private final List<Expression> values;
|
||||
|
||||
public ArrayInitializerExpr(int line, int column, List<Expression> values) {
|
||||
super(line, column);
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public List<Expression> getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class AssignExpr extends Expression {
|
||||
|
||||
public static enum Operator {
|
||||
assign, // =
|
||||
plus, // +=
|
||||
minus, // -=
|
||||
star, // *=
|
||||
slash, // /=
|
||||
and, // &=
|
||||
or, // |=
|
||||
xor, // ^=
|
||||
rem, // %=
|
||||
lShift, // <<=
|
||||
rSignedShift, // >>=
|
||||
rUnsignedShift, // >>>=
|
||||
}
|
||||
|
||||
private final Expression target;
|
||||
|
||||
private final Expression value;
|
||||
|
||||
private final Operator op;
|
||||
|
||||
public AssignExpr(int line, int column, Expression target, Expression value, Operator op) {
|
||||
super(line, column);
|
||||
this.target = target;
|
||||
this.value = value;
|
||||
this.op = op;
|
||||
}
|
||||
|
||||
public Expression getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public Expression getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Operator getOperator() {
|
||||
return op;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class BinaryExpr extends Expression {
|
||||
|
||||
public static enum Operator {
|
||||
or, // ||
|
||||
and, // &&
|
||||
binOr, // |
|
||||
binAnd, // &
|
||||
xor, // ^
|
||||
equals, // ==
|
||||
notEquals, // !=
|
||||
less, // <
|
||||
greater, // >
|
||||
lessEquals, // <=
|
||||
greaterEquals, // >=
|
||||
lShift, // <<
|
||||
rSignedShift, // >>
|
||||
rUnsignedShift, // >>>
|
||||
plus, // +
|
||||
minus, // -
|
||||
times, // *
|
||||
divide, // /
|
||||
remainder, // %
|
||||
}
|
||||
|
||||
private final Expression left;
|
||||
|
||||
private final Expression right;
|
||||
|
||||
private final Operator op;
|
||||
|
||||
public BinaryExpr(int line, int column, Expression left, Expression right, Operator op) {
|
||||
super(line, column);
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
this.op = op;
|
||||
}
|
||||
|
||||
public Expression getLeft() {
|
||||
return left;
|
||||
}
|
||||
|
||||
public Expression getRight() {
|
||||
return right;
|
||||
}
|
||||
|
||||
public Operator getOperator() {
|
||||
return op;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class BooleanLiteralExpr extends LiteralExpr {
|
||||
|
||||
private final Boolean value;
|
||||
|
||||
public BooleanLiteralExpr(int line, int column, Boolean value) {
|
||||
super(line, column);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Boolean getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class CastExpr extends Expression {
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
public CastExpr(int line, int column, Type type, Expression expr) {
|
||||
super(line, column);
|
||||
this.type = type;
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class CharLiteralExpr extends StringLiteralExpr {
|
||||
|
||||
public CharLiteralExpr(int line, int column, String value) {
|
||||
super(line, column, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ClassExpr extends Expression {
|
||||
|
||||
private final Type type;
|
||||
|
||||
public ClassExpr(int line, int column, Type type) {
|
||||
super(line, column);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ConditionalExpr extends Expression {
|
||||
|
||||
private final Expression condition;
|
||||
|
||||
private final Expression thenExpr;
|
||||
|
||||
private final Expression elseExpr;
|
||||
|
||||
public ConditionalExpr(int line, int column, Expression condition, Expression thenExpr, Expression elseExpr) {
|
||||
super(line, column);
|
||||
this.condition = condition;
|
||||
this.thenExpr = thenExpr;
|
||||
this.elseExpr = elseExpr;
|
||||
}
|
||||
|
||||
public Expression getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Expression getThenExpr() {
|
||||
return thenExpr;
|
||||
}
|
||||
|
||||
public Expression getElseExpr() {
|
||||
return elseExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class DoubleLiteralExpr extends StringLiteralExpr {
|
||||
|
||||
public DoubleLiteralExpr(int line, int column, String value) {
|
||||
super(line, column, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EnclosedExpr extends Expression {
|
||||
|
||||
private final Expression inner;
|
||||
|
||||
public EnclosedExpr(int line, int column, Expression inner) {
|
||||
super(line, column);
|
||||
this.inner = inner;
|
||||
}
|
||||
|
||||
public Expression getInner() {
|
||||
return inner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 10/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class Expression extends Node {
|
||||
|
||||
public Expression(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class FieldAccessExpr extends Expression {
|
||||
|
||||
private final Expression scope;
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
private final String field;
|
||||
|
||||
public FieldAccessExpr(int line, int column, Expression scope, List<Type> typeArgs, String field) {
|
||||
super(line, column);
|
||||
this.scope = scope;
|
||||
this.typeArgs = typeArgs;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public Expression getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class InstanceOfExpr extends Expression {
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
private final Type type;
|
||||
|
||||
public InstanceOfExpr(int line, int column, Expression expr, Type type) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class IntegerLiteralExpr extends StringLiteralExpr {
|
||||
|
||||
public IntegerLiteralExpr(int line, int column, String value) {
|
||||
super(line, column, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
public final boolean isMinValue() {
|
||||
return value != null && //
|
||||
value.length() == 10 && //
|
||||
value.equals("2147483648");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 09/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr {
|
||||
|
||||
public IntegerLiteralMinValueExpr(int line, int column) {
|
||||
super(line, column, "-2147483648");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class LiteralExpr extends Expression {
|
||||
|
||||
public LiteralExpr(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class LongLiteralExpr extends StringLiteralExpr {
|
||||
|
||||
public LongLiteralExpr(int line, int column, String value) {
|
||||
super(line, column, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
public final boolean isMinValue() {
|
||||
return value != null && //
|
||||
value.length() == 20 && //
|
||||
value.startsWith("9223372036854775808") && //
|
||||
(value.charAt(19) == 'L' || value.charAt(19) == 'l');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 09/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class LongLiteralMinValueExpr extends LongLiteralExpr {
|
||||
|
||||
public LongLiteralMinValueExpr(int line, int column) {
|
||||
super(line, column, "-9223372036854775808L");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class MarkerAnnotationExpr extends AnnotationExpr {
|
||||
|
||||
private final NameExpr name;
|
||||
|
||||
public MarkerAnnotationExpr(int line, int column, NameExpr name) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public NameExpr getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class MemberValuePair extends Node {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final Expression value;
|
||||
|
||||
public MemberValuePair(int line, int column, String name, Expression value) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Expression getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class MethodCallExpr extends Expression {
|
||||
|
||||
private final Expression scope;
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<Expression> args;
|
||||
|
||||
public MethodCallExpr(int line, int column, Expression scope, List<Type> typeArgs, String name, List<Expression> args) {
|
||||
super(line, column);
|
||||
this.scope = scope;
|
||||
this.typeArgs = typeArgs;
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
public Expression getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Expression> getArgs() {
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class NameExpr extends Expression {
|
||||
|
||||
private final String name;
|
||||
|
||||
public NameExpr(int line, int column, String name) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class NormalAnnotationExpr extends AnnotationExpr {
|
||||
|
||||
private final NameExpr name;
|
||||
|
||||
private final List<MemberValuePair> pairs;
|
||||
|
||||
public NormalAnnotationExpr(int line, int column, NameExpr name, List<MemberValuePair> pairs) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.pairs = pairs;
|
||||
}
|
||||
|
||||
public NameExpr getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<MemberValuePair> getPairs() {
|
||||
return pairs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class NullLiteralExpr extends LiteralExpr {
|
||||
|
||||
public NullLiteralExpr(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.body.BodyDeclaration;
|
||||
import japa.parser.ast.type.ClassOrInterfaceType;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ObjectCreationExpr extends Expression {
|
||||
|
||||
private final Expression scope;
|
||||
|
||||
private final ClassOrInterfaceType type;
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
private final List<Expression> args;
|
||||
|
||||
private final List<BodyDeclaration> anonymousClassBody;
|
||||
|
||||
public ObjectCreationExpr(int line, int column, Expression scope, ClassOrInterfaceType type, List<Type> typeArgs, List<Expression> args, List<BodyDeclaration> anonymousBody) {
|
||||
super(line, column);
|
||||
this.scope = scope;
|
||||
this.type = type;
|
||||
this.typeArgs = typeArgs;
|
||||
this.args = args;
|
||||
this.anonymousClassBody = anonymousBody;
|
||||
}
|
||||
|
||||
public Expression getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public ClassOrInterfaceType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
public List<Expression> getArgs() {
|
||||
return args;
|
||||
}
|
||||
|
||||
public List<BodyDeclaration> getAnonymousClassBody() {
|
||||
return anonymousClassBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class QualifiedNameExpr extends NameExpr {
|
||||
|
||||
private final NameExpr qualifier;
|
||||
|
||||
public QualifiedNameExpr(int line, int column, NameExpr scope, String name) {
|
||||
super(line, column, name);
|
||||
this.qualifier = scope;
|
||||
}
|
||||
|
||||
public NameExpr getQualifier() {
|
||||
return qualifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 21/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SingleMemberAnnotationExpr extends AnnotationExpr {
|
||||
|
||||
private final NameExpr name;
|
||||
|
||||
private final Expression memberValue;
|
||||
|
||||
public SingleMemberAnnotationExpr(int line, int column, NameExpr name, Expression memberValue) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
this.memberValue = memberValue;
|
||||
}
|
||||
|
||||
public NameExpr getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Expression getMemberValue() {
|
||||
return memberValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 02/03/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public class StringLiteralExpr extends LiteralExpr {
|
||||
|
||||
protected final String value;
|
||||
|
||||
public StringLiteralExpr(int line, int column, String value) {
|
||||
super(line, column);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 20/01/2007
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SuperExpr extends Expression {
|
||||
|
||||
private final Expression classExpr;
|
||||
|
||||
public SuperExpr(int line, int column, Expression classExpr) {
|
||||
super(line, column);
|
||||
this.classExpr = classExpr;
|
||||
}
|
||||
|
||||
public Expression getClassExpr() {
|
||||
return classExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SuperMemberAccessExpr extends Expression {
|
||||
|
||||
private final String name;
|
||||
|
||||
public SuperMemberAccessExpr(int line, int column, String name) {
|
||||
super(line, column);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ThisExpr extends Expression {
|
||||
|
||||
private final Expression classExpr;
|
||||
|
||||
public ThisExpr(int line, int column, Expression classExpr) {
|
||||
super(line, column);
|
||||
this.classExpr = classExpr;
|
||||
}
|
||||
|
||||
public Expression getClassExpr() {
|
||||
return classExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class UnaryExpr extends Expression {
|
||||
|
||||
public static enum Operator {
|
||||
positive, // +
|
||||
negative, // -
|
||||
preIncrement, // ++
|
||||
preDecrement, // --
|
||||
not, // !
|
||||
inverse, // ~
|
||||
posIncrement, // ++
|
||||
posDecrement, // --
|
||||
}
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
private final Operator op;
|
||||
|
||||
public UnaryExpr(int line, int column, Expression expr, Operator op) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
this.op = op;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
public Operator getOperator() {
|
||||
return op;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 03/11/2006
|
||||
*/
|
||||
package japa.parser.ast.expr;
|
||||
|
||||
import japa.parser.ast.body.VariableDeclarator;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class VariableDeclarationExpr extends Expression {
|
||||
|
||||
private final int modifiers;
|
||||
|
||||
private final List<AnnotationExpr> annotations;
|
||||
|
||||
private final Type type;
|
||||
|
||||
private final List<VariableDeclarator> vars;
|
||||
|
||||
public VariableDeclarationExpr(int line, int column, int modifiers, List<AnnotationExpr> annotations, Type type, List<VariableDeclarator> vars) {
|
||||
super(line, column);
|
||||
this.modifiers = modifiers;
|
||||
this.annotations = annotations;
|
||||
this.type = type;
|
||||
this.vars = vars;
|
||||
}
|
||||
|
||||
public int getModifiers() {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
public List<AnnotationExpr> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<VariableDeclarator> getVars() {
|
||||
return vars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class AssertStmt extends Statement {
|
||||
|
||||
private final Expression check;
|
||||
|
||||
private final Expression msg;
|
||||
|
||||
public AssertStmt(int line, int column, Expression check, Expression msg) {
|
||||
super(line, column);
|
||||
this.check = check;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Expression getCheck() {
|
||||
return check;
|
||||
}
|
||||
|
||||
public Expression getMessage() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class BlockStmt extends Statement {
|
||||
|
||||
private final List<Statement> stmts;
|
||||
|
||||
public BlockStmt(int beginLine, int beginColumn, int endLine, int endColumn, List<Statement> stmts) {
|
||||
super(beginLine, beginColumn, endLine, endColumn);
|
||||
this.stmts = stmts;
|
||||
}
|
||||
|
||||
public List<Statement> getStmts() {
|
||||
return stmts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class BreakStmt extends Statement {
|
||||
|
||||
private final String id;
|
||||
|
||||
public BreakStmt(int line, int column, String id) {
|
||||
super(line, column);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 18/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
import japa.parser.ast.body.Parameter;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class CatchClause extends Node {
|
||||
|
||||
private final Parameter except;
|
||||
|
||||
private final BlockStmt catchBlock;
|
||||
|
||||
public CatchClause(int line, int column, Parameter except, BlockStmt catchBlock) {
|
||||
super(line, column);
|
||||
this.except = except;
|
||||
this.catchBlock = catchBlock;
|
||||
}
|
||||
|
||||
public Parameter getExcept() {
|
||||
return except;
|
||||
}
|
||||
|
||||
public BlockStmt getCatchBlock() {
|
||||
return catchBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ContinueStmt extends Statement {
|
||||
|
||||
private final String id;
|
||||
|
||||
public ContinueStmt(int line, int column, String id) {
|
||||
super(line, column);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class DoStmt extends Statement {
|
||||
|
||||
private final Statement body;
|
||||
|
||||
private final Expression condition;
|
||||
|
||||
public DoStmt(int line, int column, Statement body, Expression condition) {
|
||||
super(line, column);
|
||||
this.body = body;
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public Statement getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public Expression getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class EmptyStmt extends Statement {
|
||||
|
||||
public EmptyStmt(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 03/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.type.Type;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ExplicitConstructorInvocationStmt extends Statement {
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
private final boolean isThis;
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
private final List<Expression> args;
|
||||
|
||||
public ExplicitConstructorInvocationStmt(int line, int column, List<Type> typeArgs, boolean isThis, Expression expr, List<Expression> args) {
|
||||
super(line, column);
|
||||
this.typeArgs = typeArgs;
|
||||
this.isThis = isThis;
|
||||
this.expr = expr;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
public boolean isThis() {
|
||||
return isThis;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
public List<Expression> getArgs() {
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ExpressionStmt extends Statement {
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
public ExpressionStmt(int line, int column, Expression expr) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ForStmt extends Statement {
|
||||
|
||||
private final List<Expression> init;
|
||||
|
||||
private final Expression compare;
|
||||
|
||||
private final List<Expression> update;
|
||||
|
||||
private final Statement body;
|
||||
|
||||
public ForStmt(int line, int column, List<Expression> init, Expression compare, List<Expression> update, Statement body) {
|
||||
super(line, column);
|
||||
this.compare = compare;
|
||||
this.init = init;
|
||||
this.update = update;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public List<Expression> getInit() {
|
||||
return init;
|
||||
}
|
||||
|
||||
public Expression getCompare() {
|
||||
return compare;
|
||||
}
|
||||
|
||||
public List<Expression> getUpdate() {
|
||||
return update;
|
||||
}
|
||||
|
||||
public Statement getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.expr.VariableDeclarationExpr;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ForeachStmt extends Statement {
|
||||
|
||||
private final VariableDeclarationExpr var;
|
||||
|
||||
private final Expression iterable;
|
||||
|
||||
private final Statement body;
|
||||
|
||||
public ForeachStmt(int line, int column, VariableDeclarationExpr var, Expression iterable, Statement body) {
|
||||
super(line, column);
|
||||
this.var = var;
|
||||
this.iterable = iterable;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public VariableDeclarationExpr getVariable() {
|
||||
return var;
|
||||
}
|
||||
|
||||
public Expression getIterable() {
|
||||
return iterable;
|
||||
}
|
||||
|
||||
public Statement getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class IfStmt extends Statement {
|
||||
|
||||
private final Expression condition;
|
||||
|
||||
private final Statement thenStmt;
|
||||
|
||||
private final Statement elseStmt;
|
||||
|
||||
public IfStmt(int line, int column, Expression condition, Statement thenStmt, Statement elseStmt) {
|
||||
super(line, column);
|
||||
this.condition = condition;
|
||||
this.thenStmt = thenStmt;
|
||||
this.elseStmt = elseStmt;
|
||||
}
|
||||
|
||||
public Expression getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Statement getThenStmt() {
|
||||
return thenStmt;
|
||||
}
|
||||
|
||||
public Statement getElseStmt() {
|
||||
return elseStmt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class LabeledStmt extends Statement {
|
||||
|
||||
private final String label;
|
||||
|
||||
private final Statement stmt;
|
||||
|
||||
public LabeledStmt(int line, int column, String label, Statement stmt) {
|
||||
super(line, column);
|
||||
this.label = label;
|
||||
this.stmt = stmt;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public Statement getStmt() {
|
||||
return stmt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ReturnStmt extends Statement {
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
public ReturnStmt(int line, int column, Expression expr) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 03/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.Node;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public abstract class Statement extends Node {
|
||||
|
||||
public Statement(int beginLine, int beginColumn, int endLine, int endColumn) {
|
||||
super(beginLine, beginColumn, endLine, endColumn);
|
||||
}
|
||||
|
||||
public Statement(int line, int column) {
|
||||
super(line, column);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SwitchEntryStmt extends Statement {
|
||||
|
||||
private final Expression label;
|
||||
|
||||
private final List<Statement> stmts;
|
||||
|
||||
public SwitchEntryStmt(int line, int column, Expression label, List<Statement> stmts) {
|
||||
super(line, column);
|
||||
this.label = label;
|
||||
this.stmts = stmts;
|
||||
}
|
||||
|
||||
public Expression getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public List<Statement> getStmts() {
|
||||
return stmts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SwitchStmt extends Statement {
|
||||
|
||||
private final Expression selector;
|
||||
|
||||
private final List<SwitchEntryStmt> entries;
|
||||
|
||||
public SwitchStmt(int line, int column, Expression selector, List<SwitchEntryStmt> entries) {
|
||||
super(line, column);
|
||||
this.selector = selector;
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
public Expression getSelector() {
|
||||
return selector;
|
||||
}
|
||||
|
||||
public List<SwitchEntryStmt> getEntries() {
|
||||
return entries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 18/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class SynchronizedStmt extends Statement {
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
private final BlockStmt block;
|
||||
|
||||
public SynchronizedStmt(int line, int column, Expression expr, BlockStmt block) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
public BlockStmt getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 18/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ThrowStmt extends Statement {
|
||||
|
||||
private final Expression expr;
|
||||
|
||||
public ThrowStmt(int line, int column, Expression expr) {
|
||||
super(line, column);
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Expression getExpr() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 18/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class TryStmt extends Statement {
|
||||
|
||||
private final BlockStmt tryBlock;
|
||||
|
||||
private final List<CatchClause> catchs;
|
||||
|
||||
private final BlockStmt finallyBlock;
|
||||
|
||||
public TryStmt(int line, int column, BlockStmt tryBlock, List<CatchClause> catchs, BlockStmt finallyBlock) {
|
||||
super(line, column);
|
||||
this.tryBlock = tryBlock;
|
||||
this.catchs = catchs;
|
||||
this.finallyBlock = finallyBlock;
|
||||
}
|
||||
|
||||
public BlockStmt getTryBlock() {
|
||||
return tryBlock;
|
||||
}
|
||||
|
||||
public List<CatchClause> getCatchs() {
|
||||
return catchs;
|
||||
}
|
||||
|
||||
public BlockStmt getFinallyBlock() {
|
||||
return finallyBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 04/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.body.TypeDeclaration;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class TypeDeclarationStmt extends Statement {
|
||||
|
||||
private final TypeDeclaration typeDecl;
|
||||
|
||||
public TypeDeclarationStmt(int line, int column, TypeDeclaration typeDecl) {
|
||||
super(line, column);
|
||||
this.typeDecl = typeDecl;
|
||||
}
|
||||
|
||||
public TypeDeclaration getTypeDeclaration() {
|
||||
return typeDecl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 07/11/2006
|
||||
*/
|
||||
package japa.parser.ast.stmt;
|
||||
|
||||
import japa.parser.ast.expr.Expression;
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class WhileStmt extends Statement {
|
||||
|
||||
private final Expression condition;
|
||||
|
||||
private final Statement body;
|
||||
|
||||
public WhileStmt(int line, int column, Expression condition, Statement body) {
|
||||
super(line, column);
|
||||
this.condition = condition;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public Expression getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Statement getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Júlio Vilmar Gesser.
|
||||
*
|
||||
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Created on 05/10/2006
|
||||
*/
|
||||
package japa.parser.ast.type;
|
||||
|
||||
import japa.parser.ast.visitor.GenericVisitor;
|
||||
import japa.parser.ast.visitor.VoidVisitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Julio Vilmar Gesser
|
||||
*/
|
||||
public final class ClassOrInterfaceType extends Type {
|
||||
|
||||
private final ClassOrInterfaceType scope;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final List<Type> typeArgs;
|
||||
|
||||
public ClassOrInterfaceType(int line, int column, ClassOrInterfaceType scope, String name, List<Type> typeArgs) {
|
||||
super(line, column);
|
||||
this.scope = scope;
|
||||
this.name = name;
|
||||
this.typeArgs = typeArgs;
|
||||
}
|
||||
|
||||
public ClassOrInterfaceType getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Type> getTypeArgs() {
|
||||
return typeArgs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <A> void accept(VoidVisitor<A> v, A arg) {
|
||||
v.visit(this, arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
|
||||
return v.visit(this, arg);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user