Package jflex
Class CountEmitter
java.lang.Object
jflex.PackEmitter
jflex.CountEmitter
An emitter for an array encoded as count/value pairs in a string.
- Version:
- JFlex 1.7.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intnumber of entries in expanded arrayprivate inttranslate all values by this amountFields inherited from class jflex.PackEmitter
chunks, name, out -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCountEmitter(String name) Create a count/value emitter for a specific field. -
Method Summary
Modifier and TypeMethodDescriptionvoidemit(int count, int value) Emit one count/value pair.voidEmits count/value unpacking code for the generated array.voidsetValTranslation(int i) Translate all values by given amount.
-
Field Details
-
numEntries
private int numEntriesnumber of entries in expanded array -
translate
private int translatetranslate all values by this amount
-
-
Constructor Details
-
CountEmitter
Create a count/value emitter for a specific field.- Parameters:
name- name of the generated array
-
-
Method Details
-
emitUnpack
public void emitUnpack()Emits count/value unpacking code for the generated array.- Specified by:
emitUnpackin classPackEmitter- See Also:
-
setValTranslation
public void setValTranslation(int i) Translate all values by given amount.Use to move value interval from [0, 0xFFFF] to something different.
- Parameters:
i- amount the value will be translated by. Example:i = 1allows values in [-1, 0xFFFE].
-
emit
public void emit(int count, int value) Emit one count/value pair.Automatically translates value by the
translatevalue.- Parameters:
count- a int.value- a int.- See Also:
-