====== Tiny v2 ======
Tiny v2 consists of a list of hierarchical sections. Every line starts a new section, whether it continues an existing section is determined by the indentation level. A section's parent is always the closest preceding section indented once less than itself. Accordingly, a section ends just before the next line with the same or a lesser indentation level.
The child-to-parent relationships form the paths to uniquely identify any element globally. For example, all field and method sections that are children of a class section represent members of the represented class.
Sections need to be unique within their level. For example a specific class may only be recorded once, a comment can't be redefined or the same parameter listed twice.
**Example:**
tiny 2 0 official intermediary named
someProperty someValue
anotherProperty
c a class_123 pkg/SomeClass
f [I a field_789 someField
m (III)V a method_456 someMethod
p 1 param_0 x
p 2 param_1 y
p 3 param_2 z
c Just a method for demonstrating the format.
c b class_234 pkg/xy/AnotherClass
m (Ljava/lang/String;)I a method_567 anotherMethod
===== Grammar =====
::= |
::= 'tiny'
::=
::=
::=
::=
::= '' |
::=
::= '' |
::= |
::=
::=
::= '' |
::= 'c'
::=
::=
::= '' |
::= '' |
::=
::= '' | | |
::= 'f'
::=
::=
::= '' |
::= '' |
::=
::=
::=
::= '' |
::= 'm'
::=
::=
::= '' |
::= '' |
::=
::=
::=
::= '' | | |
::= 'p'
::=
::=
::= '' |
::= '' |
::=
::=
::= '' |
::= 'v'
::=
::= '-1' |
::=
::= '' |
::=
::= 'c'
::= 'c'
::= 'c'
==== Notes ====
* ''%%%%'' is ''\t''.
* ''%%%%'' is ''\n'' or ''\r\n''.
* ''%%%%'' is a non-empty string that must not contain:
* ''\'',
* ''\n'',
* ''\r'',
* ''\t'' or
* ''\0''.
* ''%%%%'' is the same as ''%%%%'' if ''%%%%'' doesn't contain a ''%%%%'' ''escaped-names'', otherwise it's a non-empty string further described by ''%%%%''.
* ''%%%%'' is a string that must not contain an ''%%%%'', escapes ''\'' to ''\\'' and the other forbidden values to their string literal equivalents, as seen in the list above.
* ''%%%%'' is any integer from 0 to 2147483647 (2^31-1) inclusive, represented as per ''java.lang.Integer.toString()''.
* ''%%%%'', once optionally unescaped, is the binary name of a class as specified in JVMS SE 8 §4.2.1. Nested class identifiers are typically separated with ''$'' (e.g. ''some/package/class$nested$subnested''). Outer names must not be omitted for any namespace.
* ''%%%%''/''%%%%''/''%%%%'', once optionally unescaped, is the unqualified name of a field/method/variable as specified in JVMS SE 8 §4.2.2.
* ''%%%%'', once optionally unescaped, is a field descriptor as specified in JVMS SE 8 §4.3.2.
* ''%%%%'', once optionally unescaped, is a method descriptor as specified in JVMS SE 8 §4.3.3.
* ''%%%%'' refers to the local variable array index of the frames having the variable, see "index" in JVMS SE 8 §4.7.13.
* ''%%%%'' is at most the start of the range in which the variable has a value, but doesn't overlap with another variable with the same ''%%%%'', see "start_pc" in JVMS SE 8 §4.7.13. The start offset/range for Tiny v2 is measured in instructions with a valid opcode, not bytes.
* ''%%%%'' is the index into the LocalVariableTable attribute's ''local_variable_table array'', see "local_variable_table" in JVMS SE 8 §4.7.13, not to be confused with "index" referred by ''%%%%''.
===== Miscellaneous Notes =====
* The encoding for the entire file is UTF-8. Escape sequences are limited to the types, locations and conditions mentioned above.
* Indenting uses tab characters exclusively, one tab character equals one level. The amount of leading tab characters is at most 1 more than in the preceding line.
* Sections or properties with unknown types/keys should be skipped without generating an error.
* The amount of extra namespaces defined in the header and the amount of names in every ''%%extra-ns-*-names%%'' definition have to match. They are associated by their relative position, like the mandatory name spaces ''a'' and ''b'' that are associated by the suffix, e.g. ''%%namespace-a%%'' covers ''%%class-name-a%%'', ''%%field-name-a%%'', ''%%field-desc-a%%'', ''%%method-name-a%%'', ''%%method-desc-a%%'' and ''%%var-desc-a%%'',.
* Sections representing the same element must not be repeated, e.g. there can be only one top-level section for a specific class or one class-level section for a specific member.
* If any variable mapping doesn't specify a LVT index, e.g. due to a missing ''LocalVariableTable'' attribute in one of the methods, the property ''missing-lvt-indices'' has to be added to.
* Mappings without any (useful) names should be omitted.
* Sections without any (useful) mappings or sub-sections should be omitted.
* Comments should be without their enclosing syntax elements, indentation or decoration. For example, the comment
/**
* A comment
* on two lines.
*/
(note the indentation) should be recorded as A commenton two lines.
===== Standard Properties =====
* ''escaped-names'': deserialize values with unescaping
* ''missing-lvt-indices'': expect local variable mappings without a lvt-index value