commit a34ee7364cbf394a3634a2392ed53eee314b74b1 Author: Jindra Petřík Date: Sat Sep 4 13:57:22 2010 +0200 Initial version based on previous work. (Version alpha 7) diff --git a/trunk/.idea/compiler.xml b/trunk/.idea/compiler.xml new file mode 100644 index 000000000..b9a1798ac --- /dev/null +++ b/trunk/.idea/compiler.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/trunk/.idea/copyright/profiles_settings.xml b/trunk/.idea/copyright/profiles_settings.xml new file mode 100644 index 000000000..b385f01fd --- /dev/null +++ b/trunk/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/trunk/.idea/encodings.xml b/trunk/.idea/encodings.xml new file mode 100644 index 000000000..7c62b52a1 --- /dev/null +++ b/trunk/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/trunk/.idea/libraries/lib1.xml b/trunk/.idea/libraries/lib1.xml new file mode 100644 index 000000000..ddc47d775 --- /dev/null +++ b/trunk/.idea/libraries/lib1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/.idea/libraries/testlib.xml b/trunk/.idea/libraries/testlib.xml new file mode 100644 index 000000000..24bd8f60a --- /dev/null +++ b/trunk/.idea/libraries/testlib.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/.idea/misc.xml b/trunk/.idea/misc.xml new file mode 100644 index 000000000..818557159 --- /dev/null +++ b/trunk/.idea/misc.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/trunk/.idea/modules.xml b/trunk/.idea/modules.xml new file mode 100644 index 000000000..21d9dc45e --- /dev/null +++ b/trunk/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/trunk/.idea/uiDesigner.xml b/trunk/.idea/uiDesigner.xml new file mode 100644 index 000000000..1e7cce4b8 --- /dev/null +++ b/trunk/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/.idea/vcs.xml b/trunk/.idea/vcs.xml new file mode 100644 index 000000000..6d89e2bf8 --- /dev/null +++ b/trunk/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/trunk/.idea/workspace.xml b/trunk/.idea/workspace.xml new file mode 100644 index 000000000..309f098c2 --- /dev/null +++ b/trunk/.idea/workspace.xml @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.6 + + + + + + + + + + + + + + diff --git a/trunk/Trunk.iml b/trunk/Trunk.iml new file mode 100644 index 000000000..30070a743 --- /dev/null +++ b/trunk/Trunk.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/trunk/build.xml b/trunk/build.xml new file mode 100644 index 000000000..041906cf6 --- /dev/null +++ b/trunk/build.xml @@ -0,0 +1,158 @@ + + + + Builds project ASDec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/buildconfig.xml b/trunk/buildconfig.xml new file mode 100644 index 000000000..58ce613c6 --- /dev/null +++ b/trunk/buildconfig.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/doc/avm2overview.pdf b/trunk/doc/avm2overview.pdf new file mode 100644 index 000000000..e9bf9578a Binary files /dev/null and b/trunk/doc/avm2overview.pdf differ diff --git a/trunk/doc/swf_file_format_spec_v10.pdf b/trunk/doc/swf_file_format_spec_v10.pdf new file mode 100644 index 000000000..9baa5194c Binary files /dev/null and b/trunk/doc/swf_file_format_spec_v10.pdf differ diff --git a/trunk/graphics/exit.svg b/trunk/graphics/exit.svg new file mode 100644 index 000000000..05d79686a --- /dev/null +++ b/trunk/graphics/exit.svg @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/trunk/graphics/loading.svg b/trunk/graphics/loading.svg new file mode 100644 index 000000000..f45675391 --- /dev/null +++ b/trunk/graphics/loading.svg @@ -0,0 +1,1591 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/graphics/logo.svg b/trunk/graphics/logo.svg new file mode 100644 index 000000000..cc6be32cb --- /dev/null +++ b/trunk/graphics/logo.svg @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + JP + ActionScript + ActionScript + + decompiler + decompiler + + JP + + diff --git a/trunk/graphics/open.svg b/trunk/graphics/open.svg new file mode 100644 index 000000000..b8a59928c --- /dev/null +++ b/trunk/graphics/open.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/trunk/graphics/proxy.svg b/trunk/graphics/proxy.svg new file mode 100644 index 000000000..64e631791 --- /dev/null +++ b/trunk/graphics/proxy.svg @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + P + + + + + + + + + + + + diff --git a/trunk/lib/commons-codec-1.3.jar b/trunk/lib/commons-codec-1.3.jar new file mode 100644 index 000000000..957b6752a Binary files /dev/null and b/trunk/lib/commons-codec-1.3.jar differ diff --git a/trunk/lib/jpproxy.jar b/trunk/lib/jpproxy.jar new file mode 100644 index 000000000..5324087e9 Binary files /dev/null and b/trunk/lib/jpproxy.jar differ diff --git a/trunk/lib/jsyntaxpane-0.9.5.jar b/trunk/lib/jsyntaxpane-0.9.5.jar new file mode 100644 index 000000000..e20d1fafe Binary files /dev/null and b/trunk/lib/jsyntaxpane-0.9.5.jar differ diff --git a/trunk/libsrc/jpproxy/build.xml b/trunk/libsrc/jpproxy/build.xml new file mode 100644 index 000000000..5f5b4b941 --- /dev/null +++ b/trunk/libsrc/jpproxy/build.xml @@ -0,0 +1,158 @@ + + + + Builds project JPProxy. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ByteArray.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ByteArray.class new file mode 100644 index 000000000..5b1735c76 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ByteArray.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/CatchedListener.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/CatchedListener.class new file mode 100644 index 000000000..b046b358d Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/CatchedListener.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Client.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Client.class new file mode 100644 index 000000000..afbbf33f2 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Client.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Connection.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Connection.class new file mode 100644 index 000000000..44beca661 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Connection.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Copy.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Copy.class new file mode 100644 index 000000000..0e6e936d7 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Copy.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Handler.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Handler.class new file mode 100644 index 000000000..02c2ae923 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Handler.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Http.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Http.class new file mode 100644 index 000000000..650f89b66 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Http.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpConnection.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpConnection.class new file mode 100644 index 000000000..c7ed36f92 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpConnection.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpRelay.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpRelay.class new file mode 100644 index 000000000..dd468a914 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/HttpRelay.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Https.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Https.class new file mode 100644 index 000000000..e4386bfd5 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Https.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Key.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Key.class new file mode 100644 index 000000000..266018f29 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Key.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$1.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$1.class new file mode 100644 index 000000000..387df453f Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$1.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$2.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$2.class new file mode 100644 index 000000000..735218e46 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main$2.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main.class new file mode 100644 index 000000000..2ba30123b Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Main.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Message.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Message.class new file mode 100644 index 000000000..61c8a8050 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Message.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ReplacedListener.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ReplacedListener.class new file mode 100644 index 000000000..9968bb94e Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/ReplacedListener.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Replacement.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Replacement.class new file mode 100644 index 000000000..2975a5f5b Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Replacement.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Reply.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Reply.class new file mode 100644 index 000000000..baf80b9cf Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Reply.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Request.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Request.class new file mode 100644 index 000000000..c4a504a38 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Request.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/RetryRequestException.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/RetryRequestException.class new file mode 100644 index 000000000..8256ab0e4 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/RetryRequestException.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Server.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Server.class new file mode 100644 index 000000000..1074da80a Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/Server.class differ diff --git a/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/WorkerThread.class b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/WorkerThread.class new file mode 100644 index 000000000..225ee6f66 Binary files /dev/null and b/trunk/libsrc/jpproxy/build/classes/com/jpexs/proxy/WorkerThread.class differ diff --git a/trunk/libsrc/jpproxy/buildconfig.xml b/trunk/libsrc/jpproxy/buildconfig.xml new file mode 100644 index 000000000..30a889982 --- /dev/null +++ b/trunk/libsrc/jpproxy/buildconfig.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/libsrc/jpproxy/dist/JP_NoAds.zip b/trunk/libsrc/jpproxy/dist/JP_NoAds.zip new file mode 100644 index 000000000..c78006e36 Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/JP_NoAds.zip differ diff --git a/trunk/libsrc/jpproxy/dist/config/replacements.ini b/trunk/libsrc/jpproxy/dist/config/replacements.ini new file mode 100644 index 000000000..f098c712b --- /dev/null +++ b/trunk/libsrc/jpproxy/dist/config/replacements.ini @@ -0,0 +1,12 @@ +http://archiv.nova.cz/static/cz/shared/app/MediaCenter.swf +.\config\saved\asdec_85f11ffb.tmp +http://admin.brightcove.com/viewer/us1.24.00.00/federatedVideo/BrightcovePlayer.swf +.\config\saved\asdec_d5ca3577.tmp +http://archiv.nova.cz/static/cz/shared/app/MediaCenter_Catchup.swf +.\config\saved\asdec_d08cceb2.tmp +http://abc.go.com/vp2/ws/utils/2000/geo/video/geolocation +.\config\saved\asdec_70eaddc7.tmp +http://ll.static.abc.com/m/vp2/prod/flash/VP2.swf?ver=* +.\config\saved\asdec_a3d1aa1c.tmp +http://archiv.nova.cz/static/shared/app/flowplayer/OpenAdStreamer-*.swf +.\config\saved\asdec_65483348.tmp diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_65483348.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_65483348.tmp new file mode 100644 index 000000000..8cecad84a Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/config/saved/asdec_65483348.tmp differ diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_70eaddc7.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_70eaddc7.tmp new file mode 100644 index 000000000..a303f962e --- /dev/null +++ b/trunk/libsrc/jpproxy/dist/config/saved/asdec_70eaddc7.tmp @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_85f11ffb.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_85f11ffb.tmp new file mode 100644 index 000000000..6371c6aed Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/config/saved/asdec_85f11ffb.tmp differ diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_a3d1aa1c.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_a3d1aa1c.tmp new file mode 100644 index 000000000..5dd9c1b90 Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/config/saved/asdec_a3d1aa1c.tmp differ diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_d08cceb2.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_d08cceb2.tmp new file mode 100644 index 000000000..7ff4fb030 Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/config/saved/asdec_d08cceb2.tmp differ diff --git a/trunk/libsrc/jpproxy/dist/config/saved/asdec_d5ca3577.tmp b/trunk/libsrc/jpproxy/dist/config/saved/asdec_d5ca3577.tmp new file mode 100644 index 000000000..d9f98346b Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/config/saved/asdec_d5ca3577.tmp differ diff --git a/trunk/libsrc/jpproxy/dist/jpproxy.jar b/trunk/libsrc/jpproxy/dist/jpproxy.jar new file mode 100644 index 000000000..ab85e8639 Binary files /dev/null and b/trunk/libsrc/jpproxy/dist/jpproxy.jar differ diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ByteArray.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ByteArray.java new file mode 100644 index 000000000..ab1dfff01 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ByteArray.java @@ -0,0 +1,134 @@ +package com.jpexs.proxy; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * Class used to represent an array of bytes as an Object. + * + * @author Mark Boyns + */ +public class ByteArray { + public byte bytes[]; + public int offset = 0; + + /** + * Create a ByteArray with the default size. + */ + public ByteArray() { + this(512); + } + + /** + * Create a ByteArray with a specific default size. + */ + public ByteArray(int size) { + bytes = new byte[size]; + } + + /** + * Create a ByteArray from a String. + */ + public ByteArray(String s) { + this(s.length()); + append(s); + } + + /** + * Create a ByteArray from an array of bytes. + */ + public ByteArray(byte b[]) { + this(b.length); + append(b); + } + + /** + * Append a byte. + */ + public void append(byte ch) { + if (offset == bytes.length) { + byte tmpbytes[] = bytes; + bytes = new byte[tmpbytes.length * 2]; + System.arraycopy(tmpbytes, 0, bytes, 0, offset); + } + bytes[offset++] = ch; + } + + /** + * Append a ByteArray. + */ + public void append(ByteArray b) { + if (bytes.length - offset < b.length()) { + byte tmpbytes[] = bytes; + bytes = new byte[tmpbytes.length + b.length()]; + System.arraycopy(tmpbytes, 0, bytes, 0, offset); + } + System.arraycopy(b.bytes, 0, bytes, offset, b.length()); + offset += b.length(); + } + + /** + * Append an array of bytes. + */ + public void append(byte b[]) { + if (bytes.length - offset < b.length) { + byte tmpbytes[] = bytes; + bytes = new byte[tmpbytes.length + b.length]; + System.arraycopy(tmpbytes, 0, bytes, 0, offset); + } + System.arraycopy(b, 0, bytes, offset, b.length); + offset += b.length; + } + + /** + * Append a String. + */ + public void append(String s) { + append(s.getBytes()); + } + + /** + * Convert to String. + */ + public String toString() { + return new String(bytes, 0, offset); + } + + /** + * Return the bytes. + */ + public byte[] getBytes() { + return bytes; + } + + public void writeTo(OutputStream out) + throws IOException { + out.write(bytes, 0, offset); + } + + public byte get(int i) { + return bytes[i]; + } + + /** + * Return the number of bytes. + */ + public int length() { + return offset; + } + + public void erase() { + offset = 0; + } + + public void chop() { + chop(1); + } + + public void chop(int i) { + offset -= i; + if (offset < 0) { + offset = 0; + } + } +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/CatchedListener.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/CatchedListener.java new file mode 100644 index 000000000..13bf8a074 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/CatchedListener.java @@ -0,0 +1,19 @@ +package com.jpexs.proxy; + +import java.io.InputStream; + +/** + * Interface to catch contentTypes + * + * @author JPEXS + */ +public interface CatchedListener { + /** + * Method called when specified contentType is received + * + * @param contentType Content type + * @param url URL of the method + * @param data Data stream + */ + public void catched(String contentType, String url, InputStream data); +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Client.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Client.java new file mode 100644 index 000000000..de59d30c8 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Client.java @@ -0,0 +1,43 @@ +package com.jpexs.proxy; + + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.net.Socket; + +/** + * Client which reads a Request and writes a Reply. + * + * @author Mark Boyns + */ +public class Client extends Connection { + /** + * Create a Client from a Socket. + */ + Client(Socket s) throws IOException { + super(s); + in = new BufferedInputStream(in); + //out = new DebugOutputStream(new BufferedOutputStream(out)); + out = new BufferedOutputStream(out); + } + + + /** + * Read a Request. + * + * @returns a Request. + */ + Request read() throws IOException { + Request request = new Request(this); + request.read(getInputStream()); + return request; + } + + /** + * Write a Reply + */ + void write(Reply reply) throws IOException { + reply.write(getOutputStream()); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Connection.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Connection.java new file mode 100644 index 000000000..064c21892 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Connection.java @@ -0,0 +1,102 @@ +package com.jpexs.proxy; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketException; + +/** + * Create a TCP connection from a Socket or hostname/port + * with buffered IO. + * + * @author Mark Boyns + * @see java.net.Socket + */ +class Connection { + Socket socket = null; + InputStream in = null; + OutputStream out = null; + + /** + * Create a Connection from a Socket. + * + * @param socket a socket + */ + Connection(Socket socket) throws IOException { + this.socket = socket; + in = socket.getInputStream(); + out = socket.getOutputStream(); + } + + /** + * Create a Connection from a hostname and port. + * + * @param host remote hostname + * @param port remote port + */ + Connection(String host, int port) throws IOException { + this(new Socket(host, port)); + } + + Connection() { + } + + /** + * Return the input stream. + */ + InputStream getInputStream() { + return in; + } + + /** + * Return the output stream. + */ + OutputStream getOutputStream() { + return out; + } + + void setInputStream(InputStream in) { + this.in = in; + } + + void setOutputStream(OutputStream out) { + this.out = out; + } + + /** + * Close the connection. + */ + void close() { + if (socket != null) { + try { + socket.close(); + } + catch (IOException e) { + System.out.println("Connection: " + e); + } + } + } + + public Socket getSocket() { + return socket; + } + + public InetAddress getInetAddress() { + return socket.getInetAddress(); + } + + public int getPort() { + return socket.getPort(); + } + + public String toString() { + return getInetAddress().getHostAddress() + ":" + getPort(); + } + + public void setTimeout(int timeout) + throws SocketException { + socket.setSoTimeout(timeout); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Copy.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Copy.java new file mode 100644 index 000000000..53169577e --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Copy.java @@ -0,0 +1,35 @@ +package com.jpexs.proxy; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +class Copy implements Runnable { + InputStream in = null; + OutputStream out = null; + + Copy(InputStream in, OutputStream out) { + this.in = in; + this.out = out; + } + + public void run() { + int n; + byte buffer[] = new byte[8192]; + + try { + while ((n = in.read(buffer, 0, buffer.length)) > 0) { + out.write(buffer, 0, n); + out.flush(); + } + out.flush(); + } + catch (IOException e) { + String s = e.toString(); + // ignore socket closed exceptions + if (s.toLowerCase().indexOf("socket closed") == -1) { + e.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Handler.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Handler.java new file mode 100644 index 000000000..87ae5e66f --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Handler.java @@ -0,0 +1,575 @@ +package com.jpexs.proxy; + + +import java.io.*; +import java.net.Socket; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; +import java.util.zip.GZIPInputStream; + +/** + * HTTP transaction handler. A handler is created by Server for + * each HTTP transaction. Given a socket, the handler will deal with + * the request, reply, and invoke request, reply, and content filters. + * + * @author Mark Boyns + */ +class Handler implements Runnable { + static final boolean DEBUG = false; + Socket socket = null; + Request request = null; + Reply reply = null; + HttpRelay http = null; + int currentLength = -1; + int contentLength = -1; + long idle = 0; + double bytesPerSecond = 0; + Client client; + + int MAXTIMEOUT = 1000 * 60 * 5; + List replacements; + CatchedListener catchedListener; + List catchedContentTypes; + ReplacedListener replacedListener; + + /** + * Create a Handler. + */ + Handler(Socket socket, List replacements, List catchedContentTypes, CatchedListener catchedListener, ReplacedListener replacedListener) { + this.socket = socket; + this.replacements = replacements; + this.catchedListener = catchedListener; + this.catchedContentTypes = catchedContentTypes; + this.replacedListener = replacedListener; + } + + /** + * Close all connections associated with this handler. + */ + synchronized void close() { + if (client != null) { + client.close(); + client = null; + } + if (http != null) { + http.close(); + http = null; + } + } + + /** + * Flush all data to the client. + */ + void flush() { + if (client != null) { + try { + client.getOutputStream().flush(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + } + + public void run() { + boolean keepAlive = false; + Exception reason = null; + + Thread.currentThread().setName("Handler(" + + socket.getInetAddress().getHostAddress() + + ")"); + + try { + client = new Client(socket); + } catch (IOException e) { + + } + + do { + request = null; + reply = null; + + idle = System.currentTimeMillis(); + + + try { + request = client.read(); + if (Main.DEBUG_MODE) { + System.out.println("REQUEST: " + request.getURL()); + } + } + catch (IOException e) { + e.printStackTrace(); + break; + } + + idle = 0; + + + try { + keepAlive = processRequest(); + } + catch (IOException ioe) { + reason = ioe; + keepAlive = false; + } + + if (request != null && reply != null) { + // XXX insert the number of bytes read into the + // reply content-length for logging. + if (reply != null && currentLength > 0) { + reply.setHeaderField("Content-length", currentLength); + } + } + } + while (keepAlive); + + + if (reason != null && reason.getMessage().indexOf("Broken pipe") == -1) { + } + + close(); + } + + boolean processRequest() throws IOException { + boolean keepAlive = false; + + while (reply == null) { + boolean secure = false; + boolean uncompress = false; + + + if (request.getCommand().equals("CONNECT")) { + secure = true; + } else if (request.getURL().startsWith("https://")) { + System.out.println("Netscape keep-alive bug: " + request.getURL()); + return false; + } else if (!request.getURL().startsWith("http://")) { + System.out.println("Unknown URL: " + request.getURL()); + return false; + } + + keepAlive = (request.containsHeaderField("Proxy-Connection") + && request.getHeaderField("Proxy-Connection").equals("Keep-Alive")); + + + /* First look for any HttpFilters */ + + + /* None found. Use http or https relay. */ + if (secure) { + http = createHttpsRelay(); + } else { + http = createHttpRelay(); + } + + + try { + http.sendRequest(request); + if (http instanceof Http) { + ((Http) http).setTimeout(MAXTIMEOUT); + } + reply = http.recvReply(request); + } + catch (RetryRequestException e) { + http.close(); + http = null; + continue; /* XXX */ + } + + /* Guess content-type if there aren't any headers. + Probably an upgraded HTTP/0.9 reply. */ + if (reply.headerCount() == 0) { + String url = request.getURL(); + if (url.endsWith("/") + || url.endsWith(".html") || url.endsWith(".htm")) { + reply.setHeaderField("Content-type", "text/html"); + } + } + + + String encoding = reply.getHeaderField("Content-Encoding"); + if (encoding != null && encoding.indexOf("gzip") != -1) { + reply.removeHeaderField("Content-Encoding"); + reply.removeHeaderField("Content-length"); + uncompress = true; + } + /* update reply */ + + + reply.removeHeaderField("Proxy-Connection"); + if (keepAlive && reply.containsHeaderField("Content-length")) { + reply.setHeaderField("Proxy-Connection", "Keep-Alive"); + } else { + keepAlive = false; + } + + currentLength = -1; + contentLength = -1; + try { + contentLength = Integer.parseInt(reply.getHeaderField("Content-length")); + } + catch (NumberFormatException e) { + } + + /* update content-length reply */ + + + if (secure) { + Https https = (Https) http; + int timeout = MAXTIMEOUT; + + client.write(reply); + + try { + https.setTimeout(timeout); + + Copy cp = new Copy(client.getInputStream(), https.getOutputStream()); + WorkerThread.assignThread(cp, ""); + flushCopy(https.getInputStream(), client.getOutputStream(), -1, true); + client.close(); + } + catch (InterruptedIOException iioe) { + // ignore socket timeout exceptions + } + } else if (reply.hasContent()) { + try { + processContent(uncompress); + } + catch (IOException e) { + if (http instanceof Http) { + ((Http) http).reallyClose(); + } else { + http.close(); + } + http = null; + client.close(); + client = null; + throw e; + //return false; /* XXX */ + } + + /* Document contains no data. */ + if (contentLength == 0) { + client.close(); + } + } else { + client.write(reply); + } + + http.close(); + } + + return keepAlive; + } + + HttpRelay createHttpsRelay() throws IOException { + HttpRelay http; + + http = new Https(request.getHost(), request.getPort()); + + return http; + } + + HttpRelay createHttpRelay() throws IOException { + HttpRelay http; + + + http = Http.open(request.getHost(), request.getPort()); + + + return http; + } + + + InputStream readChunkedTransfer(InputStream in) throws IOException { + ByteArrayOutputStream chunks = new ByteArrayOutputStream(8192); + int size = 0; + + contentLength = 0; + while ((size = reply.getChunkSize(in)) > 0) { + contentLength += size; + copy(in, chunks, size, true); + reply.readLine(in); + } + reply.getChunkedFooter(in); + + reply.removeHeaderField("Transfer-Encoding"); + reply.setHeaderField("Content-length", contentLength); + + return new ByteArrayInputStream(chunks.toByteArray()); + } + + + private static DateFormat httpDateFormat() { + DateFormat httpDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + httpDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + return httpDateFormat; + } + + void disableReplyCaching() { + reply.removeHeaderField("Cache-Control"); + reply.removeHeaderField("Last-Modified"); + reply.removeHeaderField("Expires"); + reply.removeHeaderField("Date"); + reply.removeHeaderField("ETag"); + reply.removeHeaderField("Pragma"); + + reply.setHeaderField("Pragma", "no-cache"); + reply.setHeaderField("Cache-Control", "no-cache, must-revalidate"); + Calendar now = Calendar.getInstance(); + reply.setHeaderField("Expires", httpDateFormat().format(now.getTime()));//"Sat, 26 Jul 1997 05:00:00 GMT"); + reply.setHeaderField("Last-Modified", "Sat, 26 Jul 1997 05:00:00 GMT"); + } + + + void processContent(boolean uncompress) throws IOException { + InputStream in; + boolean chunked = false; + + if (reply.containsHeaderField("Transfer-Encoding") + && reply.getTransferEncoding().equals("chunked")) { + in = readChunkedTransfer(reply.getContent()); + chunked = true; + } else { + in = reply.getContent(); + } + + if (in == null) { + System.out.println("No inputstream"); + return; + } else if (uncompress) { + in = new GZIPInputStream(in); + } + + String url = request.getURL(); + boolean replaced = false; + for (Replacement r : replacements) { + if (r.matches(url)) { + r.lastAccess = Calendar.getInstance(); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + try { + FileInputStream fis = new FileInputStream(r.targetFile); + byte buf[] = new byte[2048]; + int pos = 0; + while ((pos = fis.read(buf)) > 0) { + buffer.write(buf, 0, pos); + } + fis.close(); + buffer.close(); + } catch (IOException ex) { + if (Main.DEBUG_MODE) { + System.err.println("ERROR:Cannot read file: " + r.targetFile); + } + } + byte bytes[] = buffer.toByteArray(); + contentLength = bytes.length; + reply.setHeaderField("Content-length", contentLength); + disableReplyCaching(); + client.write(reply); + copy(new ByteArrayInputStream(bytes), + client.getOutputStream(), contentLength, false); + replaced = true; + if (replacedListener != null) { + replacedListener.replaced(r, request.getURL(), reply.getContentType()); + } + break; + } + } + + if (!replaced) { + + String contentType = reply.getHeaderField("Content-type"); + if (reply.getStatusCode() == 200) { + if (contentType != null) { + for (String ct : catchedContentTypes) { + String convContentType = contentType; + if (convContentType.contains(";")) + convContentType = convContentType.substring(0, convContentType.indexOf(";")); + + if (ct.toLowerCase().equals(convContentType.toLowerCase())) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + copy(in, baos, contentLength, true); + if (catchedListener != null) { + catchedListener.catched(ct, request.getURL(), new ByteArrayInputStream(baos.toByteArray())); + } + in = new ByteArrayInputStream(baos.toByteArray()); + disableReplyCaching(); + break; + } + } + } + } + client.write(reply); + copy(in, client.getOutputStream(), contentLength, true); + } + } + + + /** + * Return the content length. + */ + int getTotalBytes() { + return contentLength > 0 ? contentLength : 0; + } + + /** + * Return the number of bytes read so far. + */ + int getCurrentBytes() { + return currentLength > 0 ? currentLength : 0; + } + + + /** + * Copy in to out. + * + * @param in InputStream + * @param out OutputStream + * @param monitored Update the Monitor + */ + void copy(InputStream in, OutputStream out, int length, boolean monitored) + throws IOException { + if (length == 0) { + return; + } + + int n; + byte buffer[] = new byte[8192]; + long start = System.currentTimeMillis(); + long now = 0, then = start; + + bytesPerSecond = 0; + + if (monitored) { + currentLength = 0; + } + + for (; ;) { + n = (length > 0) ? Math.min(length, buffer.length) : buffer.length; + n = in.read(buffer, 0, n); + if (n < 0) { + break; + } + + out.write(buffer, 0, n); + + if (monitored) { + currentLength += n; + + } + + now = System.currentTimeMillis(); + bytesPerSecond = currentLength / ((now - start) / 1000.0); + + // flush after 1 second + if (now - then > 1000) { + out.flush(); + } + + if (length != -1) { + length -= n; + if (length == 0) { + break; + } + } + + then = now; + } + + out.flush(); + + if (DEBUG) { + System.out.println(currentLength + " bytes processed in " + + ((System.currentTimeMillis() - start) + / 1000.0) + " seconds " + + ((int) bytesPerSecond / 1024) + " kB/s"); + } + } + + /** + * Copy in to out. + * + * @param in InputStream + * @param out OutputStream + * @param monitored Update the Monitor + */ + void flushCopy(InputStream in, OutputStream out, int length, boolean monitored) + throws IOException { + if (length == 0) { + return; + } + + int n; + byte buffer[] = new byte[8192]; + long start = System.currentTimeMillis(); + bytesPerSecond = 0; + + if (monitored) { + currentLength = 0; + } + + for (; ;) { + n = (length > 0) ? Math.min(length, buffer.length) : buffer.length; + n = in.read(buffer, 0, n); + if (n < 0) { + break; + } + + out.write(buffer, 0, n); + out.flush(); + if (monitored) { + currentLength += n; + + } + bytesPerSecond = currentLength / ((System.currentTimeMillis() - start) / 1000.0); + if (length != -1) { + length -= n; + if (length == 0) { + break; + } + } + } + out.flush(); + + if (DEBUG) { + System.out.println(currentLength + " bytes processed in " + + ((System.currentTimeMillis() - start) / 1000.0) + " seconds " + + ((int) bytesPerSecond / 1024) + " kB/s"); + } + } + + + /** + * Return a string represenation of the hander's state. + */ + public String toString() { + StringBuffer str = new StringBuffer(); + str.append("CLIENT "); + str.append(socket.getInetAddress().getHostAddress()); + str.append(":"); + str.append(socket.getPort()); + str.append(" - "); + if (request == null) { + str.append("idle " + ((System.currentTimeMillis() - idle) / 1000.0) + " sec"); + } else { + if (reply != null && currentLength > 0) { + str.append("("); + str.append(currentLength); + if (contentLength > 0) { + str.append("/"); + str.append(contentLength); + } + str.append(" "); + str.append(((int) bytesPerSecond / 1024) + " kB/s"); + str.append(") "); + } + str.append(request.getURL()); + } + return str.toString(); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Http.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Http.java new file mode 100644 index 000000000..23e62f3af --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Http.java @@ -0,0 +1,296 @@ +package com.jpexs.proxy; + + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +/** + * @author Mark Boyns + */ +class Http extends HttpConnection { + static final boolean DEBUG = false; /* enable lots of debug output */ + + /* XXX - more than 1 should work now. */ + static final int MAX_PENDING_REQUESTS = 1; + + static Hashtable cache = new Hashtable(33); + private static Object httpLock = new Object(); + + + String host; + int port; + boolean proxy = false; + boolean persistent = false; + boolean closed = false; + long idle = 0; + Vector queue = new Vector(); + + Http(String host, int port) throws IOException { + this(host, port, false); + } + + Http(String host, int port, boolean isProxy) throws IOException { + super(host, port); + this.host = host; + this.port = port; + this.proxy = isProxy; + } + + public synchronized void sendRequest(Request request) + throws IOException, RetryRequestException { + queue.addElement(request); + + try { + send(request); + } + catch (IOException e) { + if (persistent) { + persistent = false; + if (DEBUG) System.out.println("RETRY SEND " + request.getURL()); + throw new RetryRequestException(); + } + throw e; + } + } + + public synchronized Reply recvReply(Request request) + throws IOException, RetryRequestException { + while (queue.firstElement() != request) { + try { + wait(); + } + catch (InterruptedException e) { + } + } + + if (closed) { + if (DEBUG) System.out.println("RETRY CLOSED " + request.getURL()); + throw new RetryRequestException(); + } + + try { + return recv(); + } + catch (IOException e) { + if (persistent) { + persistent = false; + if (DEBUG) System.out.println("RETRY RECV " + request.getURL()); + throw new RetryRequestException(); + } + throw e; + } + } + + public void reallyClose() { + persistent = false; + if (DEBUG) + System.out.println("REALLY CLOSE " + this); + close(); + } + + public synchronized void close() { + if (persistent) { + idle = System.currentTimeMillis(); + } else { + cacheRemove(host, port, this); + super.close(); + closed = true; + } + + if (queue.size() > 0) { + queue.removeElementAt(0); + if (DEBUG) { + if (persistent) + System.out.println("DONE " + this); + else + System.out.println("CLOSE " + this); + } + notify(); + } + } + + private void send(Request request) throws IOException { + if (DEBUG) System.out.println("SEND " + request.getURL()); + + /* Prepare HTTP/1.1 request */ + request.removeHeaderField("Proxy-Connection"); + request.setHeaderField("Connection", "open"); + if (!request.containsHeaderField("Host")) { + request.setHeaderField("Host", request.getHost()); + } + + if (proxy) { + request.write(getOutputStream()); + } else { + String oldStatusLine = request.statusLine; + StringBuffer head = new StringBuffer(); + head.append(request.getCommand()); + head.append(" "); + head.append(request.getPath()); + head.append(" "); + head.append("HTTP/1.0"); + request.statusLine = head.toString(); + + request.write(getOutputStream()); + + /* flush? */ + + request.statusLine = oldStatusLine; + } + } + + private Reply recv() throws IOException { + Reply reply = new Reply(getInputStream()); + reply.read(); + + String conn = reply.getHeaderField("Connection"); + + if (DEBUG) System.out.println("RECV " + reply.statusLine); + + if (reply.containsHeaderField("Connection") + && reply.getHeaderField("Connection").equals("close")) { + persistent = false; + } else if (reply.getProtocol().equals("HTTP/1.1")) { + persistent = true; + } else { + persistent = false; + } + + /* Received HTTP/1.1 "Continue". Read another Reply. */ + if (reply.getStatusCode() == 100) { + reply = recv(); + } + + return reply; + } + + private boolean isBusy() { + return queue.size() >= MAX_PENDING_REQUESTS; + } + + private boolean isPersistent() { + return persistent; + } + + private static String cacheKey(String host, int port) { + return host.toLowerCase() + ":" + port; + } + + private static Vector cacheLookup(String host, int port) { + Vector v = (Vector) cache.get(cacheKey(host, port)); + return v; + } + + private static boolean cacheContains(Http http) { + Vector v = (Vector) cache.get(cacheKey(http.host, http.port)); + return v != null ? v.contains(http) : false; + } + + private static void cacheInsert(String host, int port, Http http) { + String key = cacheKey(host, port); + Vector v = (Vector) cache.get(key); + if (v == null) { + v = new Vector(); + } + v.addElement(http); + cache.put(key, v); + } + + private static void cacheRemove(String host, int port, Http http) { + Vector v = (Vector) cache.get(cacheKey(host, port)); + if (v != null) { + v.removeElement(http); + if (v.isEmpty()) { + cache.remove(cacheKey(host, port)); + } + } + } + + private static void cacheClean() { + long now = System.currentTimeMillis(); + Enumeration e = cache.keys(); + while (e.hasMoreElements()) { + Vector v = (Vector) cache.get(e.nextElement()); + for (int i = 0; i < v.size(); i++) { + Http http = (Http) v.elementAt(i); + if (http.idle > 0 && now - http.idle > 30000) /* 30 seconds */ { + if (DEBUG) System.out.println("IDLE " + http); + http.persistent = false; + http.close(); + } + } + } + } + + static Http open(String host, int port, boolean isProxy) + throws IOException { + Http http = null; + + synchronized (httpLock) { + Vector v = cacheLookup(host, port); + if (v != null) { + for (int i = 0; i < v.size(); i++) { + Http pick = (Http) v.elementAt(i); + + /* find an http connection that isn't busy */ + if (pick.isPersistent() && !pick.isBusy()) { + http = pick; + break; + } + } + + if (http != null) { + http.idle = 0; + if (DEBUG) System.out.println("REUSE " + http); + } + } + } + + if (http == null) { + if (DEBUG) System.out.println("OPENING " + host + ":" + port); + http = new Http(host, port, isProxy); + if (DEBUG) System.out.println("OPENED " + http); + cacheInsert(host, port, http); + } + + return http; + } + + static Http open(String host, int port) throws IOException { + return open(host, port, false); + } + + static Enumeration enumerate() { + Vector list = new Vector(); + Enumeration e = cache.keys(); + while (e.hasMoreElements()) { + Vector v = (Vector) cache.get(e.nextElement()); + for (int i = 0; i < v.size(); i++) { + list.addElement(v.elementAt(i)); + } + } + return list.elements(); + } + + static synchronized void clean() { + cacheClean(); + } + + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append("SERVER "); + buf.append(super.toString()); + if (isPersistent()) { + buf.append(" - "); + if (queue.size() > 0) { + buf.append(queue.size()); + buf.append(" pending"); + } else { + buf.append("idle " + ((System.currentTimeMillis() - idle) / 1000.0) + " sec"); + } + } + return buf.toString(); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpConnection.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpConnection.java new file mode 100644 index 000000000..65064070e --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpConnection.java @@ -0,0 +1,48 @@ +package com.jpexs.proxy; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; + +abstract class HttpConnection extends Connection implements HttpRelay { + HttpConnection(String host, int port) throws IOException { + super(host, port); + } + + HttpConnection(Socket s) throws IOException { + super(s); + } + + public void sendRequest(Request request) + throws IOException, RetryRequestException { + request.write(getOutputStream()); + } + + public Reply recvReply(Request request) + throws IOException, RetryRequestException { + Reply reply = new Reply(getInputStream()); + reply.read(); + return reply; + } + + public void setInputStream(InputStream in) { + super.setInputStream(in); + } + + public void setOutputStream(OutputStream out) { + super.setOutputStream(out); + } + + public InputStream getInputStream() { + return super.getInputStream(); + } + + public OutputStream getOutputStream() { + return super.getOutputStream(); + } + + public void close() { + super.close(); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpRelay.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpRelay.java new file mode 100644 index 000000000..bb7ca27b6 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/HttpRelay.java @@ -0,0 +1,12 @@ +package com.jpexs.proxy; + + +import java.io.IOException; + +public interface HttpRelay { + void sendRequest(Request request) throws IOException, RetryRequestException; + + Reply recvReply(Request request) throws IOException, RetryRequestException; + + void close(); +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Https.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Https.java new file mode 100644 index 000000000..25be8218b --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Https.java @@ -0,0 +1,40 @@ +package com.jpexs.proxy; + +import java.io.IOException; + +/** + * @author Mark Boyns + */ +class Https extends HttpConnection { + boolean proxy = false; + + Https(String host, int port) throws IOException { + super(host, port); + } + + Https(String host, int port, boolean isProxy) throws IOException { + this(host, port); + proxy = isProxy; + } + + public void sendRequest(Request request) + throws IOException, RetryRequestException { + if (proxy) { + super.sendRequest(request); + } else { + /* nothing */ + } + } + + public Reply recvReply(Request request) + throws IOException, RetryRequestException { + Reply reply = new Reply(getInputStream()); + if (proxy) { + reply.read(); + } else { + reply.statusLine = "HTTP/1.0 200 Connection established"; + reply.setHeaderField("Proxy-agent", "ASDec"); + } + return reply; + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Key.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Key.java new file mode 100644 index 000000000..f10eda895 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Key.java @@ -0,0 +1,41 @@ +package com.jpexs.proxy; + +/** + * A wrapper around java.lang.String to have case-insensitive + * hashCode and equals methods. + * + * @author Mark Boyns + * @see String + */ +class Key { + private String name = null; + + /** + * Create a Key. + */ + Key(String name) { + this.name = name; + } + + /** + * Return a lowercase hashCode. + */ + public int hashCode() { + String s = name.toLowerCase(); + return s.hashCode(); + } + + /** + * Return a lowercase equals. + */ + public boolean equals(Object obj) { + return name.equalsIgnoreCase(obj.toString()); + } + + /** + * Return the key. + */ + public String toString() { + return name; + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Main.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Main.java new file mode 100644 index 000000000..ef69c5f8b --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Main.java @@ -0,0 +1,90 @@ +package com.jpexs.proxy; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +public class Main { + public static int port = 55555; + public static final String REPLACEMENTSFILE = "." + File.separator + "config" + File.separator + "replacements.ini"; + public static boolean DEBUG_MODE = false; + + + public static void enterToContinue() { + Scanner keyIn = new Scanner(System.in); + System.out.print("Press the enter key to continue"); + keyIn.nextLine(); + } + + public static void main(String args[]) { + for (int i = 0; i < args.length; i++) { + if (args[i].toLowerCase().equals("--help")) { + System.out.println("JPEXS Replacement Proxy"); + System.out.println("-----------------------"); + System.out.println("Replacements list is read from \"" + REPLACEMENTSFILE + "\" file."); + System.out.println("Optional commandline parameters:"); + System.out.println(" -d"); + System.out.println(" Print debug info to console "); + System.out.println(" -p"); + System.out.println(" Set proxy port to . Default is 55555."); + System.exit(0); + } + if (args[i].toLowerCase().equals("-d")) { + System.out.println("DEBUG mode ON"); + DEBUG_MODE = true; + } + if (args[i].toLowerCase().startsWith("-p")) { + try { + port = Integer.parseInt(args[i].substring(2)); + System.out.println("PORT set to " + port); + } catch (NumberFormatException ex) { + System.out.println("Invalit port, reset to " + port); + } + + } + } + List replacements = new ArrayList(); + if ((new File(REPLACEMENTSFILE)).exists()) { + try { + BufferedReader br = new BufferedReader(new FileReader(REPLACEMENTSFILE)); + String s = ""; + while ((s = br.readLine()) != null) { + String fileName = br.readLine(); + if (fileName == null) break; + fileName = fileName.replaceAll("[\\\\/]", File.separator); + Replacement r = new Replacement(s, fileName); + if (DEBUG_MODE) { + System.out.println("Added Replacement: " + r.urlPattern + " => " + r.targetFile); + } + replacements.add(r); + } + br.close(); + } catch (IOException e) { + + } + } else { + if (DEBUG_MODE) { + System.out.println("WARNING:REPLACEMENTS FILE NOT FOUND."); + } + } + Server.startServer(port, replacements, new ArrayList(), new CatchedListener() { + /** + * Method called when specified contentType is received + * + * @param contentType Content type + * @param url URL of the method + * @param data Data stream + */ + public void catched(String contentType, String url, InputStream data) { + + } + }, new ReplacedListener() { + public void replaced(Replacement replacement, String url, String contentType) { + if (DEBUG_MODE) { + System.out.println("REPLACED:" + url + " (Content-type:" + contentType + ") WITH FILE " + replacement.targetFile); + } + } + }); + } +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Message.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Message.java new file mode 100644 index 000000000..a125a9d94 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Message.java @@ -0,0 +1,253 @@ +package com.jpexs.proxy; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PushbackInputStream; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +/** + * Abstract class to represent message headers. + * + * @author Mark Boyns + */ +public abstract class Message { + /** + * Hashtable used to store message headers. + */ + private Hashtable headers = new Hashtable(33); + + /** + * + */ + String statusLine = null; + + public String readLine(InputStream in) throws IOException { + char buf[] = new char[128]; + int offset = 0; + int ch; + + for (; ;) { + ch = in.read(); + if (ch == -1 || ch == '\n') { + break; + } else if (ch == '\r') { + int tmpch = in.read(); + if (tmpch != '\n') { + if (!(in instanceof PushbackInputStream)) { + in = new PushbackInputStream(in); + } + ((PushbackInputStream) in).unread(tmpch); + } + break; + } else { + if (offset == buf.length) { + char tmpbuf[] = buf; + buf = new char[tmpbuf.length * 2]; + System.arraycopy(tmpbuf, 0, buf, 0, offset); + } + buf[offset++] = (char) ch; + } + } + return String.copyValueOf(buf, 0, offset); + } + + /** + * Read headers and store them in the hashtable. + */ + void readHeaders(InputStream in) throws IOException { + int i; + Key key = null; + + for (; ;) { + String s = readLine(in); + if (s == null) { + break; + } + i = s.indexOf(':'); + if (i == -1) { + /* end of header */ + if (s.length() == 0) { + break; + } + /* multi-line headers */ + else if (key != null + && (s.startsWith(" ") || s.startsWith("\t"))) { + int index = getHeaderValueCount(key.toString()); + index--; + Vector v = (Vector) headers.get(key); + v.setElementAt(v.elementAt(index) + "\n" + s, index); + } + } else { + key = new Key(s.substring(0, i)); + Vector v; + if (headers.containsKey(key)) { + v = (Vector) headers.get(key); + } else { + v = new Vector(); + } + v.addElement(s.substring(i + 1).trim()); + headers.put(key, v); + } + } + } + + public int headerCount() { + return headers.size(); + } + + /** + * Set the Status line. + */ + public void setStatusLine(String l) { + statusLine = l; + } + + public int getHeaderValueCount(String name) { + Vector v = (Vector) headers.get(new Key(name)); + return v.size(); + } + + public String getHeaderField(String name) { + return getHeaderField(name, 0); + } + + public String getHeaderField(String name, int index) { + Vector v = (Vector) headers.get(new Key(name)); + if (v == null) { + return null; + } + return (String) v.elementAt(index); + } + + public void setHeaderField(String name, String value) { + setHeaderField(name, value, 0); + } + + public void setHeaderField(String name, String value, int index) { + Vector v; + Key key = new Key(name); + + if (headers.containsKey(key)) { + v = (Vector) headers.get(key); + } else { + v = new Vector(); + if (index == 0) { + v.addElement(""); + } + headers.put(key, v); + } + v.setElementAt(value, index); + } + + public void setHeaderField(String name, int value) { + setHeaderField(name, value, 0); + } + + public void setHeaderField(String name, int value, int index) { + setHeaderField(name, new Integer(value).toString(), index); + } + + /** + * Set all header fields with the give name to the + * specified value. + */ + public void setHeaderFields(String name, String value) { + Vector v; + Key key = new Key(name); + + v = (Vector) headers.get(key); + if (v != null) { + for (int i = 0; i < v.size(); i++) { + v.setElementAt(value, i); + } + } + } + + public void appendHeaderField(String name, String value) { + appendHeaderField(name, value, 0); + } + + public void appendHeaderField(String name, String value, int index) { + setHeaderField(name, getHeaderField(name, index) + value, index); + } + + public void removeHeaderField(String name) { + headers.remove(new Key(name)); + } + + /** + * Return whether or not a header exists. + * + * @param name header name + */ + public boolean containsHeaderField(String name) { + return headers.containsKey(new Key(name)); + } + + /** + * @return an Enumeration of Strings + */ + public Enumeration getHeaders() { + Vector v = new Vector(); + + for (Enumeration e = headers.keys(); e.hasMoreElements();) { + v.addElement(e.nextElement().toString()); + } + + return v.elements(); + } + + private final static byte[] COLON_SPACE = ": ".getBytes(); + private final static byte[] CRLF = "\r\n".getBytes(); + + private ByteArray toByteArray(byte[] sep) { + ByteArray buf = new ByteArray(); + Key key; + String value; + Vector v; + int i = 0; + + buf.append(statusLine); + buf.append(sep); + + for (Enumeration e = headers.keys(); e.hasMoreElements();) { + key = (Key) e.nextElement(); + v = (Vector) headers.get(key); + for (i = 0; i < v.size(); i++) { + buf.append(key.toString()); + buf.append(COLON_SPACE); + buf.append(v.elementAt(i).toString()); + buf.append(sep); + } + } + buf.append(sep); + + return buf; + } + + private ByteArray toByteArray() { + return toByteArray(CRLF); + } + + private ByteArray toByteArray(String sep) { + return toByteArray(sep.getBytes()); + } + + public String toString() { + return toByteArray().toString(); + } + + public String toString(String sep) { + return toByteArray(sep).toString(); + } + + public void write(OutputStream out) + throws IOException { + toByteArray().writeTo(out); + out.flush(); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ReplacedListener.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ReplacedListener.java new file mode 100644 index 000000000..b23576348 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/ReplacedListener.java @@ -0,0 +1,5 @@ +package com.jpexs.proxy; + +public interface ReplacedListener { + public void replaced(Replacement replacement, String url, String contentType); +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Replacement.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Replacement.java new file mode 100644 index 000000000..e9a63a7c6 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Replacement.java @@ -0,0 +1,63 @@ +package com.jpexs.proxy; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.regex.Pattern; + +/** + * Replacement of URL with local file + */ +public class Replacement { + + /** + * URL pattern, can contain * wild-cards + */ + public String urlPattern; + /** + * Filename to replace content with + */ + public String targetFile; + /** + * Date of last accesing this url + */ + public Calendar lastAccess; + + /** + * Constructor + * + * @param urlPattern URL pattern, can contain * wild-cards + * @param targetFile Filename to replace content with + */ + public Replacement(String urlPattern, String targetFile) { + this.urlPattern = urlPattern; + this.targetFile = targetFile; + } + + /** + * Returns true when urlPattern matches specified url + * + * @param url Url to test match + * @return True when matches + */ + public boolean matches(String url) { + String pat = Pattern.quote(urlPattern); + pat = pat.replace("*", "\\E.*\\Q"); + return Pattern.matches(pat, url); + } + + /** + * Returns a string representation of the object. + * + * @return a string representation of the object. + */ + @Override + public String toString() { + SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); + + if (lastAccess == null) { + return " " + urlPattern; + } else { + return format.format(lastAccess.getTime()) + " " + urlPattern; + } + } +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Reply.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Reply.java new file mode 100644 index 000000000..dfa259e4c --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Reply.java @@ -0,0 +1,203 @@ +package com.jpexs.proxy; + + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.util.Hashtable; +import java.util.StringTokenizer; + +/** + * @author Mark Boyns + */ +public class Reply extends Message { + InputStream in = null; + int statusCode = -1; + + public Reply() { + } + + public Reply(InputStream in) { + setContent(in); + } + + public void setContent(InputStream in) { + this.in = in; + } + + public InputStream getContent() { + return in; + } + + void read() throws IOException { + if (in != null) { + read(in); + } + } + + void read(InputStream in) throws IOException { + statusLine = readLine(in); + if (statusLine == null || statusLine.length() == 0) { + throw new IOException("Missing HTTP status line"); + } + + /* Look for HTTP/0.9 */ + if (!statusLine.startsWith("HTTP")) { + /* Put back the line */ + if (this.in != null) { + String putback = new String(statusLine + "\n"); + this.in = new SequenceInputStream(new ByteArrayInputStream(putback.getBytes("utf8")), in); + } + /* Fake a status line and upgrade to HTTP/1.0 */ + statusLine = "HTTP/1.0 200 OK"; + return; + } + + readHeaders(in); + int code = getStatusCode(); + + /* RFC 2068: 204 and 304 MUST NOT contain a message body. */ + switch (code) { + case 204: /* No Content */ + case 304: /* Not Modified */ + /* Ignore the message body if it exists */ + if (containsHeaderField("Content-length")) { + int contentLength = 0; + try { + contentLength = Integer.parseInt(getHeaderField("Content-length")); + } + catch (NumberFormatException e) { + } + int n; + byte buffer[] = new byte[8192]; + while ((n = in.read(buffer, 0, buffer.length)) > 0) { + /* ignore */ + } + removeHeaderField("Content-length"); + } + break; + } + } + + public boolean hasContent() { + switch (getStatusCode()) { + case 204: + case 304: + return false; + + default: + return true; + } + } + + public String getProtocol() { + StringTokenizer st = new StringTokenizer(statusLine); + String protocol = (String) st.nextToken(); + return protocol; + } + + public int getStatusCode() { + if (statusCode == -1) { + StringTokenizer st = new StringTokenizer(statusLine); + String protocol = (String) st.nextToken(); + String status = (String) st.nextToken(); + + try { + statusCode = Integer.parseInt(status); + } + catch (NumberFormatException e) { + statusCode = 0; + } + } + + return statusCode; + } + + private Hashtable headerParser(String header) { + Hashtable table = new Hashtable(); + String type = getHeaderField(header); + if (type == null) { + return table; + } + + StringTokenizer st = new StringTokenizer(type, ";"); + int count = 0; + while (st.hasMoreTokens()) { + String token = st.nextToken(); + token = token.trim(); + String name; + String value; + int i = token.indexOf('='); + if (i != -1) { + name = token.substring(0, i); + value = token.substring(i + 1); + } else { + name = token; + value = ""; + } + + if (count == 0) { + table.put(header, name); + } else { + table.put(name, value); + } + + count++; + } + + return table; + } + + public String getContentType() { + Hashtable table = headerParser("Content-type"); + return (String) table.get("Content-type"); + } + + public String getBoundary() { + Hashtable table = headerParser("Content-type"); + return (String) table.get("boundary"); + } + + public String getTransferEncoding() { + Hashtable table = headerParser("Transfer-Encoding"); + return (String) table.get("Transfer-Encoding"); + } + + public int getChunkSize(InputStream in) throws IOException { + String line = readLine(in); + line = line.trim(); /* apache can have trailing spaces */ + int size = -1; + try { + size = Integer.valueOf(line, 16).intValue(); + } + catch (NumberFormatException e) { + System.out.println(e); + } + return size; + } + + public void getChunkedFooter(InputStream in) throws IOException { + for (; ;) { + String line = readLine(in); + if (line == null) { + break; + } + int i = line.indexOf(':'); + if (i == -1) { + break; + } + } + } + + public void setStatusLine(String line) { + this.statusLine = line; + } + + public static Reply createRedirect(String url) { + Reply r = new Reply(); + r.setStatusLine("HTTP/1.0 302 Moved Temporarily"); + r.setHeaderField("Location", url); + return r; + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Request.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Request.java new file mode 100644 index 000000000..d789d6b2c --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Request.java @@ -0,0 +1,235 @@ +package com.jpexs.proxy; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.StringTokenizer; +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author Mark Boyns + */ +public class Request extends Message { + private static Pattern httpRegex; + private String command = null; + private String url = null; + private String protocol = null; + private byte[] data = null; + private Hashtable log; + private Vector logHeaders; + private Client client; + + static { + httpRegex = Pattern.compile("^(http|https):", Pattern.CASE_INSENSITIVE); + } + + public Request(Client client) { + this.client = client; + } + + void read(InputStream in) throws IOException { + statusLine = readLine(in); + if (statusLine == null || statusLine.length() == 0) { + throw new IOException("Empty request"); + } + + StringTokenizer st = new StringTokenizer(statusLine); + command = (String) st.nextToken(); + url = (String) st.nextToken(); + protocol = (String) st.nextToken(); + + if (!url.startsWith("http")) { + Matcher match = httpRegex.matcher(url); + if (match.matches()) { + url = url.substring(match.start(), + match.end()).toLowerCase() + + url.substring(match.end()); + } + } + + readHeaders(in); + + if ("POST".equals(command) || "PUT".equals(command)) { + try { + int n = Integer.parseInt(getHeaderField("Content-length")); + data = new byte[n]; + int offset = 0; + while (offset < data.length) { + n = in.read(data, offset, data.length - offset); + if (n < 0) { + throw new IOException("Not enough " + command + " data"); + } + offset += n; + } + } + catch (NumberFormatException e) { + System.out.println("Malformed or missing " + command + " Content-length"); + } + } + } + + public void write(OutputStream out) + throws IOException { + super.write(out); + if (data != null) { + out.write(data); + out.flush(); + } + } + + public String getRequest() { + return statusLine; + } + + public String getCommand() { + return command; + } + + public void setCommand(String command) { + this.command = command; + } + + public String getURL() { + return url; + } + + public void setURL(String url) { + this.url = url; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getHost() { + String url = getURL(); + String s; + + if (url.startsWith("http://")) { + s = url.substring(7, url.indexOf('/', 7)); + } else { + s = url; + } + + int at = s.indexOf('@'); + if (at != -1) { + s = s.substring(at + 1); + } + + if (s.indexOf(':') != -1) { + return s.substring(0, s.indexOf(':')); + } + + return s; + } + + public int getPort() { + int port = 80; + String url = getURL(); + String s; + + if (url.startsWith("http://")) { + s = url.substring(7, url.indexOf('/', 7)); + } else { + s = url; + } + + int at = s.indexOf('@'); + if (at != -1) { + s = s.substring(at + 1); + } + + if (s.indexOf(':') != -1) { + try { + port = Integer.parseInt(s.substring(s.indexOf(':') + 1)); + } + catch (NumberFormatException e) { + System.out.println("Invalid port in " + url); + } + } + return port; + } + + public String getData() { + if (data == null) { + return null; + } + return new String(data); + } + + public byte[] getDataBytes() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + + + public String getPath() { + String str = getURL(); + int pos = 0; + for (int i = 0; i < 3; i++) { + pos = str.indexOf('/', pos); + pos++; + } + pos--; + return str.substring(pos); + } + + public String getDocument() { + String path = getPath(); + int n = path.lastIndexOf('/'); + if (n == path.length() - 1) { + n = path.lastIndexOf('/', n - 1); + } + if (n < 0) { + return "/"; + } else { + return path.substring(n + 1); + } + } + + + public String getQueryString() { + String path = getPath(); + int n = path.indexOf('?'); + if (n < 0) { + return null; + } + return path.substring(n + 1); + } + + public synchronized void addLogEntry(String header, + String message) { + if (log == null) { + log = new Hashtable(); + logHeaders = new Vector(); + } + + Vector v = (Vector) log.get(header); + if (log.get(header) == null) { + v = new Vector(); + log.put(header, v); + logHeaders.addElement(header); + } + v.addElement(message); + } + + public Enumeration getLogHeaders() { + return logHeaders != null ? logHeaders.elements() : null; + } + + public Enumeration getLogEntries(String header) { + return log != null ? ((Vector) log.get(header)).elements() : null; + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/RetryRequestException.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/RetryRequestException.java new file mode 100644 index 000000000..dbc558497 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/RetryRequestException.java @@ -0,0 +1,11 @@ +package com.jpexs.proxy; + +class RetryRequestException extends Exception { + RetryRequestException() { + super(); + } + + RetryRequestException(String message) { + super(message); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Server.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Server.java new file mode 100644 index 000000000..259caca2a --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/Server.java @@ -0,0 +1,88 @@ +package com.jpexs.proxy; + +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.List; + +/** + * Proxy server + * + * @author JPEXS + */ +public class Server extends Thread { + private ServerSocket ssocket = null; + private boolean stoppped = false; + private List replacements; + private static Server server; + private List catchedContentTypes; + private CatchedListener catchedListener; + private int port; + private ReplacedListener replacedListener; + + private Server(int port, List replacements, List catchedContentTypes, CatchedListener catchedListener, ReplacedListener replacedListener) { + this.replacements = replacements; + this.catchedContentTypes = catchedContentTypes; + this.catchedListener = catchedListener; + this.replacedListener = replacedListener; + this.port = port; + } + + private void stopRun() { + stoppped = true; + if (ssocket != null) { + try { + ssocket.close(); + } catch (IOException e) { + + } + } + } + + /** + * Starts proxy server + * + * @param port Listening port + * @param replacements List of replacements + * @param catchedContentTypes Content types to sniff + * @param catchedListener Catched listener + */ + public static void startServer(int port, List replacements, List catchedContentTypes, CatchedListener catchedListener, ReplacedListener replacedListener) { + stopServer(); + server = new Server(port, replacements, catchedContentTypes, catchedListener, replacedListener); + //WorkerThread.assignThread(server, "Proxy server"); + server.start(); + } + + /** + * Stops proxy server + */ + public static void stopServer() { + if (server != null) server.stopRun(); + server = null; + } + + /** + * Runs the server + */ + public void run() { + + try { + ssocket = new ServerSocket(port); + } catch (IOException e) { + System.err.println("Cannot bind to port"); + return; + } + for (; ;) { + try { + Socket sock = ssocket.accept(); + Handler handler = new Handler(sock, replacements, catchedContentTypes, catchedListener, replacedListener); + WorkerThread.assignThread(handler, "Proxy handler"); + } catch (IOException e) { + + } + if (stoppped) + break; + } + } +} diff --git a/trunk/libsrc/jpproxy/src/com/jpexs/proxy/WorkerThread.java b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/WorkerThread.java new file mode 100644 index 000000000..7545afdb6 --- /dev/null +++ b/trunk/libsrc/jpproxy/src/com/jpexs/proxy/WorkerThread.java @@ -0,0 +1,142 @@ +// Copyright (c) 1999 Brian Wellington (bwelling@xbill.org) +// Portions Copyright (c) 1999 Network Associates, Inc. + +package com.jpexs.proxy; + +import java.util.Vector; + +/** + * An extension of a Thread that uses threads from a pool, rather than + * allocating a new thread for each assigned task. + * + * @author Brian Wellington + */ + +public class WorkerThread extends Thread { + + private Runnable task; + private String name; + + private static int nactive = 0; + private static Vector list = new Vector(); + private static int max = 10; + private static long lifetime = 900 * 1000; /* 15 minute default */ + + private WorkerThread() { + setDaemon(true); + } + + /** + * Sets the lifetime of an idle WorkerThread (in ms). A WorkerThread + * will remain on the idle list for this much time before exiting. This + * does not affect WorkerThreads currently idling. + */ + synchronized static void + setLifetime(long time) { + lifetime = time; + } + + /** + * Sets the maximum number of WorkerThreads that can exist at any given + * time. If this value is decreased below the current number of + * WorkerThreads, this will not take effect immediately. + */ + synchronized static void + setMaxThreads(int maxThreads) { + max = maxThreads; + } + + /** + * Obtains a WorkerThread to which a task can be assigned. If an idle + * WorkerThread is present, it is removed from the idle list and returned. + * If not, and the maximum number of WorkerThreads has not been reached, + * a new WorkerThread is created. If the maximum number has been reached, + * this blocks until a WorkerThread is free. + */ + static WorkerThread + getThread() { + WorkerThread t; + synchronized (list) { + if (list.size() > 0) { + t = (WorkerThread) list.firstElement(); + list.removeElement(t); + } else if (nactive >= max) { + while (true) { + try { + list.wait(); + } + catch (InterruptedException e) { + } + if (list.size() == 0) + continue; + t = (WorkerThread) list.firstElement(); + list.removeElement(t); + break; + } + } else + t = new WorkerThread(); + nactive++; + } + return t; + } + + /** + * Assigns a task to a WorkerThread + * + * @param task The task to be run + * @param name The name of the task + */ + public static void + assignThread(Runnable task, String name) { + while (true) { + try { + WorkerThread t = getThread(); + synchronized (t) { + t.task = task; + t.name = name; + if (!t.isAlive()) + t.start(); + else + t.notify(); + } + return; + } + catch (IllegalThreadStateException e) { + } + } + } + + /** + * Performs the task + */ + synchronized public void + run() { + while (true) { + setName(name); + try { + task.run(); + } + catch (Throwable t) { + System.err.println(t); + } + setName("idle thread"); + synchronized (list) { + list.addElement(this); + if (nactive >= max) + list.notify(); + nactive--; + } + task = null; + try { + wait(lifetime); + } + catch (InterruptedException e) { + } + if (task == null) { + list.removeElement(this); + return; + } + } + } + +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/CHANGELOG.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/CHANGELOG.txt new file mode 100644 index 000000000..7cf5a2857 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/CHANGELOG.txt @@ -0,0 +1,90 @@ +Version 0.9.5 - Java Reflection Completions additions + * Configuration class overhaul. Each kit now has its own COnfiguration file + which merges the superclass(es) Configurations. + * Usable Reflect Completions Dialog (Java with F1 or Menu) + * Java ENTER key responds properly to multi line comments + * Font can be changed for each Kit + * Kits for XHTML and Xpath added. XHTML has a simple Preview Action. + * Added Execute Script to JacaScript (can also be used for Groovy if Groovy + Scripting support is installed properly). + * Hotkeys for actions are displayed in Popup Menus + * Word Completion action can also do CamelCase matches + * Smart Home Action (and Smart Home Extend Selection) + * Enhanced JavaScript support. Issue 115 + * Better Undo grouping + * Replace DIalog ENhancement. Only for updatedable editors and added single replace. + * Added append method to SyntaxDocument + * Fixed Issue 130 - Compound Undo on multiple lines. +Version 0.9.4 - IntelliSense additions + * Adding IntelliSense to Java with simple List of selectable keywords + * Added Toggle Comment Actions using Control SLASH + * Fixed Issue 47. + * Added Clojure, Scala, DOS Batch and 'nix bash support + * Added Configurable Popup menus with default Tango Desktop icons + * Added configurable format for the CaretMonitor class + * Toggle Comments Action selects the lines affected after being performed + * Added multi-line support in ActionUtils.insertMagicSTring method. + * GotoLine dialog responds to ESC key +Version 0.9.3 - Start of scripts for the document: + * Added new methods getLine() to SyntaxDocument + * SyntaxDocument getIndexOf methods deprecated, use getMatchers instead + * Added Line Numbering to Java + * Added CaretMonitor Class + * Merged Find And Replace dialogs into one. + * Created SyntaxComponent interface and have all UI components implement + that interface. DefaultSyntaxKit will use config.properties class to + dynamically install these components. + * Added Right Margin option and Single Color Selection Options + * Added Python, C and C++ Support + * Added Ruby Syntax Support + * Fixed Issue 37 (NPE for LineNumbersRuler) + * Fixed Issue 39 (Highlighting Tokens overrides selection highlights) + * Fixed some JavaDoc comments. + * Fixed Line Numbers being displayed for the height of the editor and now + just for the actual available lines. + * Fixed Margin typo in all project. Issue 43 + * Changing Actions to be more configurable: + * SyntaxActions renamed to ActionUtils + * Removed all inner classes from SyntaxActions + * Will create new SyntaxAction interface that will allow dynamic addition + actions (in the addKeyActions of DefaultSyntaxKit + * Added Text AA property to SyntaxView +Version 0.9.2: + * Fixing Java Indentation and Un-Indentattion Actions + * Added and used (in the Tester) clearUndoes on the SyntaxDocument + * Added Basic JFlex Syntax + * Added getContentTypes to DefaultSyntaxKit to get all registered + ContentTypes. This is now also used in the SyntaxTester instead of + hardcoding the types. + * Cleanup and optimization of Lexers by removing duplicate Java Code + (replaced with Regex OR) + * Removed calls to deprecated calls in SyntaxView + * Modified the SyntaxDOcument to override the fireXXX methods and parse + the document at that time instead of overriding the inserUpdate method. + This fixes issue 24. + * Added Groovy GString expression highlights + * Removed getLanguages method from Lexer interface and implementations. + * Added WARNING and ERROR TokenTypes and added their default styles. + * Moved Keymaps and install methods to SyntaxKits instead of the Lexers + * Removed deprecated methods from SyntaxActions class + * Split SyntaxActions into new package and moved inner classes to the new + package + * Added Token HighLighter to Java + * Added Pairs Highlighter to Java + * Token class made immutable (all final fields) + * Added Find and Replace Dialogs and Action to Java (mapped to C-F and + C-H ) + * Added pair matching to XML tags + * Added CDATA matching and pair highlights for XML + * Added Comment Pair Highlighting in XML + * Fixed highlighting with selections so the selection always appears + * Merged Find and Replace Dialogs into one + * Fixed issue 33 (undable to add new line after final closing brace for + Java) + * Added Groovy Multi-Line strings and fixed Comments as Regex issue. + * Fixes to empty find text field causing NPE +Version 0.9.1 + * Fixed empty strings in XML syntax Issue 29 + * Fixed TAL lexer using incorrect package name +Version 0.9.0 + * Initial version after major overhaul \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/javaRegex.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/javaRegex.properties new file mode 100644 index 000000000..92ccefc30 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/javaRegex.properties @@ -0,0 +1,11 @@ +# Java Regex Lexer: +COMMENT=/\\*(?:.|[\\n\\r])*?\\*/|//.* +STRING=\"((?:\\\")|.*)?\" +IDENTIFIER=[a-z][a-zA-Z0-9_]* +TYPE=[A-Z_]\\w* +KEYWORD=abstract|boolean|break|byte|case|catch|char|class|const|continue|\ +do|double|enum|else|extends|final|finally|float|for|default|implements|import|\ +instanceof|int|interface|long|native|new|goto|if|public|short|super|switch|\ +synchronized|package|private|protected|transient|return|void|static|while|this|\ +throw|throws|try|volatile|strictfp|true|false|null +TYPE3=@\\w+ \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/nbactions.xml b/trunk/libsrc/jsyntaxpane/jsyntaxpane/nbactions.xml new file mode 100644 index 000000000..379f9d6af --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/nbactions.xml @@ -0,0 +1,41 @@ + + + + run + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.1:exec + + + -classpath %classpath jsyntaxpane.SyntaxTester + java + + + + debug + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.1:exec + + + -Xdebug -Djava.compiler=none -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath jsyntaxpane.SyntaxTester + true + java + + + + profile + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.1:exec + + + ${profiler.args} -classpath %classpath jsyntaxpane.SyntaxTester + profile + ${profiler.java} + + + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/pom.xml b/trunk/libsrc/jsyntaxpane/jsyntaxpane/pom.xml new file mode 100644 index 000000000..0e2f8d009 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + jsyntaxpane + jsyntaxpane + jar + 0.9.5 + jsyntaxpane + A very simple to use and extend JEditorKit that supports few languages. The main goal is to make it easy to have nice looking Java Swing Editors with support for Syntax Highlighting. + http://jsyntaxpane.googlecode.com/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + http://jsyntaxpane.googlecode.com/svn/ + + + + + jflex + JFlex repository + http://jflex.sourceforge.net/repo/ + + + + + + + maven-compiler-plugin + RELEASE + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-jar-plugin + + + **/Thumbs.db + + + + jsyntaxpane.SyntaxTester + jsyntaxpane + true + + + + development + ${pom.url} + + + + + + de.jflex + maven-jflex-plugin + + + + + generate + + + + + + + + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/Main.iml b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/Main.iml new file mode 100644 index 000000000..e67abe102 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/Main.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java new file mode 100644 index 000000000..3314b7bb5 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/CompoundUndoMan.java @@ -0,0 +1,140 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import javax.swing.event.UndoableEditEvent; +import javax.swing.text.AbstractDocument; +import javax.swing.text.AbstractDocument.DefaultDocumentEvent; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.CompoundEdit; +import javax.swing.undo.UndoManager; +import javax.swing.undo.UndoableEdit; + +/** + * A revised UndoManager that groups undos based on positions. If the change is relatively next to the + * previous change, like when continuous typing, then the undoes are grouped together. + * + * This is cutomized from the + * + * http://www.camick.com/java/source/CompoundUndoMan.java + * + * from the blog: + * + * http://tips4java.wordpress.com/2008/10/27/compound-undo-manager/ + * + * @author Ayman Al-Sairafi + */ +public class CompoundUndoMan extends UndoManager { + + private CompoundEdit compoundEdit; + // This allows us to start combining operations. + // it will be reset after the first change. + private boolean startCombine = false; + // This holds the start of the last line edited, if edits are on multiple + // lines, then they will not be combined. + private int lastLine = -1; + + public CompoundUndoMan(SyntaxDocument doc) { + doc.addUndoableEditListener(this); + lastLine = doc.getStartPosition().getOffset(); + } + + /** + * Whenever an UndoableEdit happens the edit will either be absorbed + * by the current compound edit or a new compound edit will be started + */ + @Override + public void undoableEditHappened(UndoableEditEvent e) { + // Start a new compound edit + + AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) e.getEdit(); + + if (compoundEdit == null) { + compoundEdit = startCompoundEdit(e.getEdit()); + startCombine = false; + return; + } + + int editLine = ((SyntaxDocument)docEvt.getDocument()).getLineNumberAt(docEvt.getOffset()); + + // Check for an incremental edit or backspace. + // The Change in Caret position and Document length should both be + // either 1 or -1. + if ((startCombine || Math.abs(docEvt.getLength()) == 1) && editLine == lastLine) { + compoundEdit.addEdit(e.getEdit()); + startCombine = false; + return; + } + + // Not incremental edit, end previous edit and start a new one + lastLine = editLine; + + compoundEdit.end(); + compoundEdit = startCompoundEdit(e.getEdit()); + } + + /* + ** Each CompoundEdit will store a group of related incremental edits + ** (ie. each character typed or backspaced is an incremental edit) + */ + private CompoundEdit startCompoundEdit(UndoableEdit anEdit) { + // Track Caret and Document information of this compound edit + AbstractDocument.DefaultDocumentEvent docEvt = (DefaultDocumentEvent) anEdit; + + // The compound edit is used to store incremental edits + + compoundEdit = new MyCompoundEdit(); + compoundEdit.addEdit(anEdit); + + // The compound edit is added to the UndoManager. All incremental + // edits stored in the compound edit will be undone/redone at once + + addEdit(compoundEdit); + + return compoundEdit; + } + + class MyCompoundEdit extends CompoundEdit { + + @Override + public boolean isInProgress() { + // in order for the canUndo() and canRedo() methods to work + // assume that the compound edit is never in progress + return false; + } + + @Override + public void undo() throws CannotUndoException { + // End the edit so future edits don't get absorbed by this edit + + if (compoundEdit != null) { + compoundEdit.end(); + } + + super.undo(); + + // Always start a new compound edit after an undo + + compoundEdit = null; + } + } + + /** + * Start to combine the next operations together. Only the next operation is combined. + * The flag is then automatically reset. + */ + public void startCombine() { + startCombine = true; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/DefaultSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/DefaultSyntaxKit.java new file mode 100644 index 000000000..56242fce2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/DefaultSyntaxKit.java @@ -0,0 +1,671 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.awt.Color; +import java.awt.Container; +import java.util.logging.Level; +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.awt.Toolkit; +import java.awt.event.KeyEvent; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.logging.Logger; +import java.util.regex.Pattern; +import javax.swing.Action; +import javax.swing.ActionMap; +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.InputMap; +import javax.swing.JButton; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JEditorPane; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JToolBar; +import javax.swing.KeyStroke; +import javax.swing.text.DefaultEditorKit; +import javax.swing.text.Document; +import javax.swing.text.EditorKit; +import javax.swing.text.Element; +import javax.swing.text.JTextComponent; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; +import jsyntaxpane.actions.DefaultSyntaxAction; +import jsyntaxpane.actions.SyntaxAction; +import jsyntaxpane.components.SyntaxComponent; +import jsyntaxpane.util.Configuration; +import jsyntaxpane.util.JarServiceProvider; + +/** + * The DefaultSyntaxKit is the main entry to SyntaxPane. To use the package, just + * set the EditorKit of the EditorPane to a new instance of this class. + * + * You need to pass a proper lexer to the class. + * + * @author ayman + */ +public class DefaultSyntaxKit extends DefaultEditorKit implements ViewFactory { + + public static final String CONFIG_CARETCOLOR = "CaretColor"; + public static final String CONFIG_SELECTION = "SelectionColor"; + public static final String CONFIG_COMPONENTS = "Components"; + public static final String CONFIG_MENU = "PopupMenu"; + public static final String CONFIG_TOOLBAR = "Toolbar"; + public static final String CONFIG_TOOLBAR_ROLLOVER = "Toolbar.Buttons.Rollover"; + public static final String CONFIG_TOOLBAR_BORDER = "Toolbar.Buttons.BorderPainted"; + public static final String CONFIG_TOOLBAR_OPAQUE = "Toolbar.Buttons.Opaque"; + public static final String CONFIG_TOOLBAR_BORDER_SIZE = "Toolbar.Buttons.BorderSize"; + private static final Pattern ACTION_KEY_PATTERN = Pattern.compile("Action\\.((\\w|-)+)"); + private static final Pattern DEFAULT_ACTION_PATTERN = Pattern.compile("(DefaultAction.((\\w|-)+)).*"); + private static Font DEFAULT_FONT; + private static Set CONTENT_TYPES = new HashSet(); + private static Boolean initialized = false; + private static Map abbrvs; + private static String MENU_MASK_STRING = "control "; + private Lexer lexer; + private static final Logger LOG = Logger.getLogger(DefaultSyntaxKit.class.getName()); + private Map> editorComponents = + new WeakHashMap>(); + private Map popupMenu = + new WeakHashMap(); + /** + * Main Configuration of JSyntaxPane EditorKits + */ + private static Map, Configuration> CONFIGS; + + static { + // we only need to initialize once. + if (!initialized) { + initKit(); + } + int menuMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + if(menuMask == KeyEvent.ALT_DOWN_MASK) { + MENU_MASK_STRING = "alt "; + } + } + private static final String ACTION_MENU_TEXT = "MenuText"; + + /** + * Create a new Kit for the given language + * @param lexer + */ + public DefaultSyntaxKit(Lexer lexer) { + super(); + this.lexer = lexer; + } + + /** + * Adds UI components to the pane + * @param editorPane + */ + public void addComponents(JEditorPane editorPane) { + // install the components to the editor: + String[] components = getConfig().getPropertyList(CONFIG_COMPONENTS); + for (String c : components) { + installComponent(editorPane, c); + } + } + + /** + * Creates a SyntaxComponent of the the given classname and installs + * it on the pane + * @param pane + * @param classname + */ + public void installComponent(JEditorPane pane, String classname) { + try { + @SuppressWarnings(value = "unchecked") + Class compClass = Class.forName(classname); + SyntaxComponent comp = (SyntaxComponent) compClass.newInstance(); + comp.config(getConfig()); + comp.install(pane); + if (editorComponents.get(pane) == null) { + editorComponents.put(pane, new ArrayList()); + } + editorComponents.get(pane).add(comp); + } catch (InstantiationException ex) { + LOG.log(Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + LOG.log(Level.SEVERE, null, ex); + } catch (ClassNotFoundException ex) { + LOG.log(Level.SEVERE, null, ex); + } + } + + /** + * Find the SyntaxCOmponent with given classname that is installed + * on the given pane, then deinstalls and removes it fom the + * editorComponents list + * @param pane + * @param classname + */ + public void deinstallComponent(JEditorPane pane, String classname) { + for (SyntaxComponent c : editorComponents.get(pane)) { + if (c.getClass().getName().equals(classname)) { + c.deinstall(pane); + editorComponents.get(pane).remove(c); + break; + } + } + } + + /** + * Checks if the component with given classname is installed on the + * pane. + * @param pane + * @param classname + * @return true if component is installed, false otherwise + */ + public boolean isComponentInstalled(JEditorPane pane, String classname) { + for (SyntaxComponent c : editorComponents.get(pane)) { + if (c.getClass().getName().equals(classname)) { + return true; + } + } + return false; + } + + /** + * Toggles the component with given classname. If component is found + * and installed, then it is deinstalled. Otherwise a new one is + * installed + * @param pane + * @param classname + * @return true if component was installed, false if it was removed + */ + public boolean toggleComponent(JEditorPane pane, String classname) { + for (SyntaxComponent c : editorComponents.get(pane)) { + if (c.getClass().getName().equals(classname)) { + c.deinstall(pane); + editorComponents.get(pane).remove(c); + return false; + } + } + installComponent(pane, classname); + return true; + } + + /** + * Adds a popup menu to the editorPane if needed. + * + * @param editorPane + */ + public void addPopupMenu(JEditorPane editorPane) { + String[] menuItems = getConfig().getPropertyList(CONFIG_MENU); + if (menuItems == null || menuItems.length == 0) { + return; + } + popupMenu.put(editorPane, new JPopupMenu()); + JMenu stack = null; + for (String menuString : menuItems) { + + // create the Popup menu + if (menuString.equals("-")) { + popupMenu.get(editorPane).addSeparator(); + } else if (menuString.startsWith(">")) { + JMenu sub = new JMenu(menuString.substring(1)); + popupMenu.get(editorPane).add(sub); + stack = sub; + } else if (menuString.startsWith("<")) { + Container parent = stack.getParent(); + if (parent instanceof JMenu) { + JMenu jMenu = (JMenu) parent; + stack = jMenu; + } else { + stack = null; + } + } else { + Action action = editorPane.getActionMap().get(menuString); + if (action != null) { + JMenuItem menuItem; + if (action.getValue(Action.SELECTED_KEY) != null) { + menuItem = new JCheckBoxMenuItem(action); + } else { + menuItem = new JMenuItem(action); + } + // Use our own property if it was set for the menu text + if (action.getValue(ACTION_MENU_TEXT) != null) { + menuItem.setText((String) action.getValue(ACTION_MENU_TEXT)); + } + if (stack == null) { + popupMenu.get(editorPane).add(menuItem); + } else { + stack.add(menuItem); + } + } + } + } + editorPane.setComponentPopupMenu(popupMenu.get(editorPane)); + } + + /** + * Add all pop-up menu items to a Toolbar. You need to call the validate method + * on the toolbar after this is done to layout the buttons. + * Only Actions which have a SMALL_ICON property will be added to the toolbar + * There are three Configuration Keys that affect the appearance of the added buttons: + * CONFIG_TOOLBAR_ROLLOVER, CONFIG_TOOLBAR_BORDER, CONFIG_TOOLBAR_OPAQUE + * + * @param editorPane + * @param toolbar + */ + public void addToolBarActions(JEditorPane editorPane, JToolBar toolbar) { + String[] toolBarItems = getConfig().getPropertyList(CONFIG_TOOLBAR); + if (toolBarItems == null || toolBarItems.length == 0) { + toolBarItems = getConfig().getPropertyList(CONFIG_MENU); + if (toolBarItems == null || toolBarItems.length == 0) { + return; + } + } + boolean btnRolloverEnabled = getConfig().getBoolean(CONFIG_TOOLBAR_ROLLOVER, true); + boolean btnBorderPainted = getConfig().getBoolean(CONFIG_TOOLBAR_BORDER, false); + boolean btnOpaque = getConfig().getBoolean(CONFIG_TOOLBAR_OPAQUE, false); + int btnBorderSize = getConfig().getInteger(CONFIG_TOOLBAR_BORDER_SIZE, 2); + for (String menuString : toolBarItems) { + if (menuString.equals("-") || + menuString.startsWith("<") || + menuString.startsWith(">")) { + toolbar.addSeparator(); + } else { + Action action = editorPane.getActionMap().get(menuString); + if (action != null && action.getValue(Action.SMALL_ICON) != null) { + JButton b = toolbar.add(action); + b.setRolloverEnabled(btnRolloverEnabled); + b.setBorderPainted(btnBorderPainted); + b.setOpaque(btnOpaque); + b.setFocusable(false); + b.setBorder(BorderFactory.createEmptyBorder(btnBorderSize, + btnBorderSize, btnBorderSize, btnBorderSize)); + } + } + } + } + + @Override + public ViewFactory getViewFactory() { + return this; + } + + @Override + public View create(Element element) { + return new SyntaxView(element, getConfig()); + } + + /** + * Install the View on the given EditorPane. This is called by Swing and + * can be used to do anything you need on the JEditorPane control. Here + * I set some default Actions. + * + * @param editorPane + */ + @Override + public void install(JEditorPane editorPane) { + super.install(editorPane); + // get our font + String fontName = getProperty("DefaultFont"); + Font font = DEFAULT_FONT; + if (fontName != null) { + font = Font.decode(fontName); + } + editorPane.setFont(font); + Configuration conf = getConfig(); + Color caretColor = conf.getColor(CONFIG_CARETCOLOR, Color.BLACK); + editorPane.setCaretColor(caretColor); + Color selectionColor = getConfig().getColor(CONFIG_SELECTION, new Color(0x99ccff)); + editorPane.setSelectionColor(selectionColor); + addActions(editorPane); + addComponents(editorPane); + addPopupMenu(editorPane); + } + + @Override + public void deinstall(JEditorPane editorPane) { + List l = editorComponents.get(editorPane); + for (SyntaxComponent c : editorComponents.get(editorPane)) { + c.deinstall(editorPane); + } + editorComponents.clear(); + editorPane.getInputMap().clear(); + editorPane.getActionMap().clear(); + } + + /** + * Add keyboard actions to this control using the Configuration we have + * This is revised to properly use InputMap and ActionMap of the component + * instead of using the KeyMaps directly. + * @param editorPane + */ + public void addActions(JEditorPane editorPane) { + InputMap imap = new InputMap(); + imap.setParent(editorPane.getInputMap()); + ActionMap amap = new ActionMap(); + amap.setParent(editorPane.getActionMap()); + + for (Configuration.StringKeyMatcher m : getConfig().getKeys(ACTION_KEY_PATTERN)) { + String[] values = Configuration.COMMA_SEPARATOR.split( + m.value); + String actionClass = values[0]; + String actionName = m.group1; + SyntaxAction action = createAction(actionClass); + // The configuration keys will need to be prefixed by Action + // to make it more readable in the Configuration files. + action.config(getConfig(), DefaultSyntaxAction.ACTION_PREFIX + actionName); + // Add the action to the component also + amap.put(actionName, action); + // Now bind all the keys to the Action we have using the InputMap + for (int i = 1; i < values.length; i++) { + String keyStrokeString = values[i].replace("menu ", MENU_MASK_STRING); + KeyStroke ks = KeyStroke.getKeyStroke(keyStrokeString); + // we may have more than onr value ( for key action ), but we will use the + // last one in the single value here. This will display the key in the + // popup menus. Pretty neat. + if (ks == null) { + throw new IllegalArgumentException("Invalid KeyStroke: " + + keyStrokeString); + } + action.putValue(Action.ACCELERATOR_KEY, ks); + imap.put(ks, actionName); + } + } + + // Now configure the Default actions for better display in the popup menu + for (Configuration.StringKeyMatcher m : getConfig().getKeys(DEFAULT_ACTION_PATTERN)) { + String name = m.matcher.group(2); + Action action = editorPane.getActionMap().get(name); + if (action != null) { + configActionProperties(action, name, m.group1); + } + // The below commented block does find the keys for the default Actions + // using InputMap, however there are multiple bound keys for the + // default actions that displaying them in the menu will probably not + // be the most obvious binding + /* + for (KeyStroke key : imap.allKeys()) { + Object o = imap.get(key); + if(name.equals(o)) { + action.putValue(Action.ACCELERATOR_KEY, key); + break; + } + } + */ + } + editorPane.setActionMap(amap); + editorPane.setInputMap(JTextComponent.WHEN_FOCUSED, imap); + } + + private void configActionProperties(Action action, String actionName, String configKey) { + + // if we have an icon, then load it: + String iconLoc = getConfig().getString(configKey + ".SmallIcon", actionName + ".png"); + URL loc = this.getClass().getResource(DefaultSyntaxAction.SMALL_ICONS_LOC_PREFIX + iconLoc); + if (loc != null) { + ImageIcon i = new ImageIcon(loc); + action.putValue(Action.SMALL_ICON, i); + } + // Set the menu text. Use the Action.NAME property, unless it is + // already set. + // The NAME would be set for default actions, and we should not change those names. + // so we will put another property and use it for the menu text + String name = getProperty(configKey + ".MenuText"); + if (action.getValue(Action.NAME) == null) { + action.putValue(Action.NAME, name); + } else { + action.putValue(ACTION_MENU_TEXT, name); + } + // Set the menu tooltips + String shortDesc = getProperty(configKey + ".ToolTip"); + if (shortDesc != null) { + action.putValue(Action.SHORT_DESCRIPTION, shortDesc); + } else { + action.putValue(Action.SHORT_DESCRIPTION, name); + } + } + + private SyntaxAction createAction(String actionClassName) { + SyntaxAction action = null; + try { + Class clazz = Class.forName(actionClassName); + action = (SyntaxAction) clazz.newInstance(); + } catch (InstantiationException ex) { + throw new IllegalArgumentException("Cannot create action class: " + + actionClassName + ". Ensure it has default constructor.", ex); + } catch (IllegalAccessException ex) { + throw new IllegalArgumentException("Cannot create action class: " + + actionClassName, ex); + } catch (ClassNotFoundException ex) { + throw new IllegalArgumentException("Cannot create action class: " + + actionClassName, ex); + } catch (ClassCastException ex) { + throw new IllegalArgumentException("Cannot create action class: " + + actionClassName, ex); + } + return action; + } + + /** + * This is called by Swing to create a Document for the JEditorPane document + * This may be called before you actually get a reference to the control. + * We use it here to create a proper lexer and pass it to the + * SyntaxDcument we return. + * @return + */ + @Override + public Document createDefaultDocument() { + return new SyntaxDocument(lexer); + } + + /** + * This is called to initialize the list of Lexers we have. + * You can call this at initialization, or it will be called when needed. + * The method will also add the appropriate EditorKit classes to the + * corresponding ContentType of the JEditorPane. After this is called, + * you can simply call the editor.setCOntentType("text/java") on the + * control and you will be done. + */ + public synchronized static void initKit() { + // attempt to find a suitable default font + String defaultFont = getConfig(DefaultSyntaxKit.class).getString("DefaultFont"); + if (defaultFont != null) { + DEFAULT_FONT = Font.decode(defaultFont); + } else { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + String[] fonts = ge.getAvailableFontFamilyNames(); + Arrays.sort(fonts); + if (Arrays.binarySearch(fonts, "Courier New") >= 0) { + DEFAULT_FONT = new Font("Courier New", Font.PLAIN, 12); + } else if (Arrays.binarySearch(fonts, "Courier") >= 0) { + DEFAULT_FONT = new Font("Courier", Font.PLAIN, 12); + } else if (Arrays.binarySearch(fonts, "Monospaced") >= 0) { + DEFAULT_FONT = new Font("Monospaced", Font.PLAIN, 13); + } + } + + // read the Default Kits and their associated types + Properties kitsForTypes = JarServiceProvider.readProperties("jsyntaxpane/kitsfortypes"); + for (Map.Entry e : kitsForTypes.entrySet()) { + String type = e.getKey().toString(); + String classname = e.getValue().toString(); + registerContentType(type, classname); + } + initialized = true; + } + + /** + * Register the given content type to use the given class name as its kit + * When this is called, an entry is added into the private HashMap of the + * registered editors kits. This is needed so that the SyntaxPane library + * has it's own registration of all the EditorKits + * @param type + * @param classname + */ + public static void registerContentType(String type, String classname) { + try { + // ensure the class is available and that it does supply a no args + // constructor. This saves debugging later if the classname is incorrect + // or does not behave correctly: + Class c = Class.forName(classname); + // attempt to create the class, if we cannot with an empty argument + // then the class is invalid + Object kit = c.newInstance(); + if (!(kit instanceof EditorKit)) { + throw new IllegalArgumentException("Cannot register class: " + classname + + ". It does not extend EditorKit"); + } + JEditorPane.registerEditorKitForContentType(type, classname); + CONTENT_TYPES.add(type); + } catch (InstantiationException ex) { + throw new IllegalArgumentException("Cannot register class: " + classname + + ". Ensure it has Default Constructor.", ex); + } catch (IllegalAccessException ex) { + throw new IllegalArgumentException("Cannot register class: " + classname, ex); + } catch (ClassNotFoundException ex) { + throw new IllegalArgumentException("Cannot register class: " + classname, ex); + } catch (RuntimeException ex) { + throw new IllegalArgumentException("Cannot register class: " + classname, ex); + } + } + + /** + * Return all the content types supported by this library. This will be the + * content types in the file WEB-INF/services/resources/jsyntaxpane/kitsfortypes + * @return sorted array of all registered content types + */ + public static String[] getContentTypes() { + String[] types = CONTENT_TYPES.toArray(new String[0]); + Arrays.sort(types); + return types; + } + + /** + * Merges the given properties with the configurations for this Object + * + * @param config + */ + public void setConfig(Properties config) { + getConfig().putAll(config); + } + + /** + * Sets the given property to the given value. If the kit is not + * initialized, then calls initKit + * @param key + * @param value + */ + public void setProperty(String key, String value) { + getConfig().put(key, value); + } + + /** + * Return the property with the given key. If the kit is not + * initialized, then calls initKit + * Be careful when changing property as the default property may be used + * @param key + * @return value for given key + */ + public String getProperty(String key) { + return getConfig().getString(key); + } + + /** + * Get the configuration for this Object + * @return + */ + public Configuration getConfig() { + return getConfig(this.getClass()); + } + + /** + * Return the Configurations object for a Kit. Perfrom lazy creation of a + * Configuration object if nothing is created. + * + * @param kit + * @return + */ + public static synchronized Configuration getConfig(Class kit) { + if (CONFIGS == null) { + CONFIGS = new WeakHashMap, Configuration>(); + Configuration defaultConfig = new Configuration(DefaultSyntaxKit.class); + loadConfig(defaultConfig, DefaultSyntaxKit.class); + CONFIGS.put(DefaultSyntaxKit.class, defaultConfig); + } + + if (CONFIGS.containsKey(kit)) { + return CONFIGS.get(kit); + } else { + // recursive call until we read the Super duper DefaultSyntaxKit + Class superKit = kit.getSuperclass(); + @SuppressWarnings("unchecked") + Configuration defaults = getConfig(superKit); + Configuration mine = new Configuration(kit, defaults); + loadConfig(mine, kit); + CONFIGS.put(kit, mine); + return mine; + } + } + + public Map getAbbreviations() { + // if we have not loaded the abbreviations, then load them now: + if (abbrvs == null) { + String cl = this.getClass().getName().replace('.', '/').toLowerCase(); + abbrvs = JarServiceProvider.readStringsMap(cl + "/abbreviations.properties"); + } + return abbrvs; + } + + /** + * Adds an abbrevisation to this kit's abbreviations. + * @param abbr + * @param template + */ + public static void addAbbreviation(String abbr, String template) { + if (abbrvs == null) { + abbrvs = new HashMap(); + } + abbrvs.put(abbr, template); + } + + /** + * Get the template for the given abbreviation + * @param abbr + * @return + */ + public static String getAbbreviation(String abbr) { + return abbrvs == null ? null : abbrvs.get(abbr); + } + + private static void loadConfig(Configuration conf, Class kit) { + String url = kit.getName().replace(".", "/") + "/config"; + Properties p = JarServiceProvider.readProperties(url); + if (p.size() == 0) { + LOG.info("unable to load configuration for: " + kit + " from: " + url + ".properties"); + } else { + conf.putAll(p); + } + } + + @Override + public String getContentType() { + return "text/" + this.getClass().getSimpleName().replace("SyntaxKit", "").toLowerCase(); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/JavaRegexKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/JavaRegexKit.java new file mode 100644 index 000000000..b6a5c6222 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/JavaRegexKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.io.IOException; +import jsyntaxpane.lexers.SimpleRegexLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class JavaRegexKit extends DefaultSyntaxKit { + + public JavaRegexKit() throws IOException { + super(new SimpleRegexLexer("javaRegex.properties")); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Lexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Lexer.java new file mode 100644 index 000000000..8ba399d1a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Lexer.java @@ -0,0 +1,37 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.util.List; +import javax.swing.text.Segment; + +/** + * Lexers must implement these methods. These are used in the Tokenizer + * + * A Lexer should be tied to one document. + * + * @author Ayman Al-Sairafi + */ +public interface Lexer { + /** + * This is the only method a Lexer needs to implement. It will be passed + * a Reader, and it should return non-overlapping Tokens for each recognized token + * in the stream. + * @param segment Text to parse. + * @param ofst offset to add to start of each token (useful for nesting) + * @param tokens List of Tokens to be added. This is done so that the caller creates the + * appropriate List implementation and size. The parse method just adds to the list + */ + public void parse(Segment segment, int ofst, List tokens); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java new file mode 100644 index 000000000..3147e1363 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxDocument.java @@ -0,0 +1,595 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.event.DocumentEvent; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.PlainDocument; +import javax.swing.text.Segment; + +/** + * A document that supports being highlighted. The document maintains an + * internal List of all the Tokens. The Tokens are updated using + * a Lexer, passed to it during construction. + * + * @author Ayman Al-Sairafi + */ +public class SyntaxDocument extends PlainDocument { + + Lexer lexer; + List tokens; + CompoundUndoMan undo; + + public SyntaxDocument(Lexer lexer) { + super(); + putProperty(PlainDocument.tabSizeAttribute, 4); + this.lexer = lexer; + // Listen for undo and redo events + undo = new CompoundUndoMan(this); + } + + /** + * Parse the entire document and return list of tokens that do not already + * exist in the tokens list. There may be overlaps, and replacements, + * which we will cleanup later. + * @return list of tokens that do not exist in the tokens field + */ + private void parse() { + // if we have no lexer, then we must have no tokens... + if (lexer == null) { + tokens = null; + return; + } + List toks = new ArrayList(getLength() / 10); + long ts = System.nanoTime(); + int len = getLength(); + try { + Segment seg = new Segment(); + getText(0, getLength(), seg); + lexer.parse(seg, 0, toks); + } catch (BadLocationException ex) { + log.log(Level.SEVERE, null, ex); + } finally { + if (log.isLoggable(Level.FINEST)) { + log.finest(String.format("Parsed %d in %d ms, giving %d tokens\n", + len, (System.nanoTime() - ts) / 1000000, toks.size())); + } + tokens = toks; + } + } + + @Override + protected void fireChangedUpdate(DocumentEvent e) { + parse(); + super.fireChangedUpdate(e); + } + + @Override + protected void fireInsertUpdate(DocumentEvent e) { + parse(); + super.fireInsertUpdate(e); + } + + @Override + protected void fireRemoveUpdate(DocumentEvent e) { + parse(); + super.fireRemoveUpdate(e); + } + + /** + * Replace the token with the replacement string + * @param token + * @param replacement + */ + public void replaceToken(Token token, String replacement) { + try { + replace(token.start, token.length, replacement, null); + } catch (BadLocationException ex) { + log.log(Level.WARNING, "unable to replace token: " + token, ex); + } + } + + /** + * This class is used to iterate over tokens between two positions + * + */ + class TokenIterator implements ListIterator { + + int start; + int end; + int ndx = 0; + + @SuppressWarnings("unchecked") + private TokenIterator(int start, int end) { + this.start = start; + this.end = end; + if (tokens != null && !tokens.isEmpty()) { + Token token = new Token(TokenType.COMMENT, start, end - start); + ndx = Collections.binarySearch((List) tokens, token); + // we will probably not find the exact token... + if (ndx < 0) { + // so, start from one before the token where we should be... + // -1 to get the location, and another -1 to go back.. + ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); + Token t = tokens.get(ndx); + // if the prev token does not overlap, then advance one + if (t.end() <= start) { + ndx++; + } + + } + } + } + + @Override + public boolean hasNext() { + if (tokens == null) { + return false; + } + if (ndx >= tokens.size()) { + return false; + } + Token t = tokens.get(ndx); + if (t.start >= end) { + return false; + } + return true; + } + + @Override + public Token next() { + return tokens.get(ndx++); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean hasPrevious() { + if (tokens == null) { + return false; + } + if (ndx <= 0) { + return false; + } + Token t = tokens.get(ndx); + if (t.end() <= start) { + return false; + } + return true; + } + + @Override + public Token previous() { + return tokens.get(ndx--); + } + + @Override + public int nextIndex() { + return ndx + 1; + } + + @Override + public int previousIndex() { + return ndx - 1; + } + + @Override + public void set(Token e) { + throw new UnsupportedOperationException(); + } + + @Override + public void add(Token e) { + throw new UnsupportedOperationException(); + } + } + + /** + * Return an iterator of tokens between p0 and p1. + * @param start start position for getting tokens + * @param end position for last token + * @return Iterator for tokens that overal with range from start to end + */ + public Iterator getTokens(int start, int end) { + return new TokenIterator(start, end); + } + + /** + * Find the token at a given position. May return null if no token is + * found (whitespace skipped) or if the position is out of range: + * @param pos + * @return + */ + public Token getTokenAt(int pos) { + if (tokens == null || tokens.isEmpty() || pos > getLength()) { + return null; + } + Token tok = null; + Token tKey = new Token(TokenType.DEFAULT, pos, 1); + @SuppressWarnings("unchecked") + int ndx = Collections.binarySearch((List) tokens, tKey); + if (ndx < 0) { + // so, start from one before the token where we should be... + // -1 to get the location, and another -1 to go back.. + ndx = (-ndx - 1 - 1 < 0) ? 0 : (-ndx - 1 - 1); + Token t = tokens.get(ndx); + if ((t.start <= pos) && (pos <= t.end())) { + tok = t; + } + } else { + tok = tokens.get(ndx); + } + return tok; + } + + public Token getWordAt(int offs, Pattern p) { + Token word = null; + try { + Element line = getParagraphElement(offs); + if (line == null) { + return word; + } + int lineStart = line.getStartOffset(); + int lineEnd = Math.min(line.getEndOffset(), getLength()); + Segment seg = new Segment(); + getText(lineStart, lineEnd - lineStart, seg); + if (seg.count > 0) { + // we need to get the word using the words pattern p + Matcher m = p.matcher(seg); + int o = offs - lineStart; + while (m.find()) { + if (m.start() <= o && o <= m.end()) { + word = new Token(TokenType.DEFAULT, m.start() + lineStart, m.end() - m.start()); + break; + } + } + } + } catch (BadLocationException ex) { + Logger.getLogger(SyntaxDocument.class.getName()).log(Level.SEVERE, null, ex); + } finally { + return word; + } + } + + /** + * Return the token following the current token, or null + * This is an expensive operation, so do not use it to update the gui + * @param tok + * @return + */ + public Token getNextToken(Token tok) { + int n = tokens.indexOf(tok); + if ((n >= 0) && (n < (tokens.size() - 1))) { + return tokens.get(n + 1); + } else { + return null; + } + } + + /** + * Return the token prior to the given token, or null + * This is an expensive operation, so do not use it to update the gui + * @param tok + * @return + */ + public Token getPrevToken(Token tok) { + int n = tokens.indexOf(tok); + if ((n > 0) && (!tokens.isEmpty())) { + return tokens.get(n - 1); + } else { + return null; + } + } + + /** + * This is used to return the other part of a paired token in the document. + * A paired part has token.pairValue <> 0, and the paired token will + * have the negative of t.pairValue. + * This method properly handles nestings of same pairValues, but overlaps + * are not checked. + * if The document does not contain a paired token, then null is returned. + * @param t + * @return the other pair's token, or null if nothing is found. + */ + public Token getPairFor(Token t) { + if (t == null || t.pairValue == 0) { + return null; + } + Token p = null; + int ndx = tokens.indexOf(t); + // w will be similar to a stack. The openners weght is added to it + // and the closers are subtracted from it (closers are already negative) + int w = t.pairValue; + int direction = (t.pairValue > 0) ? 1 : -1; + boolean done = false; + int v = Math.abs(t.pairValue); + while (!done) { + ndx += direction; + if (ndx < 0 || ndx >= tokens.size()) { + break; + } + Token current = tokens.get(ndx); + if (Math.abs(current.pairValue) == v) { + w += current.pairValue; + if (w == 0) { + p = current; + done = true; + } + } + } + + return p; + } + + /** + * Perform an undo action, if possible + */ + public void doUndo() { + if (undo.canUndo()) { + undo.undo(); + parse(); + } + } + + /** + * Perform a redo action, if possible. + */ + public void doRedo() { + if (undo.canRedo()) { + undo.redo(); + parse(); + } + } + + /** + * Return a matcher that matches the given pattern on the entire document + * @param pattern + * @return matcher object + */ + public Matcher getMatcher(Pattern pattern) { + return getMatcher(pattern, 0, getLength()); + } + + /** + * Return a matcher that matches the given pattern in the part of the + * document starting at offset start. Note that the matcher will have + * offset starting from start + * + * @param pattern + * @param start + * @return matcher that MUST be offset by start to get the proper + * location within the document + */ + public Matcher getMatcher(Pattern pattern, int start) { + return getMatcher(pattern, start, getLength() - start); + } + + /** + * Return a matcher that matches the given pattern in the part of the + * document starting at offset start and ending at start + length. + * Note that the matcher will have + * offset starting from start + * + * @param pattern + * @param start + * @param length + * @return matcher that MUST be offset by start to get the proper + * location within the document + */ + public Matcher getMatcher(Pattern pattern, int start, int length) { + Matcher matcher = null; + if (getLength() == 0) { + return null; + } + if (start >= getLength()) { + return null; + } + try { + if (start < 0) { + start = 0; + } + if (start + length > getLength()) { + length = getLength() - start; + } + Segment seg = new Segment(); + getText(start, length, seg); + matcher = pattern.matcher(seg); + } catch (BadLocationException ex) { + log.log(Level.SEVERE, "Requested offset: " + ex.offsetRequested(), ex); + } + return matcher; + } + + /** + * This will discard all undoable edits + */ + public void clearUndos() { + undo.discardAllEdits(); + } + + /** + * Gets the line at given position. The line returned will NOT include + * the line terminator '\n' + * @param pos Position (usually from text.getCaretPosition() + * @return the STring of text at given position + * @throws BadLocationException + */ + public String getLineAt(int pos) throws BadLocationException { + Element e = getParagraphElement(pos); + Segment seg = new Segment(); + getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset(), seg); + char last = seg.last(); + if (last == '\n' || last == '\r') { + seg.count--; + } + return seg.toString(); + } + + /** + * Deletes the line at given position + * @param pos + * @throws javax.swing.text.BadLocationException + */ + public void removeLineAt(int pos) + throws BadLocationException { + Element e = getParagraphElement(pos); + remove(e.getStartOffset(), getElementLength(e)); + } + + /** + * Replace the line at given position with the given string, which can span + * multiple lines + * @param pos + * @param newLines + * @throws javax.swing.text.BadLocationException + */ + public void replaceLineAt(int pos, String newLines) + throws BadLocationException { + Element e = getParagraphElement(pos); + replace(e.getStartOffset(), getElementLength(e), newLines, null); + } + + /** + * Helper method to get the length of an element and avoid getting + * a too long element at the end of the document + * @param e + * @return + */ + private int getElementLength(Element e) { + int end = e.getEndOffset(); + if (end >= (getLength() - 1)) { + end--; + } + return end - e.getStartOffset(); + } + + /** + * Gets the text without the comments. For example for the string + * { // it's a comment this method will return "{ ". + * @param aStart start of the text. + * @param anEnd end of the text. + * @return String for the line without comments (if exists). + */ + public synchronized String getUncommentedText(int aStart, int anEnd) { + readLock(); + StringBuilder result = new StringBuilder(); + Iterator iter = getTokens(aStart, anEnd); + while (iter.hasNext()) { + Token t = iter.next(); + if (!TokenType.isComment(t)) { + result.append(t.getText(this)); + } + } + readUnlock(); + return result.toString(); + } + + /** + * Returns the starting position of the line at pos + * @param pos + * @return starting position of the line + */ + public int getLineStartOffset(int pos) { + return getParagraphElement(pos).getStartOffset(); + } + + /** + * Returns the end position of the line at pos. + * Does a bounds check to ensure the returned value does not exceed + * document length + * @param pos + * @return + */ + public int getLineEndOffset(int pos) { + int end = 0; + end = getParagraphElement(pos).getEndOffset(); + if (end >= getLength()) { + end = getLength(); + } + return end; + } + + /** + * Return the number of lines in this document + * @return + */ + public int getLineCount() { + Element e = getDefaultRootElement(); + int cnt = e.getElementCount(); + return cnt; + } + + /** + * Return the line number at given position. The line numbers are zero based + * @param pos + * @return + */ + public int getLineNumberAt(int pos) { + int lineNr = getDefaultRootElement().getElementIndex(pos); + return lineNr; + } + + @Override + public String toString() { + return "SyntaxDocument(" + lexer + ", " + ((tokens == null) ? 0 : tokens.size()) + " tokens)@" + + hashCode(); + } + + /** + * We override this here so that the replace is treated as one operation + * by the undomanager + * @param offset + * @param length + * @param text + * @param attrs + * @throws BadLocationException + */ + @Override + public void replace(int offset, int length, String text, AttributeSet attrs) throws BadLocationException { + remove(offset, length); + undo.startCombine(); + insertString(offset, text, attrs); + } + + /** + * Append the given string to the text of this document. + * @param str + * @return this document + */ + public SyntaxDocument append(String str) { + try { + insertString(getLength(), str, null); + } catch (BadLocationException ex) { + log.log(Level.WARNING, "Error appending str", ex); + } + return this; + } + +// our logger instance... + private static final Logger log = Logger.getLogger(SyntaxDocument.class.getName()); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyle.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyle.java new file mode 100644 index 000000000..fd39c87c1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyle.java @@ -0,0 +1,137 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import javax.swing.text.Segment; +import javax.swing.text.TabExpander; +import javax.swing.text.Utilities; + +/** + * This class represents the Style for a TokenType. This class is responsible + * for actually drawing a Token on the View. + * + * @author Ayman Al-Sairafi + */ +public final class SyntaxStyle { + + private Color color; + private int fontStyle; + + public SyntaxStyle() { + super(); + } + + public SyntaxStyle(Color color, boolean bold, boolean italic) { + super(); + this.color = color; + setBold(bold); + setItalic(italic); + } + + public SyntaxStyle(Color color, int fontStyle) { + super(); + this.color = color; + this.fontStyle = fontStyle; + } + + public SyntaxStyle(String str) { + String[] parts = str.split("\\s*,\\s*"); + if (parts.length != 2) { + throw new IllegalArgumentException("style not correct format: " + str); + } + this.color = new Color(Integer.decode(parts[0])); + this.fontStyle = Integer.decode(parts[1]); + } + + public boolean isBold() { + return (fontStyle & Font.BOLD) != 0; + } + + public void setBold(Boolean bold) { + if (bold) { + fontStyle |= Font.BOLD; + } else { + int mask = -1 ^ Font.BOLD; + fontStyle = (fontStyle & (mask)); + } + } + + public String getColorString() { + return String.format("0x%06x", color.getRGB() & 0x00ffffff); + } + + public void setColorString(String color) { + this.color = Color.decode(color); + } + + public Boolean isItalic() { + return (fontStyle & Font.ITALIC) != 0; + } + + public void setItalic(Boolean italic) { + if (italic) { + fontStyle |= Font.ITALIC; + } else { + fontStyle = (fontStyle & (-1 ^ Font.ITALIC)); + } + } + + public int getFontStyle() { + return fontStyle; + } + + public Color getColor() { + return color; + } + + /** + * Draw text. This can directly call the Utilities.drawTabbedText. + * Sub-classes can override this method to provide any other decorations. + * @param segment - the source of the text + * @param x - the X origin >= 0 + * @param y - the Y origin >= 0 + * @param graphics - the graphics context + * @param e - how to expand the tabs. If this value is null, tabs will be + * expanded as a space character. + * @param startOffset - starting offset of the text in the document >= 0 + * @return + */ + public int drawText(Segment segment, int x, int y, + Graphics graphics, TabExpander e, int startOffset) { + graphics.setFont(graphics.getFont().deriveFont(getFontStyle())); + FontMetrics fontMetrics = graphics.getFontMetrics(); + int a = fontMetrics.getAscent(); + int h = a + fontMetrics.getDescent(); + int w = Utilities.getTabbedTextWidth(segment, fontMetrics, 0, e, startOffset); + int rX = x - 1; + int rY = y - a; + int rW = w + 2; + int rH = h; + if ((getFontStyle() & 0x10) != 0) { + graphics.setColor(Color.decode("#EEEEEE")); + graphics.fillRect(rX, rY, rW, rH); + } + graphics.setColor(getColor()); + x = Utilities.drawTabbedText(segment, x, y, graphics, e, startOffset); + if ((getFontStyle() & 0x8) != 0) { + graphics.setColor(Color.RED); + graphics.drawRect(rX, rY, rW, rH); + } + return x; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyles.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyles.java new file mode 100644 index 000000000..7ff3783c5 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxStyles.java @@ -0,0 +1,143 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Logger; +import java.util.regex.Pattern; +import javax.swing.text.Segment; +import javax.swing.text.TabExpander; +import jsyntaxpane.util.Configuration; +import jsyntaxpane.util.JarServiceProvider; + +/** + * The Styles to use for each TokenType. The defaults are created here, and + * then the resource META-INF/services/syntaxstyles.properties is read and + * merged. You can also pass a properties instance and merge your prefered + * styles into the default styles. + * + * Text is drawn by forwarding the drawText request to the SyntaxStyle for the + * that matches the given TokenType + * + * @author Ayman Al-Sairafi + */ +public class SyntaxStyles { + + public static final Pattern STYLE_PATTERN = Pattern.compile("Style\\.(\\w+)"); + + /** + * You can call the mergeStyles method with a Properties file to customize + * the existing styles. Any existing styles will be overwritten by the + * styles you provide. + * @param styles + */ + public void mergeStyles(Properties styles) { + for (Map.Entry e : styles.entrySet()) { + String tokenType = e.getKey().toString(); + String style = e.getValue().toString(); + try { + TokenType tt = TokenType.valueOf(tokenType); + SyntaxStyle tokenStyle = new SyntaxStyle(style); + put(tt, tokenStyle); + } catch (IllegalArgumentException ex) { + LOG.warning("illegal token type or style for: " + tokenType); + } + } + } + Map styles; + private static SyntaxStyles instance = createInstance(); + private static final Logger LOG = Logger.getLogger(SyntaxStyles.class.getName()); + private static SyntaxStyle DEFAULT_STYLE = new SyntaxStyle(Color.BLACK, Font.PLAIN); + + private SyntaxStyles() { + } + + /** + * Create default styles + * @return + */ + private static SyntaxStyles createInstance() { + SyntaxStyles syntaxstyles = new SyntaxStyles(); + Properties styles = JarServiceProvider.readProperties(SyntaxStyles.class); + syntaxstyles.mergeStyles(styles); + return syntaxstyles; + } + + /** + * Returns the Default Singleton + * @return + */ + public static SyntaxStyles getInstance() { + return instance; + } + + public static SyntaxStyles read(Configuration config) { + SyntaxStyles ss = createInstance(); + // Configuration styleConf = config.subConfig(STYLE_PROPERTY_KEY); + + for (Configuration.StringKeyMatcher m : config.getKeys(STYLE_PATTERN)) { + String type = m.group1; + try { + ss.put(TokenType.valueOf(type), new SyntaxStyle(m.value)); + } catch (IllegalArgumentException e) { + Logger.getLogger(SyntaxStyles.class.getName()).warning( + String.format("Invalid Token Type [%s] for Style of ", type)); + } + } + return ss; + } + + public void put(TokenType type, SyntaxStyle style) { + if (styles == null) { + styles = new HashMap(); + } + styles.put(type, style); + } + + /** + * Return the style for the given TokenType + * @param type + * @return + */ + public SyntaxStyle getStyle(TokenType type) { + if (styles != null && styles.containsKey(type)) { + return styles.get(type); + } else { + return DEFAULT_STYLE; + } + } + + /** + * Draw the given Token. This will simply find the proper SyntaxStyle for + * the TokenType and then asks the proper Style to draw the text of the + * Token. + * @param segment + * @param x + * @param y + * @param graphics + * @param e + * @param token + * @return + */ + public int drawText(Segment segment, int x, int y, + Graphics graphics, TabExpander e, Token token) { + SyntaxStyle s = getStyle(token.type); + return s.drawText(segment, x, y, graphics, e, token.start); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.form new file mode 100644 index 000000000..c15a029b7 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.form @@ -0,0 +1,119 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.java new file mode 100644 index 000000000..6bafe8224 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxTester.java @@ -0,0 +1,199 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.actions.CaretMonitor; + +import javax.swing.*; +import javax.swing.text.EditorKit; +import java.awt.event.ItemEvent; +import java.io.IOException; +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class SyntaxTester extends javax.swing.JFrame { + + /** + * Creates new form Tester + */ + public SyntaxTester() { + // this is a test for adding regex lexer. It wont work unless the + // JavaRegex.properties is found in the classpath + //DefaultSyntaxKit.registerContentType("text/flasm", "jsyntaxpane.syntaxkits.Flasm3SyntaxKit"); + initComponents(); + jCmbLangs.setModel(new DefaultComboBoxModel(DefaultSyntaxKit.getContentTypes())); + // jEdtTest.setContentType(jCmbLangs.getItemAt(0).toString()); + jCmbLangs.setSelectedItem("text/java"); + new CaretMonitor(jEdtTest, lblCaretPos); + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + lblCaretPos = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + jEdtTest = new javax.swing.JEditorPane(); + lblToken = new javax.swing.JLabel(); + jCmbLangs = new javax.swing.JComboBox(); + jToolBar1 = new javax.swing.JToolBar(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("JSyntaxPane Tester"); + + lblCaretPos.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + lblCaretPos.setText("Caret Position"); + + jEdtTest.setContentType(""); + jEdtTest.setFont(new java.awt.Font("Monospaced", 0, 13)); // NOI18N + jEdtTest.setCaretColor(new java.awt.Color(153, 204, 255)); + jEdtTest.addCaretListener(new javax.swing.event.CaretListener() { + public void caretUpdate(javax.swing.event.CaretEvent evt) { + jEdtTestCaretUpdate(evt); + } + }); + jScrollPane1.setViewportView(jEdtTest); + + lblToken.setFont(new java.awt.Font("Courier New", 0, 12)); + lblToken.setText("Token under cursor"); + + jCmbLangs.setMaximumRowCount(20); + jCmbLangs.setFocusable(false); + jCmbLangs.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCmbLangsItemStateChanged(evt); + } + }); + + jToolBar1.setRollover(true); + jToolBar1.setFocusable(false); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addComponent(jCmbLangs, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 441, Short.MAX_VALUE) + .addComponent(lblCaretPos, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(lblToken, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) + .addGap(484, 484, 484)) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 715, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 715, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 382, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblToken, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblCaretPos, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE) + .addComponent(jCmbLangs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jEdtTestCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_jEdtTestCaretUpdate + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(jEdtTest); + if (sDoc != null) { + Token t = sDoc.getTokenAt(evt.getDot()); + if (t != null) { + CharSequence tData = t.getText(sDoc); + if (t.length > 40) { + tData = tData.subSequence(0, 40); + } + lblToken.setText(t.toString() + ": " + tData); + } else { + // null token, remove the status + lblToken.setText("NO Token at cursor"); + } + } + + }//GEN-LAST:event_jEdtTestCaretUpdate + + private void jCmbLangsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCmbLangsItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + String lang = jCmbLangs.getSelectedItem().toString(); + + // save the state of the current JEditorPane, as it's Document is about + // to be replaced. + String oldText = jEdtTest.getText(); + + // install a new DefaultSyntaxKit on the JEditorPane for the requested language. + jEdtTest.setContentType(lang); + // Recreate the Toolbar + jToolBar1.removeAll(); + EditorKit kit = jEdtTest.getEditorKit(); + if (kit instanceof DefaultSyntaxKit) { + DefaultSyntaxKit defaultSyntaxKit = (DefaultSyntaxKit) kit; + defaultSyntaxKit.addToolBarActions(jEdtTest, jToolBar1); + } + jToolBar1.validate(); + try { + // setText should not be called (read the JavaDocs). Better use the read + // method and create a new document. + jEdtTest.read(new StringReader(oldText), lang); + } catch (IOException ex) { + Logger.getLogger(SyntaxTester.class.getName()).log(Level.SEVERE, null, ex); + } + } + jEdtTest.requestFocusInWindow(); + }//GEN-LAST:event_jCmbLangsItemStateChanged + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + try { + DefaultSyntaxKit.initKit(); + new SyntaxTester().setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + System.exit(2); + } + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox jCmbLangs; + private javax.swing.JEditorPane jEdtTest; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JToolBar jToolBar1; + private javax.swing.JLabel lblCaretPos; + private javax.swing.JLabel lblToken; + // End of variables declaration//GEN-END:variables +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxView.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxView.java new file mode 100644 index 000000000..dd1140591 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxView.java @@ -0,0 +1,173 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Toolkit; +import java.util.Iterator; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.PlainView; +import javax.swing.text.Segment; +import javax.swing.text.ViewFactory; +import jsyntaxpane.util.Configuration; + +public class SyntaxView extends PlainView { + + public static final String PROPERTY_RIGHT_MARGIN_COLOR = "RightMarginColor"; + public static final String PROPERTY_RIGHT_MARGIN_COLUMN = "RightMarginColumn"; + public static final String PROPERTY_SINGLE_COLOR_SELECT = "SingleColorSelect"; + private static final Logger log = Logger.getLogger(SyntaxView.class.getName()); + private SyntaxStyle DEFAULT_STYLE = SyntaxStyles.getInstance().getStyle(TokenType.DEFAULT); + private final boolean singleColorSelect; + private final int rightMarginColumn; + private final Color rightMarginColor; + private final SyntaxStyles styles; + + /** + * Construct a new view using the given configuration and prefix given + * + * @param element + * @param config + */ + public SyntaxView(Element element, Configuration config) { + super(element); + singleColorSelect = config.getBoolean(PROPERTY_SINGLE_COLOR_SELECT, false); + rightMarginColor = new Color(config.getInteger(PROPERTY_RIGHT_MARGIN_COLOR, + 0xFF7777)); + rightMarginColumn = config.getInteger(PROPERTY_RIGHT_MARGIN_COLUMN, + 0); + styles = SyntaxStyles.read(config); + } + + @Override + protected int drawUnselectedText(Graphics graphics, int x, int y, int p0, + int p1) { + setRenderingHits((Graphics2D) graphics); + Font saveFont = graphics.getFont(); + Color saveColor = graphics.getColor(); + SyntaxDocument doc = (SyntaxDocument) getDocument(); + Segment segment = getLineBuffer(); + // Draw the right margin first, if needed. This way the text overalys + // the margin + if (rightMarginColumn > 0) { + int m_x = rightMarginColumn * graphics.getFontMetrics().charWidth('m'); + int h = graphics.getFontMetrics().getHeight(); + graphics.setColor(rightMarginColor); + graphics.drawLine(m_x, y, m_x, y - h); + } + try { + // Colour the parts + Iterator i = doc.getTokens(p0, p1); + int start = p0; + while (i.hasNext()) { + Token t = i.next(); + // if there is a gap between the next token start and where we + // should be starting (spaces not returned in tokens), then draw + // it in the default type + if (start < t.start) { + doc.getText(start, t.start - start, segment); + x = DEFAULT_STYLE.drawText(segment, x, y, graphics, this, start); + } + // t and s are the actual start and length of what we should + // put on the screen. assume these are the whole token.... + int l = t.length; + int s = t.start; + // ... unless the token starts before p0: + if (s < p0) { + // token is before what is requested. adgust the length and s + l -= (p0 - s); + s = p0; + } + // if token end (s + l is still the token end pos) is greater + // than p1, then just put up to p1 + if (s + l > p1) { + l = p1 - s; + } + doc.getText(s, l, segment); + x = styles.drawText(segment, x, y, graphics, this, t); + start = t.end(); + } + // now for any remaining text not tokenized: + if (start < p1) { + doc.getText(start, p1 - start, segment); + x = DEFAULT_STYLE.drawText(segment, x, y, graphics, this, start); + } + } catch (BadLocationException ex) { + log.log(Level.SEVERE, "Requested: " + ex.offsetRequested(), ex); + } finally { + graphics.setFont(saveFont); + graphics.setColor(saveColor); + } + return x; + } + + @Override + protected int drawSelectedText(Graphics graphics, int x, int y, int p0, int p1) + throws BadLocationException { + if (singleColorSelect) { + if (rightMarginColumn > 0) { + int m_x = rightMarginColumn * graphics.getFontMetrics().charWidth('m'); + int h = graphics.getFontMetrics().getHeight(); + graphics.setColor(rightMarginColor); + graphics.drawLine(m_x, y, m_x, y - h); + } + return super.drawUnselectedText(graphics, x, y, p0, p1); + } else { + return drawUnselectedText(graphics, x, y, p0, p1); + } + } + + /** + * Sets the Rendering Hints o nthe Graphics. This is used so that + * any painters can set the Rendering Hits to match the view. + * @param g2d + */ + public static void setRenderingHits(Graphics2D g2d) { + g2d.addRenderingHints(sysHints); + } + + @Override + protected void updateDamage(javax.swing.event.DocumentEvent changes, + Shape a, + ViewFactory f) { + super.updateDamage(changes, a, f); + java.awt.Component host = getContainer(); + host.repaint(); + } + /** + * The values for the string key for Text Anti-Aliasing + */ + private static RenderingHints sysHints; + + static { + sysHints = null; + try { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + @SuppressWarnings("unchecked") + Map map = (Map) + toolkit.getDesktopProperty("awt.font.desktophints"); + sysHints = new RenderingHints(map); + } catch (Throwable t) { + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Token.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Token.java new file mode 100644 index 000000000..0689d697a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/Token.java @@ -0,0 +1,155 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.io.Serializable; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.Segment; + +/** + * A Token in a Document. Tokens do NOT store a reference to the + * underlying SyntaxDocument, and must generally be obtained from + * the SyntaxDocument methods. The reason for not storing the + * SyntaxDocument is simply for memory, as the number of Tokens + * per document can be large, you may end up with twice the memory + * in a SyntaxDocument with Tokens than a simple PlainDocument. + * + * @author Ayman Al-Sairafi + */ +public class Token implements Serializable, Comparable { + + public final TokenType type; + public final int start; + public final int length; + /** + * the pair value to use if this token is one of a pair: + * This is how it is used: + * The openning part will have a positive number X + * The closing part will have a negative number X + * X should be unique for a pair: + * e.g. for [ pairValue = +1 + * for ] pairValue = -1 + */ + public final byte pairValue; + /** + * The kind of the Document. This is only needed if proper Parsing + * of a document is needed and it makes certain operations faster. + * You can use any of the supplied Generic Values, or create your + * language specific uses by using USER_FIRST + x; + */ + public final short kind = 0; + + /** + * Constructs a new token + * @param type + * @param start + * @param length + */ + public Token(TokenType type, int start, int length) { + this.type = type; + this.start = start; + this.length = length; + this.pairValue = 0; + } + + /** + * Construct a new part of pair token + * @param type + * @param start + * @param length + * @param pairValue + */ + public Token(TokenType type, int start, int length, byte pairValue) { + this.type = type; + this.start = start; + this.length = length; + this.pairValue = pairValue; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Object) { + Token token = (Token) obj; + return ((this.start == token.start) && + (this.length == token.length) && + (this.type.equals(token.type))); + } else { + return false; + } + } + + @Override + public int hashCode() { + return start; + } + + @Override + public String toString() { + if (pairValue == 0) { + return String.format("%s (%d, %d)", type, start, length); + } else { + return String.format("%s (%d, %d) (%d)", type, start, length, pairValue); + } + } + + @Override + public int compareTo(Object o) { + Token t = (Token) o; + if (this.start != t.start) { + return (this.start - t.start); + } else if (this.length != t.length) { + return (this.length - t.length); + } else { + return this.type.compareTo(t.type); + } + } + + /** + * return the end position of the token. + * @return start + length + */ + public int end() { + return start + length; + } + + /** + * Get the text of the token from this document + * @param doc + * @return + */ + public CharSequence getText(Document doc) { + Segment text = new Segment(); + try { + doc.getText(start, length, text); + } catch (BadLocationException ex) { + Logger.getLogger(Token.class.getName()).log(Level.SEVERE, null, ex); + } finally { + return text; + } + } + + public String getString(Document doc) { + String result = ""; + try { + result = doc.getText(start, length); + } catch (BadLocationException ex) { + Logger.getLogger(Token.class.getName()).log(Level.SEVERE, null, ex); + } finally { + return result; + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenComparators.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenComparators.java new file mode 100644 index 000000000..f53593680 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenComparators.java @@ -0,0 +1,55 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +import java.io.Serializable; +import java.util.Comparator; + +/** + * Two comparators to compare Tokens. + * @author Ayman Al-Sairafi + */ +public class TokenComparators { + + public static final Comparator LONGEST_FIRST = new LongestFirst(); + public static final Comparator SHORTEST_FIRST = new ShortestFirst(); + + private static class LongestFirst implements Comparator, Serializable { + + @Override + public int compare(Token t1, Token t2) { + if (t1.start != t2.start) { + return (t1.start - t2.start); + } else if (t1.length != t2.length) { + return (t2.length - t1.length); + } else { + return t1.type.compareTo(t2.type); + } + } + } + + private static class ShortestFirst implements Comparator, Serializable { + + @Override + public int compare(Token t1, Token t2) { + if (t1.start != t2.start) { + return (t1.start - t2.start); + } else if (t1.length != t2.length) { + return (t1.length - t2.length); + } else { + return t1.type.compareTo(t2.type); + } + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenConstants.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenConstants.java new file mode 100644 index 000000000..9eddc44a4 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenConstants.java @@ -0,0 +1,124 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane; + +/** + * Constants used by Tokens. + * @author Ayman Al-Sairafi + */ +public class TokenConstants { + /** + * Token Kinds + */ + // Operators and separators - Suitable for Java Type Languages + public static final short EQ = 1; // = + public static final short GT = 2; // > + public static final short LT = 3; // < + public static final short NOT = 4; // ! + public static final short COMP = 5; // ~ + public static final short QUESTION = 6; // ? + public static final short COLON = 7; // : + public static final short EQEQ = 8; // == + public static final short LTEQ = 9; // <= + public static final short GTEQ = 10; // >= + public static final short NOTEQ = 11; // != + public static final short ANDAND = 12; // && + public static final short OROR = 13; // || + public static final short PLUSPLUS = 14; // ++ + public static final short MINUSMINUS = 15; // -- + public static final short PLUS = 16; // + + public static final short MINUS = 17; // - + public static final short MULT = 18; // * + public static final short DIV = 19; // / + public static final short AND = 20; // & + public static final short OR = 21; // | + public static final short XOR = 22; // ^ + public static final short MOD = 23; // % + public static final short LSHIFT = 24; // << + public static final short RSHIFT = 25; // >> + public static final short URSHIFT = 26; // >>> + public static final short PLUSEQ = 27; // += + public static final short MINUSEQ = 28; // -= + public static final short MULTEQ = 29; // *= + public static final short DIVEQ = 30; // /= + public static final short ANDEQ = 31; // &= + public static final short OREQ = 32; // |= + public static final short XOREQ = 33; // ^= + public static final short MODEQ = 34; // %= + public static final short LSHIFTEQ = 35; // <<= + public static final short RSHIFTEQ = 36; // >>= + public static final short URSHIFTEQ = 37; // >>>= + public static final short LPAREN = 38; // ( + public static final short RPAREN = 39; // ) + public static final short LBRACE = 40; // { + public static final short RBRACE = 41; // } + public static final short LBRACK = 42; // [ + public static final short RBRACK = 43; // ] + public static final short SEMICOLON = 44; // ; + public static final short COMMA = 46; // , + public static final short DOT = 47; // . + + // Keywords for Java Type Languages + public static final short KW_START = 255; + public static final short KW_abstract = KW_START + 0; + public static final short KW_assert = KW_START + 1; + public static final short KW_boolean = KW_START + 2; + public static final short KW_break = KW_START + 3; + public static final short KW_byte = KW_START + 4; + public static final short KW_case = KW_START + 5; + public static final short KW_catch = KW_START + 6; + public static final short KW_char = KW_START + 7; + public static final short KW_class = KW_START + 8; + public static final short KW_const = KW_START + 9; + public static final short KW_continue = KW_START + 10; + public static final short KW_do = KW_START + 11; + public static final short KW_double = KW_START + 12; + public static final short KW_else = KW_START + 13; + public static final short KW_extends = KW_START + 14; + public static final short KW_final = KW_START + 15; + public static final short KW_finally = KW_START + 16; + public static final short KW_float = KW_START + 17; + public static final short KW_for = KW_START + 18; + public static final short KW_default = KW_START + 19; + public static final short KW_implements = KW_START + 20; + public static final short KW_import = KW_START + 21; + public static final short KW_instanceof = KW_START + 22; + public static final short KW_int = KW_START + 23; + public static final short KW_interface = KW_START + 24; + public static final short KW_long = KW_START + 25; + public static final short KW_native = KW_START + 26; + public static final short KW_new = KW_START + 27; + public static final short KW_goto = KW_START + 28; + public static final short KW_if = KW_START + 29; + public static final short KW_public = KW_START + 30; + public static final short KW_short = KW_START + 31; + public static final short KW_super = KW_START + 32; + public static final short KW_switch = KW_START + 33; + public static final short KW_synchronized = KW_START + 34; + public static final short KW_package = KW_START + 35; + public static final short KW_private = KW_START + 36; + public static final short KW_protected = KW_START + 37; + public static final short KW_transient = KW_START + 38; + public static final short KW_return = KW_START + 39; + public static final short KW_void = KW_START + 40; + public static final short KW_static = KW_START + 41; + public static final short KW_while = KW_START + 42; + public static final short KW_this = KW_START + 43; + public static final short KW_throw = KW_START + 44; + public static final short KW_throws = KW_START + 45; + public static final short KW_try = KW_START + 46; + public static final short KW_volatile = KW_START + 47; + public static final short KW_strictfp = KW_START + 48; +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenType.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenType.java new file mode 100644 index 000000000..ff497d73c --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/TokenType.java @@ -0,0 +1,81 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane; + +/** + * These are the various token types supported by JSyntaxPane. + * + * @author ayman + */ +public enum TokenType { + + OPERATOR, // Language operators + DELIMITER, // Delimiters. Constructs that are not necessarily operators for a language + KEYWORD, // language reserved keywords + KEYWORD2, // Other language reserved keywords, like C #defines + IDENTIFIER, // identifiers, variable names, class names + NUMBER, // numbers in various formats + STRING, // String + STRING2, // For highlighting meta chars within a String + COMMENT, // comments + COMMENT2, // special stuff within comments + REGEX, // regular expressions + REGEX2, // special chars within regular expressions + TYPE, // Types, usually not keywords, but supported by the language + TYPE2, // Types from standard libraries + TYPE3, // Types for users + DEFAULT, // any other text + WARNING, // Text that should be highlighted as a warning + ERROR; // Text that signals an error + + /** + * Tests if the given token is a Comment Token. + * @param t + * @return + */ + public static boolean isComment(Token t) { + if (t != null && (t.type == COMMENT || t.type == COMMENT2)) { + return true; + } else { + return false; + } + } + + /** + * Tests if the given token is a Keyword Token. + * @param t + * @return + */ + public static boolean isKeyword(Token t) { + if (t != null && (t.type == KEYWORD || t.type == KEYWORD2)) { + return true; + } else { + return false; + } + } + + + /** + * Tests if the given token is a String Token. + * @param t + * @return + */ + public static boolean isString(Token t) { + if (t != null && (t.type == STRING || t.type == STRING2)) { + return true; + } else { + return false; + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ActionUtils.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ActionUtils.java new file mode 100644 index 000000000..97188ceab --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ActionUtils.java @@ -0,0 +1,623 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.Component; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.KeyEvent; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.Action; +import javax.swing.JComboBox; +import javax.swing.JEditorPane; +import javax.swing.MutableComboBoxModel; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.EditorKit; +import javax.swing.text.Element; +import javax.swing.text.JTextComponent; +import javax.swing.text.PlainDocument; +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +/** + * Various utility methods to work on JEditorPane and its SyntaxDocument + * for use by Actions + * + * @author Ayman Al-Sairafi + */ +public class ActionUtils { + + private ActionUtils() { + } + + private static ActionUtils instance = null; + + /** + * Get the Singleton instance. Will be created lazily. + * @return + */ + public static synchronized ActionUtils getInstance() { + if(instance == null) { + instance = new ActionUtils(); + } + return instance; + } + + /** + * Get the indentation of a line of text. This is the subString from + * beginning of line to the first non-space char + * @param line the line of text + * @return indentation of line. + */ + public static String getIndent(String line) { + if (line == null || line.length() == 0) { + return ""; + } + int i = 0; + while (i < line.length() && line.charAt(i) == ' ') { + i++; + } + return line.substring(0, i); + } + + /** + * Return the lines that span the selection (split as an array of Strings) + * if there is no selection then current line is returned. + * + * Note that the strings returned will not contain the terminating line feeds + * If the document is empty, then an empty string array is returned. So + * you can always iterate over the returned array without a null check + * + * The text component will then have the full lines set as selection + * @param target + * @return String[] of lines spanning selection / or line containing dot + */ + public static String[] getSelectedLines(JTextComponent target) { + String[] lines = null; + try { + PlainDocument pDoc = (PlainDocument) target.getDocument(); + int start = pDoc.getParagraphElement(target.getSelectionStart()).getStartOffset(); + int end; + if (target.getSelectionStart() == target.getSelectionEnd()) { + end = pDoc.getParagraphElement(target.getSelectionEnd()).getEndOffset(); + } else { + // if more than one line is selected, we need to subtract one from the end + // so that we do not select the line with the caret and no selection in it + end = pDoc.getParagraphElement(target.getSelectionEnd() - 1).getEndOffset(); + } + target.select(start, end); + lines = pDoc.getText(start, end - start).split("\n"); + target.select(start, end); + } catch (BadLocationException ex) { + Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex); + lines = EMPTY_STRING_ARRAY; + } + return lines; + } + + /** + * Return the line of text at the TextComponent's current position + * @param target + * @return + */ + public static String getLine(JTextComponent target) { + return getLineAt(target, target.getCaretPosition()); + } + + /** + * Return the line of text at the given position. The returned value may + * be null. It will not contain the trailing new-line character. + * @param target the text component + * @param pos char position + * @return + */ + public static String getLineAt(JTextComponent target, int pos) { + String line = null; + Document doc = target.getDocument(); + if (doc instanceof PlainDocument) { + PlainDocument pDoc = (PlainDocument) doc; + int start = pDoc.getParagraphElement(pos).getStartOffset(); + int end = pDoc.getParagraphElement(pos).getEndOffset(); + try { + line = doc.getText(start, end - start); + if (line != null && line.endsWith("\n")) { + line = line.substring(0, line.length() - 1); + } + } catch (BadLocationException ex) { + Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex); + } + } + return line; + } + + /** + * Returns the Frame that contains this component or null if the component + * is not within a Window or the containing window is not a frame + * @param comp + * @return + */ + public static Frame getFrameFor(Component comp) { + Window w = SwingUtilities.getWindowAncestor(comp); + if (w != null && w instanceof Frame) { + Frame frame = (Frame) w; + return frame; + } + return null; + } + + /** + * Returns the the Token at pos as a String + * @param doc + * @param pos + * @return + */ + public static String getTokenStringAt( + SyntaxDocument doc, int pos) { + String word = ""; + Token t = doc.getTokenAt(pos); + if (t != null) { + try { + word = doc.getText(t.start, t.length); + } catch (BadLocationException ex) { + Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex); + } + } + return word; + } + + /** + * A helper function that will return the SyntaxDocument attached to the + * given text component. Return null if the document is not a + * SyntaxDocument, or if the text component is null + * @param component + * @return + */ + public static SyntaxDocument getSyntaxDocument(JTextComponent component) { + if (component == null) { + return null; + } + Document doc = component.getDocument(); + if (doc instanceof SyntaxDocument) { + return (SyntaxDocument) doc; + } else { + return null; + } + } + + /** + * Gets the Line Number at the give position of the editor component. + * The first line number is ZERO + * @param editor + * @param pos + * @return line number + * @throws javax.swing.text.BadLocationException + */ + public static int getLineNumber(JTextComponent editor, int pos) + throws BadLocationException { + if (getSyntaxDocument(editor) != null) { + SyntaxDocument sdoc = getSyntaxDocument(editor); + return sdoc.getLineNumberAt(pos); + } else { + Document doc = editor.getDocument(); + return doc.getDefaultRootElement().getElementIndex(pos); + } + } + + /** + * Gets the column number at given position of editor. The first column is + * ZERO + * @param editor + * @param pos + * @return the 0 based column number + * @throws javax.swing.text.BadLocationException + */ + public static int getColumnNumber(JTextComponent editor, int pos) + throws BadLocationException { + // speedup if the pos is 0 + if(pos == 0) { + return 0; + } + Rectangle r = editor.modelToView(pos); + int start = editor.viewToModel(new Point(0, r.y)); + int column = pos - start; + return column; + } + + /** + * Get the closest position within the document of the component that + * has given line and column. + * @param editor + * @param line the first being 1 + * @param column the first being 1 + * @return the closest positon for the text component at given line and + * column + */ + public static int getDocumentPosition(JTextComponent editor, int line, + int column) { + int lineHeight = editor.getFontMetrics(editor.getFont()).getHeight(); + int charWidth = editor.getFontMetrics(editor.getFont()).charWidth('m'); + int y = line * lineHeight; + int x = column * charWidth; + Point pt = new Point(x, y); + int pos = editor.viewToModel(pt); + return pos; + } + + public static int getLineCount(JTextComponent pane) { + SyntaxDocument sdoc = getSyntaxDocument(pane); + if (sdoc != null) { + return sdoc.getLineCount(); + } + int count = 0; + try { + int p = pane.getDocument().getLength() - 1; + if (p > 0) { + count = getLineNumber(pane, p); + } + } catch (BadLocationException ex) { + Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex); + } + return count; + } + + /** + * Insert the given item into the combo box, and set it as first selected + * item. If the item already exists, it is removed, so there are no + * duplicates. + * @param combo + * @param item the item to insert. if it's null, then nothing is inserted + */ + public static void insertIntoCombo(JComboBox combo, Object item) { + if(item == null) { + return; + } + MutableComboBoxModel model = (MutableComboBoxModel) combo.getModel(); + if (model.getSize() == 0) { + model.insertElementAt(item, 0); + return; + } + + Object o = model.getElementAt(0); + if (o.equals(item)) { + return; + } + model.removeElement(item); + model.insertElementAt(item, 0); + combo.setSelectedIndex(0); + } + + public static void insertMagicString(JTextComponent target, String result) { + try { + insertMagicString(target, target.getCaretPosition(), result); + } catch (BadLocationException ex) { + Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Repeat the string source repeat times. + * If repeats == 0 then empty String is returned + * if source is null, then empty string is returned + * @param source + * @param repeat + * @return source String repeated repeat times. + */ + public static String repeatString(String source, int repeat) { + if (repeat < 0) { + throw new IllegalArgumentException("Cannot repeat " + repeat + " times."); + } + if (repeat == 0 || source == null || source.length() == 0) { + return ""; + } + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < repeat; i++) { + buffer.append(source); + } + return buffer.toString(); + } + + /** + * Checks if the given string is null, empty or contains whitespace only + * @param string + * @return true if string is null, empty or contains whitespace only, false + * otherwise. + */ + public static boolean isEmptyOrBlanks(String string) { + if (string == null || string.length() == 0) { + return true; + } + for (int i = 0; i < string.length(); i++) { + char c = string.charAt(i); + if (!Character.isWhitespace(c)) { + return false; + } + } + return true; + } + + /** + * Return the TabStop property for the given text component, or 0 if not + * used + * @param text + * @return + */ + public static int getTabSize(JTextComponent text) { + Integer tabs = (Integer) text.getDocument().getProperty(PlainDocument.tabSizeAttribute); + return (null == tabs) ? 0 : tabs.intValue(); + } + + /** + * Insert the given String into the textcomponent. If the string contains + * the | vertical BAr char, then it will not be inserted, and the cursor will + * be set to its location. + * If there are TWO vertical bars, then the text between them will be selected + * If the toInsert String is multiLine, then indentation of all following lines + * will be the same as the first line. TAB characters will be replaced by + * the number of spaces in the document's TAB property. + * @param target + * @param dot + * @param toInsert + * @throws javax.swing.text.BadLocationException + */ + public static void insertMagicString(JTextComponent target, int dot, String toInsert) + throws BadLocationException { + Document doc = target.getDocument(); + String[] lines = toInsert.split("\n"); + if (lines.length > 1) { + // multi line strings will need to be indented + String tabToSpaces = getTab(target); + String currentLine = getLineAt(target, dot); + String currentIndent = getIndent(currentLine); + StringBuilder sb = new StringBuilder(toInsert.length()); + boolean firstLine = true; + for (String l : lines) { + if (!firstLine) { + sb.append(currentIndent); + } + firstLine = false; + // replace tabs with spaces. + sb.append(l.replace("\t", tabToSpaces)); + sb.append("\n"); + } + toInsert = sb.toString(); + } + if (toInsert.indexOf('|') >= 0) { + int ofst = toInsert.indexOf('|'); + int ofst2 = toInsert.indexOf('|', ofst + 1); + toInsert = toInsert.replace("|", ""); + doc.insertString(dot, toInsert, null); + dot = target.getCaretPosition(); + int strLength = toInsert.length(); + if (ofst2 > 0) { + // note that we already removed the first |, so end offset is now + // one less than what it was. + target.select(dot + ofst - strLength, dot + ofst2 - strLength - 1); + } else { + target.setCaretPosition(dot + ofst - strLength); + } + } else { + doc.insertString(dot, toInsert, null); + } + } + + /** + * Expand the string template and replaces the selection with the expansion + * of the template. The template String may contain any of the following + * special tags. + * + *
  • {@code #{selection}} replaced with the selection, if any. If there is + * no selection, then the {@code #{selection}} tag will be removed. + *
  • {@code #{p:any text}} will be replaced by {@code any text} and then + * set selection to {@code any text} + * + * This method properly handles indentation as follows: + * The indentation of the whole block will match the indentation of the caret + * line, or the line with the beginning of the selection, if the selection is + * in whole line, i.e.e one or more lines of selected text. {@see selectLines()} + * + * @param target JEditorCOmponent to be affected + * @param templateLines template split as a String array of lines. + * + * @see insertLinesTemplate + */ + public static void insertLinesTemplate(JTextComponent target, String[] templateLines) { + // get some stuff we'll need: + String thisIndent = getIndent(getLineAt(target, target.getSelectionStart())); + String[] selLines = getSelectedLines(target); + int selStart = -1, selEnd = -1; + StringBuffer sb = new StringBuffer(); + for (String tLine : templateLines) { + int selNdx = tLine.indexOf("#{selection}"); + if (selNdx >= 0) { + // for each of the selected lines: + for (String selLine : selLines) { + sb.append(tLine.subSequence(0, selNdx)); + sb.append(selLine); + sb.append('\n'); + } + } else { + sb.append(thisIndent); + // now check for any ptags + Matcher pm = PTAGS_PATTERN.matcher(tLine); + int lineStart = sb.length(); + while (pm.find()) { + selStart = pm.start() + lineStart; + pm.appendReplacement(sb, pm.group(1)); + selEnd = sb.length(); + } + pm.appendTail(sb); + sb.append('\n'); + } + } + int ofst = target.getSelectionStart(); + target.replaceSelection(sb.toString()); + if (selStart >= 0) { + // target.setCaretPosition(selStart); + target.select(ofst + selStart, ofst + selEnd); + } + } + + /** + * Expand the string template and replaces the selection with the expansion + * of the template. The template String may contain any of the following + * special tags. + * + *
  • {@code #{selection}} replaced with the selection, if any. If there is + * no selection, then the {@code #{selection}} tag will be removed. + *
  • {@code #{p:AnyText}} will be replaced by {@code any text} and then + * set the text selection to {@code AnyText} + * + * This methood does NOT perform any indentation and the template should + * generally span one line only + * + * @param target + * @param template + */ + public static void insertSimpleTemplate(JTextComponent target, String template) { + String selected = target.getSelectedText(); + selected = (selected == null) ? "" : selected; + StringBuffer sb = new StringBuffer(template.length()); + Matcher pm = PTAGS_PATTERN.matcher(template.replace(TEMPLATE_SELECTION, selected)); + int selStart = -1, selEnd = -1; + int lineStart = 0; + while (pm.find()) { + selStart = pm.start() + lineStart; + pm.appendReplacement(sb, pm.group(1)); + selEnd = sb.length(); + } + pm.appendTail(sb); + // String expanded = template.replace(TEMPLATE_SELECTION, selected); + + if (selStart >= 0) { + selStart += target.getSelectionStart(); + selEnd += target.getSelectionStart(); + } + target.replaceSelection(sb.toString()); + if (selStart >= 0) { + // target.setCaretPosition(selStart); + target.select(selStart, selEnd); + } + } + + /** + * If the selection is multi lined, then the full lines are selected, + * otherwise, nothing is done. + * @param target + * @return true if the selection is multi-line, or a whole line + */ + public static boolean selectLines(JTextComponent target) { + if (target.getSelectionStart() == target.getSelectionEnd()) { + return false; + } + PlainDocument pDoc = (PlainDocument) target.getDocument(); + Element es = pDoc.getParagraphElement(target.getSelectionStart()); + // if more than one line is selected, we need to subtract one from the end + // so that we do not select the line with the caret and no selection in it + Element ee = pDoc.getParagraphElement(target.getSelectionEnd() - 1); + if (es.equals(ee) && ee.getEndOffset() != target.getSelectionEnd()) { + return false; + } + int start = es.getStartOffset(); + int end = ee.getEndOffset(); + target.select(start, end - 1); + return true; + } + + /** + * Sets the caret position of the given target to the given line and column + * @param target + * @param line the first being 1 + * @param column the first being 1 + */ + public static void setCaretPosition(JTextComponent target, int line, int column) { + int p = getDocumentPosition(target, line, column); + target.setCaretPosition(p); + } + + /** + * Return a string with number of spaces equal to the tab-stop of the TextComponent + * @param target + * @return + */ + public static String getTab(JTextComponent target) { + return SPACES.substring(0, getTabSize(target)); + } + + /** + * Searches all actions of a JTextComponent for ab action of the given class and returns + * the first one that matches that class, or null if no Action is found + * @param + * @param target + * @param aClass + * @return Action object of that class or null + */ + public static T getAction(JTextComponent target, Class aClass) { + for (Object k : target.getActionMap().allKeys()) { + Action a = target.getActionMap().get(k); + if (aClass.isInstance(a)) { + @SuppressWarnings("unchecked") + T t = (T) a; + return t; + } + } + return null; + } + + /** + * Return the DefaultSyntaxKit of this target, or null if the target does not + * have a DefaultSyntaxKit + * @param target + * @return kit or null + */ + public static DefaultSyntaxKit getSyntaxKit(JTextComponent target) { + DefaultSyntaxKit kit = null; + if (target instanceof JEditorPane) { + JEditorPane jEditorPane = (JEditorPane) target; + EditorKit k = jEditorPane.getEditorKit(); + if (k instanceof DefaultSyntaxKit) { + kit = (DefaultSyntaxKit) k; + } + } + return kit; + } + + /** + * Create and send a KeyPress KeyEvent to the component given + * @param target Editor to get the action + * @param v_key from KeyEvent.V_ constants + * @param modifiers from KeyEvent.*MASK constants + */ + public static void sendKeyPress(JTextComponent target, int v_key, int modifiers) { + KeyEvent ke = new KeyEvent(target, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), + modifiers, v_key, KeyEvent.CHAR_UNDEFINED); + target.dispatchEvent(ke); + } + // This is used internally to avoid NPE if we have no Strings + final static String[] EMPTY_STRING_ARRAY = new String[0]; + // This is used to quickly create Strings of at most 16 spaces (using substring) + final static String SPACES = " "; + /** + * The Pattern to use for PTags in insertSimpleTemplate + */ + public static final Pattern PTAGS_PATTERN = Pattern.compile("\\#\\{p:([^}]*)\\}"); + public static final String TEMPLATE_SELECTION = "#{selection}"; +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CaretMonitor.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CaretMonitor.java new file mode 100644 index 000000000..42c79b1f3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CaretMonitor.java @@ -0,0 +1,119 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import javax.swing.JLabel; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This class can be used to display the caret location in friendly manner for + * an EditorPane. + * + * @author Ayman Al-Sairafi + */ +public class CaretMonitor implements CaretListener { + + private JLabel label; + private JTextComponent text; + + /** + * The format string to use when there is no selected: + * the arguments are: + * 1 based line number + * 1 based column number + * 0 based position + */ + private String noSelectionFormat = "%d:%d (%d)"; + /** + * The format string to use when something is selected: + * the arguments are: + * 1 based line number for selection start + * 1 based column number for selection start + * 1 based line number for selection end + * 1 based column number for selection end + * length of selection + * 0 based start position + * 0 based end position + */ + private String selectionFormat = "%d:%d - %d:%d (%d)"; + + public CaretMonitor(JTextComponent text, JLabel label) { + this.label = label; + this.text = text; + text.addCaretListener(this); + updateLabel(text.getCaretPosition()); + } + + @Override + public void caretUpdate(CaretEvent evt) { + updateLabel(evt.getDot()); + } + + protected void updateLabel(int pos) { + if (text.getDocument() instanceof SyntaxDocument) { + try { + if (text.getSelectionStart() == text.getSelectionEnd()) { + String loc = String.format(noSelectionFormat, + ActionUtils.getLineNumber(text, pos) + 1, + ActionUtils.getColumnNumber(text, pos) + 1, + pos); + label.setText(loc); + } else { + int start = text.getSelectionStart(); + int end = text.getSelectionEnd(); + String loc = String.format(selectionFormat, + ActionUtils.getLineNumber(text, start) + 1, + ActionUtils.getColumnNumber(text, start) + 1, + ActionUtils.getLineNumber(text, end) + 1, + ActionUtils.getColumnNumber(text, end) + 1, + (end - start), + start, + end); + label.setText(loc); + } + } catch (BadLocationException ex) { + label.setText("Ex: " + ex.getMessage()); + } + } else { + label.setText(String.format(noSelectionFormat, 1, 1, 1)); + } + } + + @Override + protected void finalize() throws Throwable { + text.removeCaretListener(this); + super.finalize(); + } + + public String getNoSelectionFormat() { + return noSelectionFormat; + } + + public void setNoSelectionFormat(String noSelectionFormat) { + this.noSelectionFormat = noSelectionFormat; + } + + public String getSelectionFormat() { + return selectionFormat; + } + + public void setSelectionFormat(String selectionFormat) { + this.selectionFormat = selectionFormat; + } + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ComboCompletionAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ComboCompletionAction.java new file mode 100644 index 000000000..144440438 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ComboCompletionAction.java @@ -0,0 +1,80 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.List; +import java.util.Map; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.actions.gui.ComboCompletionDialog; +import jsyntaxpane.util.JarServiceProvider; + +/** + * ComboBox like Completion Action: + * This will display a list of items to choose from, it can be used similar to + * IntelliSense. The List is obtained from a plain text file, each line being + * an item in the list. + * + * @author Ayman Al-Sairafi + */ +public class ComboCompletionAction extends DefaultSyntaxAction { + + Map completions; + ComboCompletionDialog dlg; + private List items; + + public ComboCompletionAction() { + super("COMBO_COMPLETION"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + if (sdoc == null) { + return; + } + Token token = sdoc.getTokenAt(dot); + String abbrev = ""; + if (token != null) { + abbrev = token.getString(sdoc); + target.select(token.start, token.end()); + } + if (dlg == null) { + dlg = new ComboCompletionDialog(target); + } + dlg.displayFor(abbrev, items); + } + + public void setItemsURL(String value) { + items = JarServiceProvider.readLines(value); + } + + /** + * Gets the items to display in the combo + * @return + */ + public List getItems() { + return items; + } + + /** + * Sets the items to display in the combo. + * @param items + */ + public void setItems(List items) { + this.items = items; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CompleteWordAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CompleteWordAction.java new file mode 100644 index 000000000..2aac46284 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/CompleteWordAction.java @@ -0,0 +1,102 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.actions.gui.ComboCompletionDialog; +import jsyntaxpane.util.StringUtils; + +/** + * This action will try to complete the word at the cursor by + * looking for a matching word in this document that starts with + * the same letters. + * + * This makes use of the SyntaxDocument.getWordAt, which requires + * a Regexp Pattern. The Pattern should match any word regardless of + * the Tokens. + * + * This Regexp is configurable with {@code ACTION_NAME.WordsRegexp}. + * The default Regexp is \w+ (any word char) + * + * @author Ayman Al-Sairafi + */ +public class CompleteWordAction extends DefaultSyntaxAction { + + public CompleteWordAction() { + super("COMPLETE_WORD"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + Token current = sdoc.getWordAt(dot, wordsPattern); + if (current == null) { + return; + } + String cw = current.getString(sdoc); + target.select(current.start, current.end()); + + sdoc.readLock(); + List matches = new ArrayList(); + Matcher m = sdoc.getMatcher(wordsPattern, 0, current.start); + addWords(m, cw, matches); + m = sdoc.getMatcher(wordsPattern, current.end(), sdoc.getLength() - current.end()); + addWords(m, cw, matches); + sdoc.readUnlock(); + if (matches.size() == 0) { + return; + } + if (matches.size() == 1) { + target.replaceSelection(matches.get(0)); + return; + } + if (dlg == null) { + dlg = new ComboCompletionDialog(target); + } + dlg.displayFor(cw, matches); + } + + public void setWordsRegexp(String value) { + wordsPattern = Pattern.compile(value); + + } + + /** + * Add words from the matcher m that match the word abbr to matches + * List + * @param m matcher instance, could be null, to iterate through + * @param abbr abbriviated word + * @param matches List of matches + */ + private void addWords(Matcher m, String abbr, List matches) { + while (m != null && m.find()) { + String word = m.group(); + if (StringUtils.camelCaseMatch(word, abbr)) { + if (!matches.contains(word)) { + matches.add(word); + } + } + } + } + private ComboCompletionDialog dlg; + private Pattern wordsPattern = DEFAULT_WORDS_REGEXP; + private static final Pattern DEFAULT_WORDS_REGEXP = Pattern.compile("\\w+"); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DefaultSyntaxAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DefaultSyntaxAction.java new file mode 100644 index 000000000..eda37c4df --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DefaultSyntaxAction.java @@ -0,0 +1,134 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.net.URL; +import java.util.regex.Pattern; +import javax.swing.ImageIcon; +import javax.swing.text.JTextComponent; +import javax.swing.text.TextAction; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.util.Configuration; +import jsyntaxpane.util.ReflectUtils; + +/** + * The DefaultSyntaxAction. You can extend this class or implement the interface + * SyntaxAction to create your own actions. + * + * @author Ayman Al-Sairafi + */ +abstract public class DefaultSyntaxAction extends TextAction implements SyntaxAction { + + public DefaultSyntaxAction(String actionName) { + super(actionName); + putValue(NAME, actionName); + } + + @Override + public void config(Configuration config, String name) { + // find setter methods for each property key: + String actionName = name.substring(ACTION_PREFIX.length()); + for (Configuration.StringKeyMatcher m : config.getKeys( + Pattern.compile(Pattern.quote(name) + "\\.((\\w|-)+)"))) { + if (!ReflectUtils.callSetter(this, m.group1, m.value)) { + putValue(m.group1, m.value); + } + } + // if we did not put a name, use the action name + if (getValue(NAME) == null) { + putValue(NAME, actionName); + } + // if we did not put an icon, try and find one using our name + if (getValue(SMALL_ICON) == null) { + setSmallIcon(actionName + ".png"); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + JTextComponent text = getTextComponent(e); + SyntaxDocument sdoc = ActionUtils.getSyntaxDocument(text); + if (text != null) { + actionPerformed(text, sdoc, text.getCaretPosition(), e); + } + } + + /** + * Convenience method that will be called if the Action is performed on a + * JTextComponent. SyntaxActions should generally override this method. + * @param target (non-null JTextComponent from Action.getSource + * @param sDoc (SyntaxDOcument of the text component, could be null) + * @param dot (position of caret at text document) + * @param e actual ActionEvent passed to actionPerformed + */ + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + throw new UnsupportedOperationException("Not yet implemented"); + } + + @Override + public String toString() { + return "Action " + getValue(NAME) + "of type " + this.getClass().getSimpleName(); + } + + /** + * Configure the MenuText for the Action + * @param text + */ + public final void setMenuText(String text) { + putValue(NAME, text); + // also set the SHORT_DESCRIPTIOn if it was not set, so we have + // at least some tooltip for toolbar buttons + if (getValue(SHORT_DESCRIPTION) == null) { + putValue(SHORT_DESCRIPTION, text); + } + } + + /** + * Configure the ToolTip for the Action + * @param text + */ + public final void setToolTip(String text) { + putValue(SHORT_DESCRIPTION, text); + } + + /** + * Sets the Large Icon for this action from given url + * + * @param url + */ + public final void setLargeIcon(String url) { + URL loc = this.getClass().getResource(LARGE_ICONS_LOC_PREFIX + url); + if (loc != null) { + ImageIcon i = new ImageIcon(loc); + putValue(LARGE_ICON_KEY, i); + } + } + + /** + * Configure the SmallIcon for the Action + * @param url + */ + public final void setSmallIcon(String url) { + URL loc = this.getClass().getResource(SMALL_ICONS_LOC_PREFIX + url); + if (loc != null) { + ImageIcon i = new ImageIcon(loc); + putValue(SMALL_ICON, i); + } + } + public static final String ACTION_PREFIX = "Action."; + public static final String SMALL_ICONS_LOC_PREFIX = "/META-INF/images/small-icons/"; + public static final String LARGE_ICONS_LOC_PREFIX = "/META-INF/images/large-icons/"; +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DeleteLinesAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DeleteLinesAction.java new file mode 100644 index 000000000..a6c16b0a6 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DeleteLinesAction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This Action deletes the current line, or all the highlighted lines. + * @author Ayman Al-Sairafi + */ +public class DeleteLinesAction extends DefaultSyntaxAction { + + public DeleteLinesAction() { + super("DELETE_LINES"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + try { + int st = sdoc.getLineStartOffset(target.getSelectionStart()); + int en = sdoc.getLineEndOffset(target.getSelectionEnd()); + sdoc.remove(st, en - st); + } catch (BadLocationException ex) { + Logger.getLogger(DeleteLinesAction.class.getName()).log(Level.SEVERE, null, ex); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DocumentSearchData.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DocumentSearchData.java new file mode 100644 index 000000000..432d4824f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DocumentSearchData.java @@ -0,0 +1,264 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.Component; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.actions.gui.QuickFindDialog; +import jsyntaxpane.actions.gui.ReplaceDialog; + +/** + * Data that is shared by Find / Replace and Find Next actions for a Document + * The data here will be added as a property of the Document using the key + * PROPERTY_KEY. Only through the getFtmEditor can you crate a new instance. + * + * The class is responsible for handling the doFind and doReplace all actions. + * + * The class is also responsible for displaying the Find / Replace dialog + * + * @author Ayman Al-Sairafi + */ +public class DocumentSearchData { + + private static final String PROPERTY_KEY = "SearchData"; + private Pattern pattern = null; + private boolean wrap = true; + private ReplaceDialog replaceDlg; + private QuickFindDialog quickFindDlg; + + /** + * This prevent creating a new instance. You must call the getFromEditor + * to crate a new instance attached to a Document + * + */ + private DocumentSearchData() { + } + + public Pattern getPattern() { + return pattern; + } + + /** + * Set the pattern to the given compiled pattern. + * @see this#setPattern(String, boolean, boolean) + * @param pattern + */ + public void setPattern(Pattern pattern) { + this.pattern = pattern; + } + + /** + * Sets the pattern from a string and flags + * @param pat String of pattern + * @param regex true if the pattern should be a regexp + * @param ignoreCase true to ignore case + * @throws java.util.regex.PatternSyntaxException + */ + public void setPattern(String pat, boolean regex, boolean ignoreCase) + throws PatternSyntaxException { + if (pat != null && pat.length() > 0) { + int flag = (regex) ? 0 : Pattern.LITERAL; + flag |= (ignoreCase) ? Pattern.CASE_INSENSITIVE : 0; + setPattern(Pattern.compile(pat, flag)); + } else { + setPattern(null); + } + } + + public boolean isWrap() { + return wrap; + } + + public void setWrap(boolean wrap) { + this.wrap = wrap; + } + + /** + * Get the Search data from a Document. If document does not have any + * search data, then a new instance is added, put and reurned. + * @param target JTextCOmponent we are attaching to + * @return + */ + public static DocumentSearchData getFromEditor(JTextComponent target) { + if (target == null) { + return null; + } + Object o = target.getDocument().getProperty(PROPERTY_KEY); + if (o instanceof DocumentSearchData) { + DocumentSearchData documentSearchData = (DocumentSearchData) o; + return documentSearchData; + } else { + DocumentSearchData newDSD = new DocumentSearchData(); + target.getDocument().putProperty(PROPERTY_KEY, newDSD); + return newDSD; + } + } + + /** + * Perform a replace all operation on the given component. + * Note that this create a new duplicate String big as the entire + * document and then assign it to the target text component + * @param target + * @param replacement + */ + public void doReplaceAll(JTextComponent target, String replacement) { + if (replacement == null) { + replacement = ""; + } + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(target); + if (sDoc == null) { + return; + } + if (getPattern() == null) { + return; + } + Matcher matcher = sDoc.getMatcher(getPattern()); + String newText = matcher.replaceAll(replacement); + try { + sDoc.replace(0, sDoc.getLength(), newText, null); + } catch (BadLocationException ex) { + Logger.getLogger(DocumentSearchData.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Replace single occurrence of match with the replacement. + * @param target + * @param replacement + */ + public void doReplace(JTextComponent target, String replacement) { + if (target.getSelectedText() != null) { + target.replaceSelection(replacement == null ? "" : replacement); + doFindNext(target); + } + } + + /** + * FInd the previous match + * @param target + * @return + */ + public boolean doFindPrev(JTextComponent target) { + if (getPattern() == null) { + return false; + } + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(target); + if (sDoc == null) { + return false; + } + int dot = target.getSelectionStart(); + Matcher matcher = sDoc.getMatcher(getPattern()); + if (matcher == null) { + return false; + } + // we have no way of jumping to last match, so we need to + // go throw all matches, and stop when we reach current pos + int start = -1; + int end = -1; + while (matcher.find()) { + if (matcher.end() >= dot) { + break; + } + start = matcher.start(); + end = matcher.end(); + } + if (end > 0) { + target.select(start, end); + return true; + } else { + return false; + } + } + + /** + * Perform a FindNext operation on the given text component. Position + * the caret at the start of the next found pattern. + * @param target + * @return true if pattern is found, false otherwise + */ + public boolean doFindNext(JTextComponent target) { + if (getPattern() == null) { + return false; + } + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(target); + if (sDoc == null) { + return false; + } + int start = target.getSelectionEnd(); + if (target.getSelectionEnd() == target.getSelectionStart()) { + // we must advance the position by one, otherwise we will find + // the same text again + start++; + } + if (start >= sDoc.getLength()) { + start = sDoc.getLength(); + } + Matcher matcher = sDoc.getMatcher(getPattern(), start); + if (matcher != null && matcher.find()) { + // since we used an offset in the matcher, the matcher location + // MUST be offset by that location + target.select(matcher.start() + start, matcher.end() + start); + return true; + } else { + if (isWrap()) { + matcher = sDoc.getMatcher(getPattern()); + if (matcher != null && matcher.find()) { + target.select(matcher.start(), matcher.end()); + return true; + } else { + return false; + } + } else { + return false; + } + } + } + + /** + * Display an OptionPane dialog that the search string is not found + * @param target + */ + public void msgNotFound(Component target) { + JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(target), + "Search String " + getPattern() + " not found", + "Find", JOptionPane.INFORMATION_MESSAGE); + } + + /** + * Show the Find and Replace dialog for the given frame + * @param target + */ + public void showReplaceDialog(JTextComponent target) { + if (replaceDlg == null) { + replaceDlg = new ReplaceDialog(target, this); + } + replaceDlg.setVisible(true); + } + + public void showQuickFindDialog(JTextComponent target) { + if (quickFindDlg == null) { + quickFindDlg = new QuickFindDialog(target, this); + } + quickFindDlg.showFor(target); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DuplicateLinesAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DuplicateLinesAction.java new file mode 100644 index 000000000..bef9f9446 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/DuplicateLinesAction.java @@ -0,0 +1,45 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This Action duplicates the current line, or all the highlighted lines. + * @author Ayman Al-Sairafi + */ +public class DuplicateLinesAction extends DefaultSyntaxAction { + + public DuplicateLinesAction() { + super("DUPLICATE_LINES"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + try { + int st = sdoc.getLineStartOffset(target.getSelectionStart()); + int en = sdoc.getLineEndOffset(target.getSelectionEnd()); + String dupLines = sdoc.getText(st, en - st); + sdoc.insertString(st, dupLines, null); + } catch (BadLocationException ex) { + Logger.getLogger(DuplicateLinesAction.class.getName()).log(Level.SEVERE, null, ex); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindNextAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindNextAction.java new file mode 100644 index 000000000..467e7f6d2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindNextAction.java @@ -0,0 +1,26 @@ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This class performs a Find Next operation by using the current pattern + */ +public class FindNextAction extends DefaultSyntaxAction { + + public FindNextAction() { + super("find-next"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + DocumentSearchData dsd = DocumentSearchData.getFromEditor(target); + if (dsd != null) { + if(!dsd.doFindNext(target)) { + dsd.msgNotFound(target); + } + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindReplaceAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindReplaceAction.java new file mode 100644 index 000000000..730f85425 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/FindReplaceAction.java @@ -0,0 +1,42 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * Finder class. This class contains the general Find, Find Next, + * Find Previous, and the Find Marker Actions. + * + * Note that all Actions are subclasses of this class because all actions + * require the find text to be shared among them. This is the best approach + * to have all Action classes share this same data. + * + * @author Ayman Al-Sairafi + */ +public class FindReplaceAction extends DefaultSyntaxAction { + + public FindReplaceAction() { + super("FIND_REPLACE"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + DocumentSearchData dsd = DocumentSearchData.getFromEditor(target); + dsd.showReplaceDialog(target); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/GotoLineAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/GotoLineAction.java new file mode 100644 index 000000000..23b662cfc --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/GotoLineAction.java @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import jsyntaxpane.actions.gui.GotoLineDialog; +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This actions displays the GotoLine dialog + */ +public class GotoLineAction extends DefaultSyntaxAction { + + public GotoLineAction() { + super("GOTO_LINE"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + GotoLineDialog.showForEditor(target); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/HTMLPreviewAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/HTMLPreviewAction.java new file mode 100644 index 000000000..61df48735 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/HTMLPreviewAction.java @@ -0,0 +1,47 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.actions.gui.HTMLPreviewFrame; + +/** + * Show an HTML Preview window. + * This will automatically update on changes to the underlying document. + * + */ +public class HTMLPreviewAction extends DefaultSyntaxAction { + public static final String HTML_PREVIEW_WINDOW = "html-preview-window"; + + public HTMLPreviewAction() { + super("HTML_PREVIEW"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + // have the document property + Object obj = sDoc.getProperty(HTML_PREVIEW_WINDOW); + if(obj == null) { + HTMLPreviewFrame dlg = new HTMLPreviewFrame(sDoc); + sDoc.putProperty( HTML_PREVIEW_WINDOW,dlg); + dlg.setVisible(true); + } else { + HTMLPreviewFrame dlg = (HTMLPreviewFrame) obj; + dlg.setVisible(enabled); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/IndentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/IndentAction.java new file mode 100644 index 000000000..90d7ccb4a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/IndentAction.java @@ -0,0 +1,96 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.Map; +import java.util.regex.Pattern; +import javax.swing.JEditorPane; +import javax.swing.text.EditorKit; +import javax.swing.text.JTextComponent; +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +/** + * IndentAction is used to replace Tabs with spaces. If there is selected + * text, then the lines spanning the selection will be shifted + * right by one tab-width space character. + * + * Since this is also used as an abbreviation completion action, + * Abbreviiations are processed by this event. + * + * FIXME: Move the abbreviation expansion to an ActionUtils proc + * @author Ayman Al-Sairafi + * + */ +public class IndentAction extends DefaultSyntaxAction { + + public IndentAction() { + super("insert-tab"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + String selected = target.getSelectedText(); + EditorKit kit = ((JEditorPane) target).getEditorKit(); + Map abbrvs = ((DefaultSyntaxKit) kit).getAbbreviations(); + if (selected == null) { + // Check for abbreviations: + Token abbrToken = sDoc.getWordAt(dot, wordsPattern); + Integer tabStop = ActionUtils.getTabSize(target); + int lineStart = sDoc.getParagraphElement(dot).getStartOffset(); + int column = dot - lineStart; + int needed = tabStop - (column % tabStop); + if (abbrvs == null || abbrToken == null) { + target.replaceSelection(ActionUtils.SPACES.substring(0, needed)); + } else { + String abbr = abbrToken.getString(sDoc); + if (abbrvs.containsKey(abbr)) { + target.select(abbrToken.start, abbrToken.end()); + abbr = abbrvs.get(abbr); + String[] abbrLines = abbr.split("\n"); + if (abbrLines.length > 1) { + ActionUtils.insertLinesTemplate(target, abbrLines); + } else { + ActionUtils.insertSimpleTemplate(target, abbr); + } + } else { + target.replaceSelection(ActionUtils.SPACES.substring(0, needed)); + } + } + } else { + String[] lines = ActionUtils.getSelectedLines(target); + int start = target.getSelectionStart(); + StringBuilder sb = new StringBuilder(); + for (String line : lines) { + sb.append(ActionUtils.getTab(target)); + sb.append(line); + sb.append('\n'); + } + target.replaceSelection(sb.toString()); + target.select(start, start + sb.length()); + } + } + private Pattern wordsPattern = Pattern.compile("\\w+"); + + public void setWordRegex(String regex) { + wordsPattern = Pattern.compile(regex); + } + + public Pattern getWordRegex() { + return wordsPattern; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JIndentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JIndentAction.java new file mode 100644 index 000000000..1f9d8308d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JIndentAction.java @@ -0,0 +1,81 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +/** + * This class should be mapped to VK_ENTER. It performs proper indentation + * for Java Type languages and automatically inserts "*" in multi-line comments + * Initial Code contributed by ser... AT mail.ru + * + * @author Ayman Al-Sairafi + */ +public class JIndentAction extends DefaultSyntaxAction { + + public JIndentAction() { + super("JINDENT"); + } + + /** + * {@inheritDoc} + * @param e + */ + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + int pos = target.getCaretPosition(); + int start = sDoc.getParagraphElement(pos).getStartOffset(); + String line = ActionUtils.getLine(target); + String lineToPos = line.substring(0, pos - start); + String prefix = ActionUtils.getIndent(line); + Token t = sDoc.getTokenAt(pos); + if (TokenType.isComment(t)) { + String trimmed = line.trim(); + if (trimmed.startsWith("/*") && trimmed.endsWith("*/")) { + // it's a single line comment, do not do anything special + } else if (trimmed.endsWith("*/")) { + try { + // the prefix should be the line where the comment started + String commentStartLine = sDoc.getLineAt(t.start); + prefix = ActionUtils.getIndent(commentStartLine); + } catch (BadLocationException ex) { + Logger.getLogger(JIndentAction.class.getName()).log(Level.SEVERE, null, ex); + } + } else if (trimmed.startsWith("*")) { + prefix += "* "; + } else if (trimmed.startsWith("/**")) { + prefix += " * "; + } else if (trimmed.startsWith("/*")) { + prefix += " "; + } + } else if (lineToPos.trim().endsWith("{")) { + prefix += ActionUtils.getTab(target); + } else { + String noComment = sDoc.getUncommentedText(start, pos); // skip EOL comments + + if (noComment.trim().endsWith("{")) { + prefix += ActionUtils.getTab(target); + } + } + target.replaceSelection("\n" + prefix); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JUnindentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JUnindentAction.java new file mode 100644 index 000000000..ab2d19cb7 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JUnindentAction.java @@ -0,0 +1,57 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +public class JUnindentAction extends DefaultSyntaxAction { + + /** + * creates new JUnindentAction. + * Initial Code contributed by ser... AT mail.ru + */ + public JUnindentAction() { + super("JUNINDENT"); + } + + /** + * {@inheritDoc} + */ + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + int pos = target.getCaretPosition(); + int start = sDoc.getParagraphElement(pos).getStartOffset(); + String line = ActionUtils.getLine(target); + if (ActionUtils.isEmptyOrBlanks(line)) { + try { + sDoc.insertString(pos, "}", null); + Token t = sDoc.getPairFor(sDoc.getTokenAt(pos)); + if (null != t) { + String pairLine = ActionUtils.getLineAt(target, t.start); + String indent = ActionUtils.getIndent(pairLine); + sDoc.replace(start, line.length() + 1, indent + "}", null); + } + } catch (BadLocationException ble) { + target.replaceSelection("}"); + } + } else { + target.replaceSelection("}"); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JumpToPairAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JumpToPairAction.java new file mode 100644 index 000000000..e54253b70 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/JumpToPairAction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.Arrays; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +/** + * This actions Jumps to the pair of the token at the cursor. + */ +public class JumpToPairAction extends DefaultSyntaxAction { + + public JumpToPairAction() { + super("JUMP_TO_PAIR"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + Token current = sdoc.getTokenAt(dot); + if (current == null) { + return; + } + + Token pair = sdoc.getPairFor(current); + if (pair != null) { + target.setCaretPosition(pair.start); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/MapCompletionAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/MapCompletionAction.java new file mode 100644 index 000000000..37f425741 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/MapCompletionAction.java @@ -0,0 +1,57 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.Map; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.util.JarServiceProvider; + +/** + * Completion Actions: + * All completions are based on a simple String to String Map. + */ +public class MapCompletionAction extends DefaultSyntaxAction { + + Map completions; + + public MapCompletionAction() { + super("MAP_COMPLETION"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + Token token = sDoc.getTokenAt(dot); + if (token != null) { + String abbriv = ActionUtils.getTokenStringAt(sDoc, dot); + if (completions.containsKey(abbriv)) { + String completed = completions.get(abbriv); + if (completed.indexOf('|') >= 0) { + int ofst = completed.length() - completed.indexOf('|') - 1; + sDoc.replaceToken(token, completed.replace("|", "")); + target.setCaretPosition(target.getCaretPosition() - ofst); + } else { + sDoc.replaceToken(token, completed); + } + } + } + } + + public void setCompletionsFile(String value) { + completions = JarServiceProvider.readStringsMap(value); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PairAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PairAction.java new file mode 100644 index 000000000..71a3a65bf --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PairAction.java @@ -0,0 +1,56 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.HashMap; +import java.util.Map; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * A Pair action inserts a pair of characters (left and right) around the + * current selection, and then places the caret between them + * + * The pairs are hard-coded here. + */ +public class PairAction extends DefaultSyntaxAction { + + public PairAction() { + super("PAIR_ACTION"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + String left = e.getActionCommand(); + String right = PAIRS.get(left); + String selected = target.getSelectedText(); + if (selected != null) { + target.replaceSelection(left + selected + right); + } else { + target.replaceSelection(left + right); + target.setCaretPosition(target.getCaretPosition() - right.length()); + } + } + private static Map PAIRS = new HashMap(4); + + + static { + PAIRS.put("(", ")"); + PAIRS.put("[", "]"); + PAIRS.put("\"", "\""); + PAIRS.put("'", "'"); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PythonIndentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PythonIndentAction.java new file mode 100644 index 000000000..e2bfb22d1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/PythonIndentAction.java @@ -0,0 +1,58 @@ +/* + * Copyright 2009 Stefan Bechtold (stefan.bechtold@googlemail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import javax.swing.text.TextAction; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.util.Configuration; + +public class PythonIndentAction extends DefaultSyntaxAction { + + /** + * creates new PythonIndentAction. + */ + public PythonIndentAction() { + super("PYTHONINDENT"); + } + + /** + * {@inheritDoc} + * @param e + */ + @Override + public void actionPerformed(ActionEvent e) { + JTextComponent target = getTextComponent(e); + if (target != null) { + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(target); + int pos = target.getCaretPosition(); + int start = sDoc.getParagraphElement(pos).getStartOffset(); + String line = ActionUtils.getLine(target); + String lineToPos = line.substring(0, pos - start); + String prefix = ActionUtils.getIndent(line); + int tabSize = ActionUtils.getTabSize(target); + if (lineToPos.trim().endsWith(":")) { + prefix += ActionUtils.SPACES.substring(0, tabSize); + } else { + String noComment = sDoc.getUncommentedText(start, pos); // skip EOL comments + + if (noComment.trim().endsWith(":")) { + prefix += ActionUtils.SPACES.substring(0, tabSize); + } + } + target.replaceSelection("\n" + prefix); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/QuickFindAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/QuickFindAction.java new file mode 100644 index 000000000..7449c3bed --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/QuickFindAction.java @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * + * @author Ayman Al-Sairafi + */ +public class QuickFindAction extends DefaultSyntaxAction { + + public QuickFindAction() { + super("quick-find"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + DocumentSearchData.getFromEditor(target).showQuickFindDialog(target); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/RedoAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/RedoAction.java new file mode 100644 index 000000000..3bce0bfe2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/RedoAction.java @@ -0,0 +1,38 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import javax.swing.text.TextAction; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.util.Configuration; + +/** + * Redo action + */ +public class RedoAction extends DefaultSyntaxAction { + + public RedoAction() { + super("REDO"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + if (sDoc != null) { + sDoc.doRedo(); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ReflectCompletionAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ReflectCompletionAction.java new file mode 100644 index 000000000..c9844dc6a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ReflectCompletionAction.java @@ -0,0 +1,49 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import jsyntaxpane.actions.gui.ReflectCompletionDialog; +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +/** + * ComboBox like Completion Action: + * This will display a list of items to choose from, its can be used similar to + * IntelliSense + * + * @author Ayman Al-Sairafi + */ +public class ReflectCompletionAction extends DefaultSyntaxAction { + + ReflectCompletionDialog dlg; + + public ReflectCompletionAction() { + super("REFLECT_COMPLETION"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + Token t = sDoc.getTokenAt(dot); + if(t != null) { + target.select(t.start, t.end()); + } + if (dlg == null) { + dlg = new ReflectCompletionDialog(target); + } + dlg.displayFor(target); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptAction.java new file mode 100644 index 000000000..9a314846e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptAction.java @@ -0,0 +1,115 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.regex.Pattern; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.swing.JOptionPane; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.util.Configuration; +import jsyntaxpane.util.JarServiceProvider; + +/** + * This class executes a script every time it is called. + * Anything can be done using any script. + * + * @author Ayman Al-Sairafi + */ +public class ScriptAction extends DefaultSyntaxAction { + + public ScriptAction() { + super("scripted-action"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + if (getValue(SCRIPT_FUNCTION) != null) { + String f = getValue(SCRIPT_FUNCTION).toString(); + try { + engine.put("TARGET", target); + engine.put("SDOC", sDoc); + engine.put("DOT", dot); + engine.put("EVENT", e); + engine.put("ACTION", this); + engine.put("AU", ActionUtils.getInstance()); + invocable.invokeFunction(f); + } catch (ScriptException ex) { + showScriptError(target, ex); + } catch (NoSuchMethodException ex) { + showScriptError(target, ex); + } + } else { + JOptionPane.showMessageDialog(target, "Action does not have script function configured", + "Error in Script", JOptionPane.WARNING_MESSAGE); + } + } + + public void setFunction(String name) { + putValue(SCRIPT_FUNCTION, name); + } + + @Override + public void config(Configuration config, String name) { + super.config(config, name); + // now read and store all of our scripts. + for (Configuration.StringKeyMatcher m : config.getKeys(Pattern.compile("Script\\.((\\w|-)+)\\.URL"))) { + getScriptFromURL(m.value); + } + } + + /** + * + * @param url + */ + public void getScriptFromURL(String url) { + InputStream is = JarServiceProvider.findResource(url, this.getClass().getClassLoader()); + if (is != null) { + Reader reader = new InputStreamReader(is); + try { + engine.eval(reader); + } catch (ScriptException ex) { + showScriptError(null, ex); + } + } else { + JOptionPane.showMessageDialog(null, "No script is found in: " + url, + "Error in Script", JOptionPane.WARNING_MESSAGE); + } + } + + private void showScriptError(JTextComponent target, Exception ex) { + JOptionPane.showMessageDialog(target, ex.getMessage(), + "Error in Script", JOptionPane.WARNING_MESSAGE); + } + /** + * The key used to store the Script Name for the this action + */ + static final String SCRIPT_FUNCTION = "SCRIPT_FUNCTION"; + static final ScriptEngine engine; + static final Invocable invocable; + + + static { + engine = new ScriptEngineManager().getEngineByExtension("js"); + invocable = (Invocable) engine; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptRunnerAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptRunnerAction.java new file mode 100644 index 000000000..7d3ef08e2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ScriptRunnerAction.java @@ -0,0 +1,88 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * Executes the script in the component's text using a ScriptEngine + * The Configuration must contain the key [prefix.]ACTION_NAME.ScriptExtension + * and its value is the ScriptExtension that getEngineByExtension returns + * If no engine is found, then an option is given to the user to disable the action + * + * @author Ayman Al-Sairafi + */ +public class ScriptRunnerAction extends DefaultSyntaxAction { + + public ScriptRunnerAction() { + super("SCRIPT_EXECUTE"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + try { + ScriptEngine eng = getEngine(target); + if (eng != null) { + getEngine(target).eval(target.getText()); + } + } catch (ScriptException ex) { + JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(target), + "Error executing script:\n" + ex.getMessage(), + "Script Error", + JOptionPane.ERROR_MESSAGE); + ActionUtils.setCaretPosition(target, + ex.getLineNumber(), + ex.getColumnNumber()); + } + } + + private ScriptEngine getEngine(JTextComponent target) { + if (engine == null) { + if (sem == null) { + sem = new ScriptEngineManager(); + } + engine = sem.getEngineByExtension(scriptExtension); + } + if (engine == null) { + int result = JOptionPane.showOptionDialog(target, + "Script Engine for [" + scriptExtension + "] not found. Disable this Action?", + "jsyntaxpane", + JOptionPane.YES_NO_OPTION, + JOptionPane.ERROR_MESSAGE, + null, + null, + null); + if (result == JOptionPane.YES_OPTION) { + setEnabled(false); + } + } + return engine; + } + + public void setScriptExtension(String value) { + scriptExtension = value; + } + + static ScriptEngineManager sem; + private ScriptEngine engine; + private String scriptExtension; +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ShowAbbsAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ShowAbbsAction.java new file mode 100644 index 000000000..d2feb7715 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ShowAbbsAction.java @@ -0,0 +1,52 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.Map; +import javax.swing.JEditorPane; +import javax.swing.JOptionPane; +import javax.swing.text.JTextComponent; +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.actions.gui.ShowAbbsDialog; + +/** + * Display all abbreviations for a JTextComponent., if it has any. + * Abbreviations are obtained from the IndentAction, so if the target does not + * have an instance of that actions, nothing is displayed. + * @author Ayman Al-Sairafi + */ +public class ShowAbbsAction extends DefaultSyntaxAction { + + public ShowAbbsAction() { + super("show-abbreviations"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + // find the abbreviations actions: + DefaultSyntaxKit kit = ActionUtils.getSyntaxKit(target); + if (kit != null) { + Map abbs = kit.getAbbreviations(); + if (abbs == null || abbs.isEmpty()) { + JOptionPane.showMessageDialog(target, + "No Abbreviations exist for this content type"); + } else { + new ShowAbbsDialog((JEditorPane) target, abbs); + } + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeAction.java new file mode 100644 index 000000000..834b73685 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeAction.java @@ -0,0 +1,74 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.text.CharacterIterator; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.JTextComponent; +import javax.swing.text.Segment; +import jsyntaxpane.SyntaxDocument; + +/** + * + * @author Ayman Al-Sairafi + */ +public class SmartHomeAction extends DefaultSyntaxAction { + + public SmartHomeAction() { + super("smart-home"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + try { + target.setCaretPosition(getSmartHomeOffset(target, sDoc, dot)); + } catch (BadLocationException ex) { + Logger.getLogger(SmartHomeAction.class.getName()).log(Level.SEVERE, null, ex); + } + } + + static int getSmartHomeOffset(JTextComponent target, SyntaxDocument sDoc, + int dot) throws BadLocationException { + Element el = sDoc.getParagraphElement(dot); + Segment seg = new Segment(); + sDoc.getText(el.getStartOffset(), + el.getEndOffset() - el.getStartOffset() - 1, seg); + int homeOffset = 0; + int dotLineOffset = dot - el.getStartOffset(); + boolean inText = false; + // see the location of first non-space offset + for (int i = 0; i < dotLineOffset; i++) { + if (!Character.isWhitespace(seg.charAt(i))) { + inText = true; + break; + } + } + // if we are at first char in line, or we are past the non space + // chars in the line, then we move to non-space char + // otherwise, we move to first char of line + if (dotLineOffset == 0 || inText) { + for (char ch = seg.first(); + ch != CharacterIterator.DONE && Character.isWhitespace(ch); + ch = seg.next()) { + homeOffset++; + } + } + return el.getStartOffset() + homeOffset; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeSelectAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeSelectAction.java new file mode 100644 index 000000000..b7a6f9729 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SmartHomeSelectAction.java @@ -0,0 +1,42 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * + * @author Ayman Al-Sairafi + */ +public class SmartHomeSelectAction extends DefaultSyntaxAction { + + public SmartHomeSelectAction() { + super("smart-home-select"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + try { + target.moveCaretPosition(SmartHomeAction.getSmartHomeOffset(target, sDoc, dot)); + } catch (BadLocationException ex) { + Logger.getLogger(SmartHomeSelectAction.class.getName()).log(Level.SEVERE, null, ex); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SyntaxAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SyntaxAction.java new file mode 100644 index 000000000..1cf2b65ab --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/SyntaxAction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import javax.swing.Action; +import jsyntaxpane.util.Configuration; + +/** + * All JSyntaxPane Keyboard related actions implement this class. These + * classes are created dynamically, and then registered to the SyntaxKit. + * + * A class may have multiple TextActions that may be related. Each EditorKit + * that is installed will have only one instance of each class, even if more + * than one action is specified. + * + * The key value pairs in the COnfiguration are of the form: + * + * [EditorKit.]Action.NAME = class, keyboard key + * + * @author Ayman Al-Sairafi + */ +public interface SyntaxAction extends Action { + + /** + * Configure the actions in this class + * @param config + * @param name Name of the action, (prefixed by Action.) + * will be obtained from the property Key as the + * text following the Action. + */ + public void config(Configuration config, String name); + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/TemplateAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/TemplateAction.java new file mode 100644 index 000000000..c6d9ccf23 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/TemplateAction.java @@ -0,0 +1,71 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This action replaces the selection with the configured template in + * the config ACTION-NAME.Template + * + * There are two kinds of templates: + *
  • Simple Templates are replaced as is
  • + *
  • Whole Line Templates will ensure a whole line is selected. + * Each line in the selection will be prefixed, and postfixed with whatever appears + * on the line in the template
  • + * + */ +public class TemplateAction extends DefaultSyntaxAction { + + private String template; + private String[] tlines = null; + private boolean wholeLines; + private boolean mustHaveSelection; + + public TemplateAction() { + super("template"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, + int dot, ActionEvent e) { + if (mustHaveSelection) { + if (target.getSelectionEnd() == target.getSelectionStart()) { + return; + } + } + if (wholeLines) { + if(tlines == null) { + tlines = template.split("\n"); + } + ActionUtils.insertLinesTemplate(target, tlines); + } else { + ActionUtils.insertSimpleTemplate(target, template); + } + } + + public void setWholeLines(String value) { + wholeLines = Boolean.parseBoolean(value); + } + + public void setTemplate(String t) { + template = t; + } + + public void setMustHaveSelection(String value) { + mustHaveSelection = Boolean.parseBoolean(value); + } +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleCommentsAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleCommentsAction.java new file mode 100644 index 000000000..5d2a85e68 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleCommentsAction.java @@ -0,0 +1,70 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This action will toggle comments on or off on selected whole lines. + * + * @author Ayman Al-Sairafi + */ +public class ToggleCommentsAction extends DefaultSyntaxAction { + + protected String lineCommentStart = "// "; + protected Pattern lineCommentPattern = null; + + /** + * creates new JIndentAction. + * Initial Code contributed by ser... AT mail.ru + */ + public ToggleCommentsAction() { + super("toggle-comment"); + } + + /** + * {@inheritDoc} + * @param e + */ + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + if (lineCommentPattern == null) { + lineCommentPattern = Pattern.compile("(^" + lineCommentStart + ")(.*)"); + } + String[] lines = ActionUtils.getSelectedLines(target); + int start = target.getSelectionStart(); + StringBuffer toggled = new StringBuffer(); + for (int i = 0; i < lines.length; i++) { + Matcher m = lineCommentPattern.matcher(lines[i]); + if (m.find()) { + toggled.append(m.replaceFirst("$2")); + } else { + toggled.append(lineCommentStart); + toggled.append(lines[i]); + } + toggled.append('\n'); + } + target.replaceSelection(toggled.toString()); + target.select(start, start + toggled.length()); + } + + public void setLineComments(String value) { + lineCommentStart = value.replace("\"", ""); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleComponentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleComponentAction.java new file mode 100644 index 000000000..26d0d66b9 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/ToggleComponentAction.java @@ -0,0 +1,57 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.JEditorPane; +import javax.swing.text.JTextComponent; +import jsyntaxpane.DefaultSyntaxKit; + +/** + * This Action will Toggle any SyntaxComponents on the EditorPane + * You need the configuration Key prefix.ACTION_NAME.Component = componentclassname + * Where: + * ACTION_NAME is the name given to the action (prefix.Action.ACTION_NAME) + * componentclassname is the fully qualified class name of the component + * @author Ayman Al-Sairafi + */ +public class ToggleComponentAction extends DefaultSyntaxAction { + + private String componentName; + + public ToggleComponentAction() { + super("toggle-component"); + putValue(SELECTED_KEY, Boolean.TRUE); + } + + public void setComponent(String name) { + componentName = name; + } + + @Override + public String toString() { + return super.toString() + "(" + componentName + ")"; + } + + @Override + public void actionPerformed(ActionEvent e) { + JTextComponent target = getTextComponent(e); + if (target instanceof JEditorPane) { + JEditorPane jEditorPane = (JEditorPane) target; + DefaultSyntaxKit kit = (DefaultSyntaxKit) jEditorPane.getEditorKit(); + boolean status = kit.toggleComponent(jEditorPane, componentName); + putValue(SELECTED_KEY, status); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UndoAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UndoAction.java new file mode 100644 index 000000000..aa8c07985 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UndoAction.java @@ -0,0 +1,38 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import javax.swing.text.TextAction; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.util.Configuration; + +/** + * Undo action + */ +public class UndoAction extends DefaultSyntaxAction { + + public UndoAction() { + super("UNDO"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + if (sDoc != null) { + sDoc.doUndo(); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UnindentAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UnindentAction.java new file mode 100644 index 000000000..2fedf3bef --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/UnindentAction.java @@ -0,0 +1,51 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; + +/** + * This is usually mapped to Shift-TAB to unindent the selection. The + * current line, or the selected lines are un-indented by the tabstop of the + * document. + */ +public class UnindentAction extends DefaultSyntaxAction { + + public UnindentAction() { + super("UNINDENT"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + String indent = ActionUtils.getTab(target); + String[] lines = ActionUtils.getSelectedLines(target); + int start = target.getSelectionStart(); + StringBuilder sb = new StringBuilder(); + for (String line : lines) { + if (line.startsWith(indent)) { + sb.append(line.substring(indent.length())); + } else if (line.startsWith("\t")) { + sb.append(line.substring(1)); + } else { + sb.append(line); + } + sb.append('\n'); + } + target.replaceSelection(sb.toString()); + target.select(start, start + sb.length()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlPrettifyAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlPrettifyAction.java new file mode 100644 index 000000000..5506658f8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlPrettifyAction.java @@ -0,0 +1,140 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import javax.swing.text.JTextComponent; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import jsyntaxpane.SyntaxDocument; +import org.w3c.dom.Document; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * Attempt to prettify an XML document. + * @author Ayman Al-Sairafi + */ +public class XmlPrettifyAction extends DefaultSyntaxAction { + + public XmlPrettifyAction() { + super("XML_PRETTIFY"); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (transformer == null) { + return; + } + JTextComponent target = getTextComponent(e); + try { + SyntaxDocument sdoc = ActionUtils.getSyntaxDocument(target); + StringWriter out = new StringWriter(sdoc.getLength()); + StringReader reader = new StringReader(target.getText()); + InputSource src = new InputSource(reader); + Document doc = getDocBuilder().parse(src); + //Setup indenting to "pretty print" + getTransformer().transform(new DOMSource(doc), new StreamResult(out)); + target.setText(out.toString()); + } catch (SAXParseException ex) { + showErrorMessage(target, + String.format("XML error: %s\nat(%d, %d)", + ex.getMessage(), ex.getLineNumber(), ex.getColumnNumber())); + ActionUtils.setCaretPosition(target, ex.getLineNumber(), ex.getColumnNumber() - 1); + } catch (TransformerException ex) { + showErrorMessage(target, ex.getMessageAndLocation()); + } catch (SAXException ex) { + showErrorMessage(target, ex.getLocalizedMessage()); + } catch (IOException ex) { + showErrorMessage(target, ex.getLocalizedMessage()); + } + } + static Transformer transformer; + static DocumentBuilderFactory docBuilderFactory; + static DocumentBuilder docBuilder; + + private static void showErrorMessage(JTextComponent text, String msg) { + Component parent = SwingUtilities.getWindowAncestor(text); + JOptionPane.showMessageDialog(parent, msg, "JsyntaxPAne XML", JOptionPane.ERROR_MESSAGE); + } + + public static Transformer getTransformer() { + if (transformer == null) { + TransformerFactory tfactory = TransformerFactory.newInstance(); + try { + transformer = tfactory.newTransformer(); + } catch (TransformerConfigurationException ex) { + throw new IllegalArgumentException("Unable to create transformer. ", ex); + } + } + return transformer; + } + + public void setIndent(String text) { + getTransformer().setOutputProperty(OutputKeys.INDENT, text); + } + + public void setStandAlone(String text) { + getTransformer().setOutputProperty(OutputKeys.STANDALONE, text); + } + + public void setSOmitDeclaration(String text) { + getTransformer().setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, text); + } + + public void setIndentAmount(String text) { + getTransformer().setOutputProperty("{http://xml.apache.org/xslt}indent-amount", text); + } + + public void setIgnoreComments(String ic) { + getDocBuilderFactory().setIgnoringComments(Boolean.parseBoolean(ic)); + } + + public void setIgnoreWhiteSpace(String value) { + getDocBuilderFactory().setIgnoringElementContentWhitespace(Boolean.parseBoolean(value)); + } + + public static DocumentBuilderFactory getDocBuilderFactory() { + if (docBuilderFactory == null) { + docBuilderFactory = DocumentBuilderFactory.newInstance(); + } + return docBuilderFactory; + } + + public DocumentBuilder getDocBuilder() { + if (docBuilder == null) { + try { + docBuilder = getDocBuilderFactory().newDocumentBuilder(); + } catch (ParserConfigurationException ex) { + throw new IllegalArgumentException("Unable to create document builder", ex); + } + } + return docBuilder; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlTagCompleteAction.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlTagCompleteAction.java new file mode 100644 index 000000000..6d6177420 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/XmlTagCompleteAction.java @@ -0,0 +1,48 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions; + +import java.awt.event.ActionEvent; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +/** + * Completes an the Tag. + * @author Ayman Al-Sairafi + */ +public class XmlTagCompleteAction extends DefaultSyntaxAction { + + public XmlTagCompleteAction() { + super("XML_TAG_COMPLETE"); + } + + @Override + public void actionPerformed(JTextComponent target, SyntaxDocument sDoc, + int dot, ActionEvent e) { + Token tok = sDoc.getTokenAt(dot); + while (tok != null && tok.type != TokenType.TYPE) { + tok = sDoc.getPrevToken(tok); + } + if (tok == null) { + target.replaceSelection(">"); + } else { + CharSequence tag = tok.getText(sDoc); + int savepos = target.getSelectionStart(); + target.replaceSelection(">"); + target.setCaretPosition(savepos + 1); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.form new file mode 100644 index 000000000..45854eec9 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.form @@ -0,0 +1,71 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.java new file mode 100644 index 000000000..952ab10ce --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ComboCompletionDialog.java @@ -0,0 +1,247 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.awt.Font; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.KeyEvent; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.SwingUtilities; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.util.StringUtils; +import jsyntaxpane.util.SwingUtils; + +/** + * + * @author Ayman Al-Sairafi + */ +public class ComboCompletionDialog + extends javax.swing.JDialog implements EscapeListener { + + /** + * The result returned to the caller + */ + private String result = null; + /** + * Our target component + */ + private JTextComponent target; + public String escapeChars = ";(= \t\n\r"; + public List items; + + /** + * Creates new form ComboCompletionDialog + * @param target + */ + public ComboCompletionDialog(JTextComponent target) { + super(ActionUtils.getFrameFor(target), true); + initComponents(); + jTxtItem.getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void insertUpdate(DocumentEvent e) { + refilterList(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + refilterList(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + refilterList(); + } + }); + // This will allow the textfield to receive TAB keys + jTxtItem.setFocusTraversalKeysEnabled(false); + this.target = target; + SwingUtils.addEscapeListener(this); + } + + /** + * Display the Completion Dialog with initial abbrev and using the given items + * The dialog is responsible for showing itself and for updating the target + * with the text, depending on user actions. + * + * The dialog will be aligned to the selectionStart of the target component + * and when a selection is made, replaceSelection will be called on dialog + * + * @param abbrev + * @param items + */ + public void displayFor(String abbrev, List items) { + this.items = items; + try { + Window window = SwingUtilities.getWindowAncestor(target); + Rectangle rt = target.modelToView(target.getSelectionStart()); + Point loc = new Point(rt.x, rt.y); + setLocationRelativeTo(window); + // convert the location from Text Componet coordinates to + // Frame coordinates... + loc = SwingUtilities.convertPoint(target, loc, window); + // and then to Screen coordinates + SwingUtilities.convertPointToScreen(loc, window); + setLocation(loc); + } catch (BadLocationException ex) { + Logger.getLogger(ComboCompletionDialog.class.getName()).log(Level.SEVERE, null, ex); + } finally { + Font font = target.getFont(); + jTxtItem.setFont(font); + jLstItems.setFont(font); + doLayout(); + jTxtItem.setText(abbrev); + refilterList(); + setVisible(true); + } + } + + private void refilterList() { + String prefix = jTxtItem.getText(); + Vector filtered = new Vector(); + Object selected = jLstItems.getSelectedValue(); + for (String s : items) { + if (StringUtils.camelCaseMatch(s, prefix)) { + filtered.add(s); + } + } + jLstItems.setListData(filtered); + if (selected != null && filtered.contains(selected)) { + jLstItems.setSelectedValue(selected, true); + } else { + jLstItems.setSelectedIndex(0); + } + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jTxtItem = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + jLstItems = new javax.swing.JList(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setResizable(false); + setUndecorated(true); + + jTxtItem.setBorder(null); + jTxtItem.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + jTxtItemKeyPressed(evt); + } + }); + + jLstItems.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jLstItems.setFocusable(false); + jLstItems.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLstItemsMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(jLstItems); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTxtItem, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jTxtItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void jTxtItemKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTxtItemKeyPressed + + int i = jLstItems.getSelectedIndex(); + switch (evt.getKeyCode()) { + case KeyEvent.VK_ESCAPE: + result = jTxtItem.getText(); + target.replaceSelection(result); + setVisible(false); + return; + case KeyEvent.VK_DOWN: + if (i < jLstItems.getModel().getSize() - 1) { + i++; + } + jLstItems.setSelectedIndex(i); + jLstItems.ensureIndexIsVisible(i); + break; + case KeyEvent.VK_UP: + if (i > 0) { + i--; + } + jLstItems.setSelectedIndex(i); + jLstItems.ensureIndexIsVisible(i); + break; + } + + if (escapeChars.indexOf(evt.getKeyChar()) >= 0) { + if (jLstItems.getSelectedIndex() >= 0) { + result = jLstItems.getSelectedValue().toString(); + } else { + result = jTxtItem.getText(); + } + char pressed = evt.getKeyChar(); + // we need to just accept ENTER, and replace the tab with a single + // space + if (pressed != '\n') { + result += (pressed == '\t') ? ' ' : pressed; + } + target.replaceSelection(result); + setVisible(false); + } + }//GEN-LAST:event_jTxtItemKeyPressed + + private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked + if(evt.getClickCount() == 2) { + String selected = jLstItems.getSelectedValue().toString(); + target.replaceSelection(selected); + setVisible(false); + } + }//GEN-LAST:event_jLstItemsMouseClicked + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JList jLstItems; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTxtItem; + // End of variables declaration//GEN-END:variables + + @Override + public void escapePressed() { + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/EscapeListener.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/EscapeListener.java new file mode 100644 index 000000000..86a129ecf --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/EscapeListener.java @@ -0,0 +1,31 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.actions.gui; + +import javax.swing.RootPaneContainer; + +/** + * This interface is used by dialogs that will need to listen to ESC key. + * When the ESC key is pressed, escapePressed is called. + * @author Ayman Al-Sairafi + */ +public interface EscapeListener extends RootPaneContainer { + + /** + * This method will be called when ESC key is pressed. + */ + public void escapePressed(); + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.form new file mode 100644 index 000000000..6a19bf095 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.form @@ -0,0 +1,74 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.java new file mode 100644 index 000000000..e57b8b310 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/GotoLineDialog.java @@ -0,0 +1,152 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.lang.ref.WeakReference; +import jsyntaxpane.actions.*; +import javax.swing.JOptionPane; +import javax.swing.text.JTextComponent; +import jsyntaxpane.util.SwingUtils; + +/** + * A simple dialog to prompt for a line number and go to it + * @author Ayman Al-Sairafi + */ +public class GotoLineDialog + extends javax.swing.JDialog implements EscapeListener { + + private static final String PROPERTY_KEY = "GOTOLINE_DIALOG"; + private WeakReference text; + + /** + * Creates new form GotoLineDialog + * @param text + */ + private GotoLineDialog(JTextComponent text) { + super(ActionUtils.getFrameFor(text), false); + initComponents(); + this.text = new WeakReference(text); + setLocationRelativeTo(text.getRootPane()); + getRootPane().setDefaultButton(jBtnOk); + text.getDocument().putProperty(PROPERTY_KEY, this); + SwingUtils.addEscapeListener(this); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jCmbLineNumbers = new javax.swing.JComboBox(); + jBtnOk = new javax.swing.JButton(); + + setTitle("Goto Line"); + setModal(true); + setName(""); // NOI18N + setResizable(false); + + jCmbLineNumbers.setEditable(true); + jCmbLineNumbers.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jCmbLineNumbersActionPerformed(evt); + } + }); + + jBtnOk.setAction(jCmbLineNumbers.getAction()); + jBtnOk.setText("Go"); + jBtnOk.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnOkActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jCmbLineNumbers, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jBtnOk, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCmbLineNumbers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jBtnOk, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void setTextPos() { + Object line = jCmbLineNumbers.getSelectedItem(); + if (line != null) { + try { + int lineNr = Integer.parseInt(line.toString()); + ActionUtils.insertIntoCombo(jCmbLineNumbers, line); + ActionUtils.setCaretPosition(text.get(), lineNr, 0); + setVisible(false); + } catch (NumberFormatException ex) { + JOptionPane.showMessageDialog(this, "Invalid Number: " + line, + "Number Error", JOptionPane.ERROR_MESSAGE); + } + } + } + + private void jCmbLineNumbersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCmbLineNumbersActionPerformed + if (evt.getActionCommand().equals("comboBoxEdited")) { + setTextPos(); + } + }//GEN-LAST:event_jCmbLineNumbersActionPerformed + + private void jBtnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnOkActionPerformed + setTextPos(); + }//GEN-LAST:event_jBtnOkActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jBtnOk; + private javax.swing.JComboBox jCmbLineNumbers; + // End of variables declaration//GEN-END:variables + + /** + * Create or return the GotoLine dialog for a given ext component + * @param text + */ + public static void showForEditor(JTextComponent text) { + GotoLineDialog dlg = null; + if (text.getDocument().getProperty(PROPERTY_KEY) == null) { + dlg = new GotoLineDialog(text); + } else { + dlg = (GotoLineDialog) text.getDocument().getProperty(PROPERTY_KEY); + } + dlg.jCmbLineNumbers.requestFocusInWindow(); + dlg.setVisible(true); + + } + + @Override + public void escapePressed() { + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.form new file mode 100644 index 000000000..dc0a74e2a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.form @@ -0,0 +1,55 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.java new file mode 100644 index 000000000..5b7253ec1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/HTMLPreviewFrame.java @@ -0,0 +1,114 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import jsyntaxpane.actions.HTMLPreviewAction; + +/** + * + * @author Ayman Al-Sairafi + */ +public class HTMLPreviewFrame extends javax.swing.JFrame implements DocumentListener { + + Document doc; + /** + * Creates new form HTMLPreviewFrame + * @param doc + */ + public HTMLPreviewFrame(Document doc) { + initComponents(); + this.doc = doc; + doc.addDocumentListener(this); + updateHTML(); + } + + private void updateHTML() { + try { + jEdtHtml.setText(doc.getText(0, doc.getLength())); + } catch (BadLocationException ex) { + Logger.getLogger(HTMLPreviewFrame.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + jEdtHtml = new javax.swing.JEditorPane(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("HTML Preview"); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosed(java.awt.event.WindowEvent evt) { + onWindowClosed(evt); + } + }); + + jEdtHtml.setContentType("text/html"); + jEdtHtml.setEditable(false); + jScrollPane1.setViewportView(jEdtHtml); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 688, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE) + ); + + pack(); + }// //GEN-END:initComponents + + private void onWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_onWindowClosed + doc.removeDocumentListener(this); + doc.putProperty(HTMLPreviewAction.HTML_PREVIEW_WINDOW, null); + doc = null; + }//GEN-LAST:event_onWindowClosed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JEditorPane jEdtHtml; + private javax.swing.JScrollPane jScrollPane1; + // End of variables declaration//GEN-END:variables + + @Override + public void insertUpdate(DocumentEvent e) { + updateHTML(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + updateHTML(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + updateHTML(); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MemberCell.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MemberCell.java new file mode 100644 index 000000000..880878a13 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MemberCell.java @@ -0,0 +1,258 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import javax.swing.ImageIcon; +import javax.swing.JList; +import javax.swing.JPanel; +import jsyntaxpane.SyntaxView; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.util.ReflectUtils; + +/** + * This class will render a Member. There are Method, Field and Constructor subclasses + * @author Ayman Al-Sairafi + */ +abstract class MemberCell extends JPanel { + + private final JList list; + private final boolean isSelected; + private final Color backColor; + private final Member member; + private final Class theClass; + + public MemberCell(JList list, boolean isSelected, Color backColor, Member member, Class clazz) { + super(); + this.list = list; + this.isSelected = isSelected; + this.backColor = backColor; + this.member = member; + this.theClass = clazz; + } + + @Override + public void paintComponent(Graphics g) { + SyntaxView.setRenderingHits((Graphics2D) g); + g.setFont(list.getFont()); + super.paintComponent(g); + FontMetrics fm = g.getFontMetrics(); + g.setColor(isSelected ? list.getSelectionBackground() : backColor); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(isSelected ? list.getSelectionForeground() : list.getForeground()); + g.drawImage(getIcon(), 2, 0, null); + int x = 6 + getIcon().getWidth(this); + int y = fm.getHeight(); + if (member.getDeclaringClass().equals(theClass)) { + Font bold = list.getFont().deriveFont(Font.BOLD); + g.setFont(bold); + } + x = drawString(getMemberName(), x, y, g); + g.setFont(list.getFont()); + x = drawString(getArguments(), x, y, g); + String right = getReturnType(); + int rw = fm.stringWidth(right); + g.drawString(right, getWidth() - rw - 4, fm.getAscent()); + } + + @Override + public Dimension getPreferredSize() { + Font font = list.getFont(); + Graphics g = getGraphics(); + FontMetrics fm = g.getFontMetrics(font); + // total text for this component: + String total = getMemberName() + getArguments() + getReturnType() + " "; + return new Dimension(fm.stringWidth(total) + 20, Math.max(fm.getHeight(), 16)); + } + + private int drawString(String string, int x, int y, Graphics g) { + if(ActionUtils.isEmptyOrBlanks(string)) { + return x; + } + int w = g.getFontMetrics().stringWidth(string); + g.drawString(string, x, y); + return x + w; + } + + /** + * Read all relevant icons and returns the Map. The loc should contain the + * fully qualified URL for the icons. The icon names read will have the words + * _private, protected, _static, _static_private and _static_protected and the + * extension ".png" appended. + * @param loc root for icon locations + * @return Map (can be used directly with getModifiers & 0xf) + */ + Map readIcons(String loc) { + Map icons = new HashMap(); + icons.put(Modifier.PUBLIC, readImage(loc, "")); + icons.put(Modifier.PRIVATE, readImage(loc, "_private")); + icons.put(Modifier.PROTECTED, readImage(loc, "_protected")); + icons.put(Modifier.STATIC | Modifier.PUBLIC, readImage(loc, "_static")); + icons.put(Modifier.STATIC | Modifier.PRIVATE, readImage(loc, "_static_private")); + icons.put(Modifier.STATIC | Modifier.PROTECTED, readImage(loc, "_static_protected")); + return icons; + } + + private Image readImage(String iconLoc, String kind) { + String fullPath = iconLoc + kind + ".png"; + URL loc = this.getClass().getResource(fullPath); + if (loc == null) { + return null; + } else { + Image i = new ImageIcon(loc).getImage(); + return i; + } + } + + protected String getMemberName() { + return member.getName(); + } + + abstract protected String getArguments(); + + abstract protected String getReturnType(); + + abstract protected Image getIcon(); +} + +/** + * Renders a Method + * @author Ayman Al-Sairafi + */ +class MethodCell extends MemberCell { + + private final Method method; + + public MethodCell(JList list, boolean isSelected, Color backColor, Method method, Class clazz) { + super(list, isSelected, backColor, method, clazz); + this.method = method; + } + + @Override + protected String getArguments() { + return ReflectUtils.getParamsString(method.getParameterTypes()); + } + + @Override + protected String getReturnType() { + return method.getReturnType().getSimpleName(); + } + + @Override + protected Image getIcon() { + int type = method.getModifiers() & 0xf; // only get public/private/protected/static + if (icons == null) { + icons = readIcons(METHOD_ICON_LOC); + } + return icons.get(type); + } + private static Map icons = null; + public static final String METHOD_ICON_LOC = "/META-INF/images/completions/method"; +} + +/** + * Renders a Field + * @author Ayman Al-Sairafi + */ +class FieldCell extends MemberCell { + + private final Field field; + + public FieldCell(JList list, boolean isSelected, Color backColor, Field field, Class clazz) { + super(list, isSelected, backColor, field, clazz); + this.field = field; + } + + @Override + protected String getArguments() { + return ""; + } + + @Override + protected String getReturnType() { + return field.getType().getSimpleName(); + } + + @Override + protected Image getIcon() { + int type = field.getModifiers() & 0xf; // only get public/private/protected/static + if (icons == null) { + icons = readIcons(FIELD_ICON_LOC); + } + if (icons.get(type) == null) { + System.err.println("Unable to get icon for type: " + field.getModifiers()); + } + return icons.get(type); + } + private static Map icons = null; + public static final String FIELD_ICON_LOC = "/META-INF/images/completions/field"; +} + +/** + * Renders a Field + * @author Ayman Al-Sairafi + */ +class ConstructorCell extends MemberCell { + + private final Constructor cons; + + public ConstructorCell(JList list, boolean isSelected, Color backColor, Constructor cons, Class clazz) { + super(list, isSelected, backColor, cons, clazz); + this.cons = cons; + } + + @Override + protected String getMemberName() { + return cons.getDeclaringClass().getSimpleName(); + } + + @Override + protected String getArguments() { + return ReflectUtils.getParamsString(cons.getParameterTypes()); + } + + @Override + protected String getReturnType() { + return cons.getDeclaringClass().getSimpleName(); + } + + @Override + protected Image getIcon() { + int type = cons.getModifiers() & 0x7; // only get public/private/protected, mask out static + if (icons == null) { + icons = readIcons(FIELD_ICON_LOC); + } + if (icons.get(type) == null) { + System.out.println("Unable to get icon for type: " + cons.getModifiers()); + } + return icons.get(type); + } + + private static Map icons = null; + public static final String FIELD_ICON_LOC = "/META-INF/images/completions/constructor"; +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MembersListRenderer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MembersListRenderer.java new file mode 100644 index 000000000..b363b4f93 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/MembersListRenderer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.awt.Color; +import java.awt.Component; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; + +class MembersListRenderer extends DefaultListCellRenderer { + + static final Color evensColor = new Color(0xeeffee); + private ReflectCompletionDialog dlg; + + public MembersListRenderer(ReflectCompletionDialog dlg) { + this.dlg = dlg; + } + + @Override + public Component getListCellRendererComponent(final JList list, Object value, final int index, + final boolean isSelected, boolean cellHasFocus) { + Color back = (index % 2 == 1) ? list.getBackground() : evensColor; + if (value instanceof Method) { + final Method method = (Method) value; + return new MethodCell(list, isSelected, back, method, dlg.getTheClass()); + } else if (value instanceof Field) { + Field field = (Field) value; + return new FieldCell(list, isSelected, back, field, dlg.getTheClass()); + } else if (value instanceof Constructor) { + Constructor cons = (Constructor) value; + return new ConstructorCell(list, isSelected, back, cons, dlg.getTheClass()); + } else { + Component comp = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + comp.setBackground(back); + return comp; + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.form new file mode 100644 index 000000000..0d6c4ac2b --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.form @@ -0,0 +1,168 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.java new file mode 100644 index 000000000..8e69da492 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/QuickFindDialog.java @@ -0,0 +1,314 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.awt.Color; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.lang.ref.WeakReference; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.actions.DocumentSearchData; +import jsyntaxpane.components.Markers; +import jsyntaxpane.components.Markers.SimpleMarker; +import jsyntaxpane.util.SwingUtils; + +/** + * QuickFind Dialog. Firefox like dialog shown at bottom of editor. + * @author Ayman Al-Sairafi + */ +public class QuickFindDialog extends javax.swing.JDialog + implements DocumentListener, ActionListener, EscapeListener { + + private SimpleMarker marker = new SimpleMarker(Color.PINK); + private WeakReference target; + private WeakReference dsd; + private int oldCaretPosition; + /** + * This will be set to true if ESC key is used to quit the form. + * In that case, the caret will be restored to its old pos, otherwise + * it will remain where the user probably clicked. + */ + private boolean escaped = false; + + /** + * Creates new form QuickFindDialog + * + * @param target + * @param data search data + */ + public QuickFindDialog(final JTextComponent target, DocumentSearchData data) { + super(ActionUtils.getFrameFor(target), false); + initComponents(); + SwingUtils.addEscapeListener(this); + dsd = new WeakReference(data); + } + + public void showFor(final JTextComponent target) { + oldCaretPosition = target.getCaretPosition(); + Container view = target.getParent(); + Dimension wd = getSize(); + wd.width = target.getVisibleRect().width; + Point loc = new Point(0, view.getHeight()); + setSize(wd); + setLocationRelativeTo(view); + SwingUtilities.convertPointToScreen(loc, view); + setLocation(loc); + jTxtFind.setFont(target.getFont()); + jTxtFind.getDocument().addDocumentListener(this); + WindowAdapter closeListener = new WindowAdapter() { + + @Override + public void windowDeactivated(WindowEvent e) { + target.getDocument().removeDocumentListener(QuickFindDialog.this); + Markers.removeMarkers(target, marker); + if (escaped) { + Rectangle aRect; + try { + aRect = target.modelToView(oldCaretPosition); + target.setCaretPosition(oldCaretPosition); + target.scrollRectToVisible(aRect); + } catch (BadLocationException ex) { + } + } + dispose(); + } + }; + addWindowListener(closeListener); + this.target = new WeakReference(target); + Pattern p = dsd.get().getPattern(); + if (p != null) { + jTxtFind.setText(p.pattern()); + } + jChkWrap.setSelected(dsd.get().isWrap()); + setVisible(true); + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jToolBar1 = new javax.swing.JToolBar(); + jSeparator1 = new javax.swing.JToolBar.Separator(); + jLabel1 = new javax.swing.JLabel(); + jSeparator2 = new javax.swing.JToolBar.Separator(); + jTxtFind = new javax.swing.JTextField(); + jSeparator3 = new javax.swing.JToolBar.Separator(); + jBtnPrev = new javax.swing.JButton(); + jBtnNext = new javax.swing.JButton(); + jChkIgnoreCase = new javax.swing.JCheckBox(); + jChkRegExp = new javax.swing.JCheckBox(); + jChkWrap = new javax.swing.JCheckBox(); + jSeparator4 = new javax.swing.JToolBar.Separator(); + jLblStatus = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setBackground(java.awt.Color.darkGray); + setName("QuickFindDialog"); // NOI18N + setResizable(false); + setUndecorated(true); + + jToolBar1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + jToolBar1.setFloatable(false); + jToolBar1.setRollover(true); + jToolBar1.add(jSeparator1); + + jLabel1.setLabelFor(jTxtFind); + jLabel1.setText("Quick Find"); + jToolBar1.add(jLabel1); + jToolBar1.add(jSeparator2); + + jTxtFind.setColumns(30); + jTxtFind.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + jTxtFind.setMaximumSize(new java.awt.Dimension(200, 24)); + jTxtFind.setMinimumSize(new java.awt.Dimension(60, 24)); + jToolBar1.add(jTxtFind); + jToolBar1.add(jSeparator3); + + jBtnPrev.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-up.png"))); // NOI18N + jBtnPrev.setFocusable(false); + jBtnPrev.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + jBtnPrev.setOpaque(false); + jBtnPrev.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jBtnPrev.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnPrevActionPerformed(evt); + } + }); + jToolBar1.add(jBtnPrev); + + jBtnNext.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-down.png"))); // NOI18N + jBtnNext.setFocusable(false); + jBtnNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + jBtnNext.setMargin(new java.awt.Insets(2, 2, 2, 2)); + jBtnNext.setOpaque(false); + jBtnNext.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jBtnNext.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnNextActionPerformed(evt); + } + }); + jToolBar1.add(jBtnNext); + + jChkIgnoreCase.setMnemonic('C'); + jChkIgnoreCase.setText("Ignore Case"); + jChkIgnoreCase.setFocusable(false); + jChkIgnoreCase.setOpaque(false); + jChkIgnoreCase.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(jChkIgnoreCase); + jChkIgnoreCase.addActionListener(this); + + jChkRegExp.setMnemonic('R'); + jChkRegExp.setText("Reg Exp"); + jChkRegExp.setFocusable(false); + jChkRegExp.setOpaque(false); + jChkRegExp.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(jChkRegExp); + jChkRegExp.addActionListener(this); + + jChkWrap.setMnemonic('W'); + jChkWrap.setText("Wrap"); + jChkWrap.setFocusable(false); + jChkWrap.setOpaque(false); + jChkWrap.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(jChkWrap); + jChkWrap.addActionListener(this); + + jToolBar1.add(jSeparator4); + + jLblStatus.setFont(jLblStatus.getFont().deriveFont(jLblStatus.getFont().getStyle() | java.awt.Font.BOLD, jLblStatus.getFont().getSize()-2)); + jLblStatus.setForeground(java.awt.Color.red); + jToolBar1.add(jLblStatus); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + + pack(); + }// //GEN-END:initComponents + + private void jBtnNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnNextActionPerformed + if (dsd.get().doFindNext(target.get())) { + jLblStatus.setText(null); + } else { + jLblStatus.setText("not found"); + } +}//GEN-LAST:event_jBtnNextActionPerformed + + private void jBtnPrevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnPrevActionPerformed + if (dsd.get().doFindPrev(target.get())) { + jLblStatus.setText(null); + } else { + jLblStatus.setText("not found"); + } +}//GEN-LAST:event_jBtnPrevActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jBtnNext; + private javax.swing.JButton jBtnPrev; + private javax.swing.JCheckBox jChkIgnoreCase; + private javax.swing.JCheckBox jChkRegExp; + private javax.swing.JCheckBox jChkWrap; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLblStatus; + private javax.swing.JToolBar.Separator jSeparator1; + private javax.swing.JToolBar.Separator jSeparator2; + private javax.swing.JToolBar.Separator jSeparator3; + private javax.swing.JToolBar.Separator jSeparator4; + private javax.swing.JToolBar jToolBar1; + private javax.swing.JTextField jTxtFind; + // End of variables declaration//GEN-END:variables + + @Override + public void insertUpdate(DocumentEvent e) { + updateFind(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + updateFind(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + updateFind(); + } + + private void updateFind() { + JTextComponent t = target.get(); + DocumentSearchData d = dsd.get(); + String toFind = jTxtFind.getText(); + if (toFind == null || toFind.isEmpty()) { + jLblStatus.setText(null); + return; + } + try { + d.setWrap(jChkWrap.isSelected()); + d.setPattern(toFind, + jChkRegExp.isSelected(), + jChkIgnoreCase.isSelected()); + // The dsd doFindNext will always find from current pos, + // so we need to relocate to our saved pos before we call doFindNext + jLblStatus.setText(null); + t.setCaretPosition(oldCaretPosition); + if (!d.doFindNext(t)) { + jLblStatus.setText("Not found"); + } else { + jLblStatus.setText(null); + } + } catch (PatternSyntaxException e) { + jLblStatus.setText(e.getDescription()); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getSource() instanceof JCheckBox) { + updateFind(); + } + } + + @Override + public void escapePressed() { + escaped = true; + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.form new file mode 100644 index 000000000..3586fab96 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.form @@ -0,0 +1,95 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.java new file mode 100644 index 000000000..27443e8b2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReflectCompletionDialog.java @@ -0,0 +1,342 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import java.awt.Font; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.KeyEvent; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.SwingUtilities; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.util.ReflectUtils; +import jsyntaxpane.util.StringUtils; +import jsyntaxpane.util.SwingUtils; + +/** + * + * @author Ayman Al-Sairafi + */ +public class ReflectCompletionDialog + extends javax.swing.JDialog implements EscapeListener { + + /** + * The class we are displaying its members: + */ + private Class theClass; + /** + * The current filter, to avoid refiltering the items + */ + public String escapeChars = ";(= \t\n"; + public List items; + private final JTextComponent target; + + /** + * Creates new form ReflectCompletionDialog + * @param target Text component for this dialog + */ + public ReflectCompletionDialog(JTextComponent target) { + super(SwingUtilities.getWindowAncestor(target), ModalityType.APPLICATION_MODAL); + initComponents(); + this.target = target; + jTxtItem.getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void insertUpdate(DocumentEvent e) { + refilterList(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + refilterList(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + refilterList(); + } + }); + // This will allow the textfield to receive TAB keys + jTxtItem.setFocusTraversalKeysEnabled(false); + // Add action so we automatically filter on comboBox Enter Key + jCmbClassName.getEditor().addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + updateItems(); + } + }); + SwingUtils.addEscapeListener(this); + } + + public void setFonts(Font font) { + jTxtItem.setFont(font); + jLstItems.setFont(font); + doLayout(); + } + + private String getSelection() { + String result; + if (jLstItems.getSelectedIndex() >= 0) { + Object selected = jLstItems.getSelectedValue(); + if (selected instanceof Method) { + result = ReflectUtils.getJavaCallString((Method) selected); + } else if (selected instanceof Constructor) { + result = ReflectUtils.getJavaCallString((Constructor) selected); + } else if (selected instanceof Field) { + result = ((Field) selected).getName(); + } else { + result = selected.toString(); + } + } else { + result = jTxtItem.getText(); + } + return result; + } + + private void refilterList() { + String prefix = jTxtItem.getText(); + Vector filtered = new Vector(); + Object selected = jLstItems.getSelectedValue(); + for (Member m : items) { + if (StringUtils.camelCaseMatch(m.getName(), prefix)) { + filtered.add(m); + } + } + jLstItems.setListData(filtered); + if (selected != null && filtered.contains(selected)) { + jLstItems.setSelectedValue(selected, true); + } else { + jLstItems.setSelectedIndex(0); + } + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jTxtItem = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + jLstItems = new javax.swing.JList(); + jCmbClassName = new javax.swing.JComboBox(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setName("CompletionDialog"); // NOI18N + setResizable(false); + setUndecorated(true); + + jTxtItem.setBorder(null); + jTxtItem.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + jTxtItemKeyPressed(evt); + } + }); + + jLstItems.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jLstItems.setCellRenderer(new jsyntaxpane.actions.gui.MembersListRenderer(this)); + jLstItems.setFocusable(false); + jLstItems.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLstItemsMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(jLstItems); + + jCmbClassName.setEditable(true); + jCmbClassName.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Object", "String" })); + jCmbClassName.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCmbClassNameItemStateChanged(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTxtItem, javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE) + .addComponent(jCmbClassName, 0, 437, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jTxtItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE) + .addGap(0, 0, 0) + .addComponent(jCmbClassName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void jTxtItemKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTxtItemKeyPressed + + int i = jLstItems.getSelectedIndex(); + switch (evt.getKeyCode()) { + case KeyEvent.VK_ESCAPE: + target.setCaretPosition(target.getSelectionEnd()); + setVisible(false); + return; + case KeyEvent.VK_DOWN: + i++; + break; + case KeyEvent.VK_UP: + i--; + break; + case KeyEvent.VK_HOME: + i = 0; + break; + case KeyEvent.VK_END: + i = jLstItems.getModel().getSize() - 1; + break; + case KeyEvent.VK_PAGE_DOWN: + i += jLstItems.getVisibleRowCount(); + break; + case KeyEvent.VK_PAGE_UP: + i -= jLstItems.getVisibleRowCount(); + break; + } + + if (escapeChars.indexOf(evt.getKeyChar()) >= 0) { + String result = getSelection(); + char pressed = evt.getKeyChar(); + // we need to just accept ENTER, and replace the tab with a single + // space + if (pressed != '\n') { + result += (pressed == '\t') ? ' ' : pressed; + } + target.replaceSelection(result); + setVisible(false); + } else { + // perform bounds checks for i + if (i >= jLstItems.getModel().getSize()) { + i = jLstItems.getModel().getSize() - 1; + } + if (i < 0) { + i = 0; + } + jLstItems.setSelectedIndex(i); + jLstItems.ensureIndexIsVisible(i); + } + }//GEN-LAST:event_jTxtItemKeyPressed + + private void jCmbClassNameItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCmbClassNameItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + updateItems(); + } + }//GEN-LAST:event_jCmbClassNameItemStateChanged + + private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked + if (evt.getClickCount() == 2) { + String selected = getSelection(); + target.replaceSelection(selected); + setVisible(false); + } + }//GEN-LAST:event_jLstItemsMouseClicked + + private void updateItems() { + String className = jCmbClassName.getEditor().getItem().toString(); + if (items == null) { + items = new ArrayList(); + } else { + items.clear(); + } + // we must have the class in the Combo: + Class aClass = ReflectUtils.findClass(className, ReflectUtils.DEFAULT_PACKAGES); + if (aClass != null) { + // for now, add everything: + theClass = aClass; + ReflectUtils.addConstrcutors(aClass, items); + ReflectUtils.addMethods(aClass, items); + ReflectUtils.addFields(aClass, items); + ActionUtils.insertIntoCombo(jCmbClassName, className); + jTxtItem.requestFocusInWindow(); + } + refilterList(); + } + + public Class getTheClass() { + return theClass; + } + + /** + * Set the items to display + * @param items + */ + public void setItems(List items) { + this.items = items; + } + + /** + * Display the dialog. + * @param target text component (its Window will be the parent) + */ + public void displayFor(JTextComponent target) { + try { + int dot = target.getSelectionStart(); + Window window = SwingUtilities.getWindowAncestor(target); + Rectangle rt = target.modelToView(dot); + Point loc = new Point(rt.x, rt.y); + // convert the location from Text Componet coordinates to + // Frame coordinates... + loc = SwingUtilities.convertPoint(target, loc, window); + // and then to Screen coordinates + SwingUtilities.convertPointToScreen(loc, window); + setLocationRelativeTo(window); + setLocation(loc); + } catch (BadLocationException ex) { + Logger.getLogger(ReflectCompletionDialog.class.getName()).log(Level.SEVERE, null, ex); + } finally { + setFonts(target.getFont()); + updateItems(); + jTxtItem.setText(target.getSelectedText()); + setVisible(true); + } + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox jCmbClassName; + private javax.swing.JList jLstItems; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField jTxtItem; + // End of variables declaration//GEN-END:variables + + @Override + public void escapePressed() { + target.setCaretPosition(target.getSelectionEnd()); + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.form new file mode 100644 index 000000000..12f823628 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.form @@ -0,0 +1,202 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.java new file mode 100644 index 000000000..1de5ec7cc --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ReplaceDialog.java @@ -0,0 +1,305 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.actions.gui; + +import jsyntaxpane.actions.*; +import jsyntaxpane.components.Markers; +import java.awt.Color; +import java.awt.HeadlessException; +import java.util.regex.PatternSyntaxException; +import javax.swing.JOptionPane; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.JTextComponent; +import jsyntaxpane.util.SwingUtils; + +/** + * A Find and Replace Dialog. The dialog will also act as a listener to + * Document changes so that all highlights are updated if the document is + * changed. + * + * @author Ayman Al-Sairafi + */ +public class ReplaceDialog extends javax.swing.JDialog + implements CaretListener, EscapeListener { + + private JTextComponent textComponent; + private DocumentSearchData dsd; + private static Markers.SimpleMarker SEARCH_MARKER = new Markers.SimpleMarker(Color.YELLOW); + + /** + * Creates new form FindDialog + * @param text + * @param dsd DocumentSerachData + */ + public ReplaceDialog(JTextComponent text, + DocumentSearchData dsd) { + super(ActionUtils.getFrameFor(text), false); + initComponents(); + textComponent = text; + this.dsd = dsd; + textComponent.addCaretListener(this); + setLocationRelativeTo(text.getRootPane()); + getRootPane().setDefaultButton(jBtnNext); + SwingUtils.addEscapeListener(this); + jBtnReplaceAll.setEnabled(text.isEditable() && text.isEnabled()); + } + + /** + * updates the highlights in the document when it is updated. + * This is called by the DocumentListener methods + */ + public void updateHighlights() { + Markers.removeMarkers(textComponent, SEARCH_MARKER); + if (jTglHighlight.isSelected()) { + Markers.markAll(textComponent, dsd.getPattern(), SEARCH_MARKER); + } + } + + private void showRegexpError(PatternSyntaxException ex) throws HeadlessException { + JOptionPane.showMessageDialog(this, "Regexp error: " + ex.getMessage(), + "Regular Expression Error", JOptionPane.ERROR_MESSAGE); + jCmbFind.requestFocus(); + } + + /** + * update the finder object with data from our UI + */ + private void updateFinder() { + String regex = (String) jCmbFind.getSelectedItem(); + try { + dsd.setPattern(regex, + jChkRegex.isSelected(), + jChkIgnoreCase.isSelected()); + ActionUtils.insertIntoCombo(jCmbFind, regex); + } catch (PatternSyntaxException e) { + showRegexpError(e); + } + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLblFind = new javax.swing.JLabel(); + jBtnNext = new javax.swing.JButton(); + jBtnPrev = new javax.swing.JButton(); + jBtnReplaceAll = new javax.swing.JButton(); + jChkWrap = new javax.swing.JCheckBox(); + jChkRegex = new javax.swing.JCheckBox(); + jChkIgnoreCase = new javax.swing.JCheckBox(); + jLblReplace = new javax.swing.JLabel(); + jTglHighlight = new javax.swing.JToggleButton(); + jCmbReplace = new javax.swing.JComboBox(); + jCmbFind = new javax.swing.JComboBox(); + jBtnReplace = new javax.swing.JButton(); + + setTitle("Find and Replace"); + setName(""); // NOI18N + setResizable(false); + + jLblFind.setDisplayedMnemonic('F'); + jLblFind.setLabelFor(jCmbFind); + jLblFind.setText("Find"); + + jBtnNext.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-next.png"))); // NOI18N + jBtnNext.setMnemonic('N'); + jBtnNext.setText("Next"); + jBtnNext.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnNextActionPerformed(evt); + } + }); + + jBtnPrev.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/go-previous.png"))); // NOI18N + jBtnPrev.setMnemonic('N'); + jBtnPrev.setText("Previous"); + jBtnPrev.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnPrevActionPerformed(evt); + } + }); + + jBtnReplaceAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/edit-find-replace-all.png"))); // NOI18N + jBtnReplaceAll.setMnemonic('H'); + jBtnReplaceAll.setText("Replace All"); + jBtnReplaceAll.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnReplaceAllActionPerformed(evt); + } + }); + + jChkWrap.setMnemonic('W'); + jChkWrap.setText("Wrap around"); + jChkWrap.setToolTipText("Wrap to beginning when end is reached"); + + jChkRegex.setMnemonic('R'); + jChkRegex.setText("Regular Expression"); + + jChkIgnoreCase.setMnemonic('I'); + jChkIgnoreCase.setText("Ignore Case"); + + jLblReplace.setDisplayedMnemonic('R'); + jLblReplace.setLabelFor(jCmbReplace); + jLblReplace.setText("Replace"); + + jTglHighlight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/highlight.png"))); // NOI18N + jTglHighlight.setText("Highlight"); + jTglHighlight.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTglHighlightActionPerformed(evt); + } + }); + + jCmbReplace.setEditable(true); + + jCmbFind.setEditable(true); + + jBtnReplace.setIcon(new javax.swing.ImageIcon(getClass().getResource("/META-INF/images/small-icons/edit-find-replace.png"))); // NOI18N + jBtnReplace.setText("Replace"); + jBtnReplace.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBtnReplaceActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLblFind) + .addComponent(jLblReplace)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jChkRegex) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jChkWrap, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jCmbFind, 0, 289, Short.MAX_VALUE) + .addComponent(jCmbReplace, javax.swing.GroupLayout.Alignment.TRAILING, 0, 289, Short.MAX_VALUE) + .addComponent(jChkIgnoreCase)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jBtnReplace, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE) + .addComponent(jBtnNext, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE) + .addComponent(jBtnPrev, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE) + .addComponent(jTglHighlight, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE) + .addComponent(jBtnReplaceAll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLblFind) + .addComponent(jCmbFind, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jBtnNext)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jBtnPrev) + .addComponent(jCmbReplace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLblReplace)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jBtnReplace) + .addGap(3, 3, 3) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jChkWrap, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jChkRegex) + .addComponent(jBtnReplaceAll)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jChkIgnoreCase) + .addComponent(jTglHighlight)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jBtnNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnNextActionPerformed + try { + updateFinder(); + if (!dsd.doFindNext(textComponent)) { + dsd.msgNotFound(textComponent); + } + textComponent.requestFocusInWindow(); + } catch (PatternSyntaxException ex) { + showRegexpError(ex); + } + }//GEN-LAST:event_jBtnNextActionPerformed + + private void jBtnReplaceAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnReplaceAllActionPerformed + try { + updateFinder(); + String replacement = (String) jCmbReplace.getSelectedItem(); + ActionUtils.insertIntoCombo(jCmbReplace, replacement); + jTglHighlight.setSelected(false); + dsd.doReplaceAll(textComponent, replacement); + textComponent.requestFocusInWindow(); + } catch (PatternSyntaxException ex) { + showRegexpError(ex); + } +}//GEN-LAST:event_jBtnReplaceAllActionPerformed + + private void jTglHighlightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTglHighlightActionPerformed + updateFinder(); + updateHighlights(); + }//GEN-LAST:event_jTglHighlightActionPerformed + + private void jBtnPrevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnPrevActionPerformed + updateFinder(); + dsd.doFindPrev(textComponent); +}//GEN-LAST:event_jBtnPrevActionPerformed + + private void jBtnReplaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnReplaceActionPerformed + jTglHighlight.setSelected(false); + String replacement = jCmbReplace.getSelectedItem() == null ? + "" : jCmbReplace.getSelectedItem().toString(); + dsd.doReplace(textComponent, replacement); + }//GEN-LAST:event_jBtnReplaceActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jBtnNext; + private javax.swing.JButton jBtnPrev; + private javax.swing.JButton jBtnReplace; + private javax.swing.JButton jBtnReplaceAll; + private javax.swing.JCheckBox jChkIgnoreCase; + private javax.swing.JCheckBox jChkRegex; + private javax.swing.JCheckBox jChkWrap; + private javax.swing.JComboBox jCmbFind; + private javax.swing.JComboBox jCmbReplace; + private javax.swing.JLabel jLblFind; + private javax.swing.JLabel jLblReplace; + private javax.swing.JToggleButton jTglHighlight; + // End of variables declaration//GEN-END:variables + + @Override + public void caretUpdate(CaretEvent e) { + updateHighlights(); + } + + @Override + public void escapePressed() { + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.form b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.form new file mode 100644 index 000000000..d6149fb66 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.form @@ -0,0 +1,113 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.java new file mode 100644 index 000000000..a020f2f52 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/actions/gui/ShowAbbsDialog.java @@ -0,0 +1,135 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.actions.gui; + +import java.util.Arrays; +import java.util.Map; +import javax.swing.JEditorPane; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.util.SwingUtils; + +/** + * Show abbreviations for a JEditorPane. + * + * @author Ayman Al-Sairafi + */ +public class ShowAbbsDialog + extends javax.swing.JDialog implements EscapeListener { + + /** + * Creates new form ShowAbbsDialog + * @param parent + * @param abbs + */ + public ShowAbbsDialog(JEditorPane parent, Map abbs) { + super(ActionUtils.getFrameFor(parent), true); + initComponents(); + Object[] abbsList = abbs.keySet().toArray(); + Arrays.sort(abbsList); + jLstAbbs.setListData(abbsList); + this.abbs = abbs; + jEdtAbbr.setEditorKit(parent.getEditorKit()); + jLstAbbs.setSelectedIndex(0); + SwingUtils.addEscapeListener(this); + setVisible(true); + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jSplitPane1 = new javax.swing.JSplitPane(); + jScrollPane1 = new javax.swing.JScrollPane(); + jLstAbbs = new javax.swing.JList(); + jScrollPane2 = new javax.swing.JScrollPane(); + jEdtAbbr = new javax.swing.JEditorPane(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Abbreviations"); + setLocationByPlatform(true); + setMinimumSize(new java.awt.Dimension(600, 300)); + setModal(true); + setName("dlgShowAbbs"); // NOI18N + + jSplitPane1.setDividerLocation(150); + jSplitPane1.setDividerSize(3); + + jScrollPane1.setPreferredSize(new java.awt.Dimension(258, 400)); + + jLstAbbs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jLstAbbs.addListSelectionListener(new javax.swing.event.ListSelectionListener() { + public void valueChanged(javax.swing.event.ListSelectionEvent evt) { + jLstAbbsValueChanged(evt); + } + }); + jScrollPane1.setViewportView(jLstAbbs); + + jSplitPane1.setLeftComponent(jScrollPane1); + + jEdtAbbr.setEditable(false); + jEdtAbbr.setMinimumSize(new java.awt.Dimension(106, 400)); + jScrollPane2.setViewportView(jEdtAbbr); + + jSplitPane1.setRightComponent(jScrollPane2); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 337, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void jLstAbbsValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jLstAbbsValueChanged + if (evt.getValueIsAdjusting() == false) { + Object selected = jLstAbbs.getSelectedValue(); + if (selected != null) { + jEdtAbbr.setText(abbs.get(selected.toString())); + } + } + }//GEN-LAST:event_jLstAbbsValueChanged + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JEditorPane jEdtAbbr; + private javax.swing.JList jLstAbbs; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JSplitPane jSplitPane1; + // End of variables declaration//GEN-END:variables + Map abbs; + + @Override + public void escapePressed() { + setVisible(false); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/LineNumbersRuler.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/LineNumbersRuler.java new file mode 100644 index 000000000..81c568760 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/LineNumbersRuler.java @@ -0,0 +1,322 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.components; + +import java.awt.Color; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import javax.swing.BorderFactory; +import javax.swing.JEditorPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.SyntaxView; +import jsyntaxpane.actions.ActionUtils; +import jsyntaxpane.actions.gui.GotoLineDialog; +import jsyntaxpane.util.Configuration; + +/** + * This class will display line numbers for a related text component. The text + * component must use the same line height for each line. + * + * This class was designed to be used as a component added to the row header + * of a JScrollPane. + * + * Original code from http://tips4java.wordpress.com/2009/05/23/text-component-line-number/ + * + * @author Rob Camick + * + * Revised for jsyntaxpane + * + * @author Ayman Al-Sairafi + */ +public class LineNumbersRuler extends JPanel + implements CaretListener, DocumentListener, PropertyChangeListener, SyntaxComponent { + + public static final String PROPERTY_BACKGROUND = "LineNumbers.Background"; + public static final String PROPERTY_FOREGROUND = "LineNumbers.Foreground"; + public static final String PROPERTY_CURRENT_BACK = "LineNumbers.CurrentBack"; + public static final String PROPERTY_LEFT_MARGIN = "LineNumbers.LeftMargin"; + public static final String PROPERTY_RIGHT_MARGIN = "LineNumbers.RightMargin"; + public static final String PROPERTY_Y_OFFSET = "LineNumbers.YOFFset"; + public static final int DEFAULT_R_MARGIN = 5; + public static final int DEFAULT_L_MARGIN = 5; + private Status status; + private final static int HEIGHT = Integer.MAX_VALUE - 1000000; + // Text component this TextTextLineNumber component is in sync with + private JEditorPane editor; + private int minimumDisplayDigits = 2; + // Keep history information to reduce the number of times the component + // needs to be repainted + private int lastDigits; + private int lastHeight; + private int lastLine; + private MouseListener mouseListener = null; + // The formatting to use for displaying numbers. Use in String.format(numbersFormat, line) + private String numbersFormat = "%3d"; + + private Color currentLineColor; + + /** + * Get the JscrollPane that contains this EditorPane, or null if no + * JScrollPane is the parent of this editor + * @param editorPane + * @return + */ + public JScrollPane getScrollPane(JTextComponent editorPane) { + Container p = editorPane.getParent(); + while (p != null) { + if (p instanceof JScrollPane) { + return (JScrollPane) p; + } + p = p.getParent(); + } + return null; + } + + @Override + public void config(Configuration config) { + int right = config.getInteger(PROPERTY_RIGHT_MARGIN, DEFAULT_R_MARGIN); + int left = config.getInteger(PROPERTY_LEFT_MARGIN, DEFAULT_L_MARGIN); + Color foreground = config.getColor(PROPERTY_FOREGROUND, Color.BLACK); + setForeground(foreground); + Color back = config.getColor(PROPERTY_BACKGROUND, Color.WHITE); + setBackground(back); + setBorder(BorderFactory.createEmptyBorder(0, left, 0, right)); + currentLineColor = config.getColor(PROPERTY_CURRENT_BACK, back); + } + + @Override + public void install(final JEditorPane editor) { + this.editor = editor; + + setFont(editor.getFont()); + + // setMinimumDisplayDigits(3); + + editor.getDocument().addDocumentListener(this); + editor.addCaretListener(this); + editor.addPropertyChangeListener(this); + JScrollPane sp = getScrollPane(editor); + sp.setRowHeaderView(this); + mouseListener = new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + GotoLineDialog.showForEditor(editor); + } + }; + addMouseListener(mouseListener); + status = Status.INSTALLING; + } + + @Override + public void deinstall(JEditorPane editor) { + removeMouseListener(mouseListener); + status = Status.DEINSTALLING; + this.editor.getDocument().removeDocumentListener(this); + editor.removeCaretListener(this); + editor.removePropertyChangeListener(this); + JScrollPane sp = getScrollPane(editor); + if (sp != null) { + editor.getDocument().removeDocumentListener(this); + sp.setRowHeaderView(null); + } + } + + /** + * Gets the minimum display digits + * + * @return the minimum display digits + */ + public int getMinimumDisplayDigits() { + return minimumDisplayDigits; + } + + /** + * Specify the minimum number of digits used to calculate the preferred + * width of the component. Default is 3. + * + * @param minimumDisplayDigits the number digits used in the preferred + * width calculation + */ + public void setMinimumDisplayDigits(int minimumDisplayDigits) { + this.minimumDisplayDigits = minimumDisplayDigits; + setPreferredWidth(); + } + + /** + * Calculate the width needed to display the maximum line number + */ + private void setPreferredWidth() { + int lines = ActionUtils.getLineCount(editor); + int digits = Math.max(String.valueOf(lines).length(), minimumDisplayDigits); + + // Update sizes when number of digits in the line number changes + + if (lastDigits != digits) { + lastDigits = digits; + numbersFormat = "%" + digits + "d"; + FontMetrics fontMetrics = getFontMetrics(getFont()); + int width = fontMetrics.charWidth('0') * digits; + Insets insets = getInsets(); + int preferredWidth = insets.left + insets.right + width; + + Dimension d = getPreferredSize(); + d.setSize(preferredWidth, HEIGHT); + setPreferredSize(d); + setSize(d); + + } + } + + /** + * Draw the line numbers + */ + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + + FontMetrics fontMetrics = editor.getFontMetrics(editor.getFont()); + Insets insets = getInsets(); + int currentLine = -1; + try { + // get current line, and add one as we start from 1 for the display + currentLine = ActionUtils.getLineNumber(editor, editor.getCaretPosition()) + 1; + } catch (BadLocationException ex) { + // this wont happen, even if it does, we can ignore it and we will not have + // a current line to worry about... + } + + int lh = fontMetrics.getHeight(); + int maxLines = ActionUtils.getLineCount(editor); + SyntaxView.setRenderingHits((Graphics2D) g); + + for (int line = 1; line <= maxLines; line++) { + String lineNumber = String.format(numbersFormat, line); + int y = line * lh; + if (line == currentLine) { + g.setColor(currentLineColor); + g.fillRect(0, y - lh + fontMetrics.getDescent() - 1, getWidth(), lh); + g.setColor(getForeground()); + g.drawString(lineNumber, insets.left, y); + } else { + g.drawString(lineNumber, insets.left, y); + } + } + } + +// +// Implement CaretListener interface +// + @Override + public void caretUpdate(CaretEvent e) { + // Get the line the caret is positioned on + + int caretPosition = editor.getCaretPosition(); + Element root = editor.getDocument().getDefaultRootElement(); + int currentLine = root.getElementIndex(caretPosition); + + // Need to repaint so the correct line number can be highlighted + + if (lastLine != currentLine) { + repaint(); + lastLine = currentLine; + } + } + +// +// Implement DocumentListener interface +// + @Override + public void changedUpdate(DocumentEvent e) { + documentChanged(); + } + + @Override + public void insertUpdate(DocumentEvent e) { + documentChanged(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + documentChanged(); + } + + /* + * A document change may affect the number of displayed lines of text. + * Therefore the lines numbers will also change. + */ + private void documentChanged() { + // Preferred size of the component has not been updated at the time + // the DocumentEvent is fired + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + int preferredHeight = editor.getPreferredSize().height; + + // Document change has caused a change in the number of lines. + // Repaint to reflect the new line numbers + + if (lastHeight != preferredHeight) { + setPreferredWidth(); + repaint(); + lastHeight = preferredHeight; + } + } + }); + } + + /** + * Implement PropertyChangeListener interface + */ + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getPropertyName().equals("document")) { + if (evt.getOldValue() instanceof SyntaxDocument) { + SyntaxDocument syntaxDocument = (SyntaxDocument) evt.getOldValue(); + syntaxDocument.removeDocumentListener(this); + } + if (evt.getNewValue() instanceof SyntaxDocument && status.equals(Status.INSTALLING)) { + SyntaxDocument syntaxDocument = (SyntaxDocument) evt.getNewValue(); + syntaxDocument.addDocumentListener(this); + setPreferredWidth(); + repaint(); + } + } else if (evt.getNewValue() instanceof Font) { + setPreferredWidth(); + repaint(); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/Markers.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/Markers.java new file mode 100644 index 000000000..e8979673c --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/Markers.java @@ -0,0 +1,139 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.components; + +import jsyntaxpane.actions.*; +import java.awt.Color; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Highlighter; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; + +/** + * This class contains static utility methods to make highliting in text + * components easier. + * + * @author Ayman Al-Sairafi + */ +public class Markers { + + // This subclass is used in our highlighting code + public static class SimpleMarker extends DefaultHighlighter.DefaultHighlightPainter { + + public SimpleMarker(Color color) { + super(color); + } + } + + /** + * Removes only our private highlights + * This is public so that we can remove the highlights when the editorKit + * is unregistered. SimpleMarker can be null, in which case all instances of + * our Markers are removed. + * @param component the text component whose markers are to be removed + * @param marker the SimpleMarker to remove + */ + public static void removeMarkers(JTextComponent component, SimpleMarker marker) { + Highlighter hilite = component.getHighlighter(); + Highlighter.Highlight[] hilites = hilite.getHighlights(); + + for (int i = 0; i < hilites.length; i++) { + if (hilites[i].getPainter() instanceof SimpleMarker) { + SimpleMarker hMarker = (SimpleMarker) hilites[i].getPainter(); + if (marker == null || hMarker.equals(marker)) { + hilite.removeHighlight(hilites[i]); + } + } + } + } + + /** + * Remove all the markers from an JEditorPane + * @param editorPane + */ + public static void removeMarkers(JTextComponent editorPane) { + removeMarkers(editorPane, null); + } + + /** + * add highlights for the given Token on the given pane + * @param pane + * @param token + * @param marker + */ + public static void markToken(JTextComponent pane, Token token, SimpleMarker marker) { + markText(pane, token.start, token.end(), marker); + } + + /** + * add highlights for the given region on the given pane + * @param pane + * @param start + * @param end + * @param marker + */ + public static void markText(JTextComponent pane, int start, int end, SimpleMarker marker) { + try { + Highlighter hiliter = pane.getHighlighter(); + int selStart = pane.getSelectionStart(); + int selEnd = pane.getSelectionEnd(); + // if there is no selection or selection does not overlap + if(selStart == selEnd || end < selStart || start > selStart) { + hiliter.addHighlight(start, end, marker); + return; + } + // selection starts within the highlight, highlight before slection + if(selStart > start && selStart < end ) { + hiliter.addHighlight(start, selStart, marker); + } + // selection ends within the highlight, highlight remaining + if(selEnd > start && selEnd < end ) { + hiliter.addHighlight(selEnd, end, marker); + } + + } catch (BadLocationException ex) { + // nothing we can do if the request is out of bound + LOG.log(Level.SEVERE, null, ex); + } + } + + /** + * Mark all text in the document that matches the given pattern + * @param pane control to use + * @param pattern pattern to match + * @param marker marker to use for highlighting + */ + public static void markAll(JTextComponent pane, Pattern pattern, SimpleMarker marker) { + SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(pane); + if(sDoc == null || pattern == null) { + return; + } + Matcher matcher = sDoc.getMatcher(pattern); + // we may not have any matcher (due to undo or something, so don't do anything. + if(matcher==null) { + return; + } + while(matcher.find()) { + markText(pane, matcher.start(), matcher.end(), marker); + } + } + + private static final Logger LOG = Logger.getLogger(Markers.class.getName()); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/PairsMarker.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/PairsMarker.java new file mode 100644 index 000000000..561e5abf0 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/PairsMarker.java @@ -0,0 +1,97 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.components; + +import java.awt.Color; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import jsyntaxpane.actions.*; +import javax.swing.JEditorPane; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.JTextComponent; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.util.Configuration; + +/** + * This class highlights any pairs of the given language. Pairs are defined + * with the Token.pairValue. + * + * @author Ayman Al-Sairafi + */ +public class PairsMarker implements CaretListener, SyntaxComponent, PropertyChangeListener { + + public static final String PROPERTY_COLOR = "PairMarker.Color"; + private JTextComponent pane; + private Markers.SimpleMarker marker; + private Status status; + + public PairsMarker() { + } + + @Override + public void caretUpdate(CaretEvent e) { + removeMarkers(); + int pos = e.getDot(); + SyntaxDocument doc = ActionUtils.getSyntaxDocument(pane); + Token token = doc.getTokenAt(pos); + if (token != null && token.pairValue != 0) { + Markers.markToken(pane, token, marker); + Token other = doc.getPairFor(token); + if (other != null) { + Markers.markToken(pane, other, marker); + } + } + } + + /** + * Remove all the highlights from the editor pane. This should be called + * when the editorkit is removed. + */ + public void removeMarkers() { + Markers.removeMarkers(pane, marker); + } + + @Override + public void config(Configuration config) { + Color markerColor = config.getColor(PROPERTY_COLOR, new Color(0xeeee33)); + this.marker = new Markers.SimpleMarker(markerColor); + } + + @Override + public void install(JEditorPane editor) { + pane = editor; + pane.addCaretListener(this); + status = Status.INSTALLING; + } + + @Override + public void deinstall(JEditorPane editor) { + status = Status.DEINSTALLING; + pane.removeCaretListener(this); + removeMarkers(); + } + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getPropertyName().equals("document")) { + pane.removeCaretListener(this); + if (status.equals(Status.INSTALLING)) { + pane.addCaretListener(this); + removeMarkers(); + } + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/SyntaxComponent.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/SyntaxComponent.java new file mode 100644 index 000000000..4095ba5cd --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/SyntaxComponent.java @@ -0,0 +1,55 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.components; + +import javax.swing.JEditorPane; +import jsyntaxpane.util.Configuration; + +/** + * A Component that is installed to the EditorKit to perform GUI operations + * on the Editor. + * + * @author Ayman Al-Sairafi + */ +public interface SyntaxComponent { + + /** + * Configure the component using the given properties. The keys + * needed for configuration will be prefixed by the given prefix + * @param config configuration data + */ + public void config(Configuration config); + + /** + * Called to install the component on an editor + * @param editor + */ + public void install(JEditorPane editor); + + /** + * Called when the component is to be removed from the editor + * @param editor + */ + public void deinstall(JEditorPane editor); + + /** + * The status is used to have proper propertyCHange support. We need to know if we are INSTALLING + * the component or DE-INSTALLING it + */ + static enum Status { + + INSTALLING, + DEINSTALLING + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/TokenMarker.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/TokenMarker.java new file mode 100644 index 000000000..2dd2d8bee --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/components/TokenMarker.java @@ -0,0 +1,146 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.components; + +import java.beans.PropertyChangeEvent; +import jsyntaxpane.actions.*; +import java.awt.Color; +import java.beans.PropertyChangeListener; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.logging.Logger; +import javax.swing.JEditorPane; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import jsyntaxpane.SyntaxDocument; +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; +import jsyntaxpane.util.Configuration; + +/** + * This class highlights Tokens within a document whenever the caret is moved + * to a TokenType provided in the config file. + * + * @author Ayman Al-Sairafi + */ +public class TokenMarker implements SyntaxComponent, CaretListener, PropertyChangeListener { + + public static final String DEFAULT_TOKENTYPES = "IDENTIFIER, TYPE, TYPE2, TYPE3"; + public static final String PROPERTY_COLOR = "TokenMarker.Color"; + public static final String PROPERTY_TOKENTYPES = "TokenMarker.TokenTypes"; + private static final Color DEFAULT_COLOR = new Color(0xFFEE66); + private JEditorPane pane; + private Set tokenTypes = new HashSet(); + private Markers.SimpleMarker marker; + private Status status; + + /** + * Constructs a new Token highlighter + */ + public TokenMarker() { + } + + @Override + public void caretUpdate(CaretEvent e) { + markTokenAt(e.getDot()); + } + + public void markTokenAt(int pos) { + SyntaxDocument doc = ActionUtils.getSyntaxDocument(pane); + if (doc != null) { + Token token = doc.getTokenAt(pos); + removeMarkers(); + if (token != null && tokenTypes.contains(token.type)) { + addMarkers(token); + } + } + } + + /** + * removes all markers from the pane. + */ + public void removeMarkers() { + Markers.removeMarkers(pane, marker); + } + + /** + * add highlights for the given pattern + * @param pattern + */ + void addMarkers(Token tok) { + SyntaxDocument sDoc = (SyntaxDocument) pane.getDocument(); + sDoc.readLock(); + // we need to create a STring, because the CharSequence does not have an + // equals method and Object.equals is called. It will not match + String text = tok.getText(sDoc).toString(); + Iterator it = sDoc.getTokens(0, sDoc.getLength()); + while (it.hasNext()) { + Token nextToken = it.next(); + String nextText = nextToken.getText(sDoc).toString(); + if (text.equals(nextText)) { + Markers.markToken(pane, nextToken, marker); + } + + } + sDoc.readUnlock(); + } + + @Override + public void config(Configuration config) { + Color markerColor = config.getColor( + PROPERTY_COLOR, DEFAULT_COLOR); + this.marker = new Markers.SimpleMarker(markerColor); + String types = config.getString( + PROPERTY_TOKENTYPES, DEFAULT_TOKENTYPES); + + for (String type : types.split("\\s*,\\s*")) { + try { + TokenType tt = TokenType.valueOf(type); + tokenTypes.add(tt); + } catch (IllegalArgumentException e) { + LOG.warning("Error in setting up TokenMarker " + + " - Invalid TokenType: " + type); + } + + } + } + + @Override + public void install(JEditorPane editor) { + this.pane = editor; + pane.addCaretListener(this); + markTokenAt(editor.getCaretPosition()); + status = Status.INSTALLING; + } + + @Override + public void deinstall(JEditorPane editor) { + status = Status.DEINSTALLING; + removeMarkers(); + pane.removeCaretListener(this); + } + private static final Logger LOG = Logger.getLogger(TokenMarker.class.getName()); + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getPropertyName().equals("document")) { + pane.removeCaretListener(this); + if (status.equals(Status.INSTALLING)) { + pane.addCaretListener(this); + removeMarkers(); + } + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/DefaultJFlexLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/DefaultJFlexLexer.java new file mode 100644 index 000000000..affa35078 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/DefaultJFlexLexer.java @@ -0,0 +1,159 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + +import java.io.CharArrayReader; +import jsyntaxpane.*; +import java.io.IOException; +import java.io.Reader; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.text.Segment; + +/** + * This is a default, and abstract implemenatation of a Lexer using JFLex + * with some utility methods that Lexers can implement. + * + * @author Ayman Al-Sairafi + */ +public abstract class DefaultJFlexLexer implements Lexer { + + protected int tokenStart; + protected int tokenLength; + protected int offset; + + /** + * Helper method to create and return a new Token from of TokenType + * tokenStart and tokenLength will be modified to the newStart and + * newLength params + * @param type + * @param tStart + * @param tLength + * @param newStart + * @param newLength + * @return + */ + protected Token token(TokenType type, int tStart, int tLength, + int newStart, int newLength) { + tokenStart = newStart; + tokenLength = newLength; + return new Token(type, tStart + offset, tLength); + } + + /** + * Create and return a Token of given type from start with length + * offset is added to start + * @param type + * @param start + * @param length + * @return + */ + protected Token token(TokenType type, int start, int length) { + return new Token(type, start + offset, length); + } + + /** + * Create and return a Token of given type. start is obtained from {@link yychar()} + * and length from {@link yylength()} + * offset is added to start + + * @param type + * @return + */ + protected Token token(TokenType type) { + return new Token(type, yychar() + offset, yylength()); + } + + /** + * Create and return a Token of given type and pairValue. + * start is obtained from {@link yychar()} + * and length from {@link yylength()} + * offset is added to start + * + * @param type + * @param pairValue + * @return + */ + protected Token token(TokenType type, int pairValue) { + return new Token(type, yychar() + offset, yylength(), (byte) pairValue); + } + + /** + * The DefaultJFlexLexer simply calls the yylex method of a JFLex compatible + * Lexer and adds the tokens obtained to an ArrayList. + */ + @Override + public void parse(Segment segment, int ofst, List tokens) { + try { + CharArrayReader reader = new CharArrayReader(segment.array, segment.offset, segment.count); + yyreset(reader); + this.offset = ofst; + for (Token t = yylex(); t != null; t = yylex()) { + tokens.add(t); + } + } catch (IOException ex) { + Logger.getLogger(DefaultJFlexLexer.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * This will be called to reset the the lexer. + * This is created automatically by JFlex. + * @param reader + */ + public abstract void yyreset(Reader reader); + + /** + * This is called to return the next Token from the Input Reader + * @return next token, or null if no more tokens. + * @throws java.io.IOException + */ + public abstract Token yylex() throws java.io.IOException; + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public abstract char yycharat(int pos); + + /** + * Returns the length of the matched text region. + * This method is automatically implemented by JFlex lexers + * @return + */ + public abstract int yylength(); + + /** + * Returns the text matched by the current regular expression. + * This method is automatically implemented by JFlex lexers + * @return + */ + public abstract String yytext(); + + /** + * Return the char number from beginning of input stream. + * This is NOT implemented by JFLex, so the code must be + * added to create this and return the private yychar field + * @return + */ + public abstract int yychar(); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/EmptyLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/EmptyLexer.java new file mode 100644 index 000000000..30d918dd6 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/EmptyLexer.java @@ -0,0 +1,30 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + +import jsyntaxpane.*; +import java.util.List; +import javax.swing.text.Segment; + +/** + * A lexer that does nothing. Used for plain document editing. + * @author Ayman Al-Sairafi + */ +public class EmptyLexer implements Lexer { + + @Override + public void parse(Segment segment, int ofst, List tokens) { + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/SimpleRegexLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/SimpleRegexLexer.java new file mode 100644 index 000000000..0068a08fc --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/lexers/SimpleRegexLexer.java @@ -0,0 +1,99 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.TreeSet; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.text.Segment; +import jsyntaxpane.Lexer; +import jsyntaxpane.Token; +import jsyntaxpane.TokenComparators; +import jsyntaxpane.TokenType; + +/** + * This is a "dynamic" Lexer that will use Regex patterns to parse any document, + * It is NOT as fast as other JFLex generated lexers. + * + * The current implementation is about 20x slower than a JFLex lexer + * (5000 lines in 100ms, vs 5ms for JFlex lexer) + * + * This is still usable for a few 100 lines. 500 lines parse in about 10ms. + * + * It also depends on how complex the Regexp and how many of them will actually + * provide a match. + * + * Since KEYWORD TokenType is by order less than IDENTIFIER, the higher + * precedence of KEYWORD token will be used, even if the same regex matches + * an IDENTIFIER. This is a neat side-effect of the ordering of the TokenTypes. + * We now just need to add any non-overlapping matches. And since longer matches + * are found first, we will properly match the longer identifiers which start with + * a keyword. + * + * This behaviour can easily be modified by overriding the {@link compareTo} method + * + * @author Ayman Al-Sairafi + */ +public class SimpleRegexLexer implements Lexer { + + public SimpleRegexLexer(Map props) { + putPatterns(props); + } + + public SimpleRegexLexer(String propsLocation) throws IOException { + Properties props = new Properties(); + props.load(new FileReader(propsLocation)); + putPatterns(props); + } + + @Override + public void parse(Segment segment, int ofst, List tokens) { + TreeSet allMatches = new TreeSet(TokenComparators.LONGEST_FIRST); + // add to ourset all the matches by all our regexes + for (Map.Entry e : patterns.entrySet()) { + Matcher m = e.getValue().matcher(segment); + while (m.find()) { + Token t = new Token(e.getKey(), m.start() + ofst, m.end() - m.start()); + allMatches.add(t); + } + } + int end = -1; + for (Token t : allMatches) { + if (t.start > end) { + tokens.add(t); + end = t.end(); + } + } + } + Map patterns = new HashMap(); + + public SimpleRegexLexer putPattern(TokenType type, String regex) { + patterns.put(type, Pattern.compile(regex)); + return this; + } + + public SimpleRegexLexer putPatterns(Map props) { + for (Object key : props.keySet()) { + TokenType t = TokenType.valueOf(key.toString()); + patterns.put(t, Pattern.compile(props.get(key).toString())); + } + return this; + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.java new file mode 100644 index 000000000..bb94d9778 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.java @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.ActionScriptLexer; + +/** + * + * @author JPEXS + */ +public class ActionScriptSyntaxKit extends DefaultSyntaxKit { + + public ActionScriptSyntaxKit() { + super(new ActionScriptLexer()); + } + + ActionScriptSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/BashSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/BashSyntaxKit.java new file mode 100644 index 000000000..27dfb75f4 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/BashSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.BashLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class BashSyntaxKit extends DefaultSyntaxKit { + + public BashSyntaxKit() { + super(new BashLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CSyntaxKit.java new file mode 100644 index 000000000..2be3481c7 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CSyntaxKit.java @@ -0,0 +1,38 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.CLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class CSyntaxKit extends DefaultSyntaxKit { + + public CSyntaxKit() { + super(new CLexer()); + } + + /** + * Construct a JavaSyntaxKit user the supplied lexer. This is protected so + * only subclasses may extend this with a new lexer. + * @param lexer + */ + CSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ClojureSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ClojureSyntaxKit.java new file mode 100644 index 000000000..d6a4bb79d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ClojureSyntaxKit.java @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.ClojureLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class ClojureSyntaxKit extends DefaultSyntaxKit { + + public ClojureSyntaxKit() { + super(new ClojureLexer()); + } + + public ClojureSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CppSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CppSyntaxKit.java new file mode 100644 index 000000000..c624968ce --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/CppSyntaxKit.java @@ -0,0 +1,27 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.lexers.CppLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class CppSyntaxKit extends CSyntaxKit { + + public CppSyntaxKit() { + super(new CppLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.java new file mode 100644 index 000000000..6e2e9e003 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.DOSBatchLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class DOSBatchSyntaxKit extends DefaultSyntaxKit { + + public DOSBatchSyntaxKit() { + super(new DOSBatchLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.java new file mode 100644 index 000000000..19fe5a092 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.java @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.Flasm3Lexer; + +/** + * @author JPEXS + */ +public class Flasm3SyntaxKit extends DefaultSyntaxKit { + + public Flasm3SyntaxKit() { + super(new Flasm3Lexer()); + } + + Flasm3SyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/FlasmSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/FlasmSyntaxKit.java new file mode 100644 index 000000000..b27e06df9 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/FlasmSyntaxKit.java @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.FlasmLexer; + +/** + * @author JPEXS + */ +public class FlasmSyntaxKit extends DefaultSyntaxKit { + + public FlasmSyntaxKit() { + super(new FlasmLexer()); + } + + FlasmSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/GroovySyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/GroovySyntaxKit.java new file mode 100644 index 000000000..4c482e525 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/GroovySyntaxKit.java @@ -0,0 +1,27 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.lexers.GroovyLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class GroovySyntaxKit extends JavaSyntaxKit { + + public GroovySyntaxKit() { + super(new GroovyLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JFlexSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JFlexSyntaxKit.java new file mode 100644 index 000000000..205350dc3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JFlexSyntaxKit.java @@ -0,0 +1,27 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.lexers.JFlexLexer; + +/** + * JFlex lexer + * @author Ayman Al-Sairafi + */ +public class JFlexSyntaxKit extends JavaSyntaxKit { + + public JFlexSyntaxKit() { + super(new JFlexLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.java new file mode 100644 index 000000000..63071d046 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.JavaScriptLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class JavaScriptSyntaxKit extends DefaultSyntaxKit { + + public JavaScriptSyntaxKit() { + super(new JavaScriptLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaSyntaxKit.java new file mode 100644 index 000000000..e78e035c1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/JavaSyntaxKit.java @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.JavaLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class JavaSyntaxKit extends DefaultSyntaxKit { + + public JavaSyntaxKit() { + super(new JavaLexer()); + } + + JavaSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/LuaSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/LuaSyntaxKit.java new file mode 100644 index 000000000..7aa860156 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/LuaSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.LuaLexer; + +/** + * + * @author Michael Leung + */ +public class LuaSyntaxKit extends DefaultSyntaxKit { + + public LuaSyntaxKit() { + super(new LuaLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PlainSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PlainSyntaxKit.java new file mode 100644 index 000000000..441e47759 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PlainSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.EmptyLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class PlainSyntaxKit extends DefaultSyntaxKit { + + public PlainSyntaxKit() { + super(new EmptyLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.java new file mode 100644 index 000000000..976437c26 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.PropertiesLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class PropertiesSyntaxKit extends DefaultSyntaxKit { + + public PropertiesSyntaxKit() { + super(new PropertiesLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PythonSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PythonSyntaxKit.java new file mode 100644 index 000000000..5668838f9 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/PythonSyntaxKit.java @@ -0,0 +1,29 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.PythonLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class PythonSyntaxKit extends DefaultSyntaxKit { + + public PythonSyntaxKit() { + super(new PythonLexer()); + } + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/RubySyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/RubySyntaxKit.java new file mode 100644 index 000000000..296e9a4b2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/RubySyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.RubyLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class RubySyntaxKit extends DefaultSyntaxKit { + + public RubySyntaxKit() { + super(new RubyLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ScalaSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ScalaSyntaxKit.java new file mode 100644 index 000000000..6f5c3f928 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/ScalaSyntaxKit.java @@ -0,0 +1,33 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.Lexer; +import jsyntaxpane.lexers.ScalaLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class ScalaSyntaxKit extends DefaultSyntaxKit { + + public ScalaSyntaxKit() { + super(new ScalaLexer()); + } + + public ScalaSyntaxKit(Lexer lexer) { + super(lexer); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/SqlSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/SqlSyntaxKit.java new file mode 100644 index 000000000..2dfcf5815 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/SqlSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.SqlLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class SqlSyntaxKit extends DefaultSyntaxKit { + + public SqlSyntaxKit() { + super(new SqlLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/TALSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/TALSyntaxKit.java new file mode 100644 index 000000000..31a55368b --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/TALSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.TALLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class TALSyntaxKit extends DefaultSyntaxKit { + + public TALSyntaxKit() { + super(new TALLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.java new file mode 100644 index 000000000..f3be11c46 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.XHTMLLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class XHTMLSyntaxKit extends DefaultSyntaxKit { + + public XHTMLSyntaxKit() { + super(new XHTMLLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XPathSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XPathSyntaxKit.java new file mode 100644 index 000000000..8c9640a37 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XPathSyntaxKit.java @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.XPathLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class XPathSyntaxKit extends DefaultSyntaxKit { + + public XPathSyntaxKit() { + super(new XPathLexer()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XmlSyntaxKit.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XmlSyntaxKit.java new file mode 100644 index 000000000..0a749e63e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/syntaxkits/XmlSyntaxKit.java @@ -0,0 +1,29 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.syntaxkits; + +import jsyntaxpane.DefaultSyntaxKit; +import jsyntaxpane.lexers.XmlLexer; + +/** + * + * @author Ayman Al-Sairafi + */ +public class XmlSyntaxKit extends DefaultSyntaxKit { + + public XmlSyntaxKit() { + super(new XmlLexer()); + } + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java new file mode 100644 index 000000000..d0875280d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java @@ -0,0 +1,379 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.util; + +import java.awt.Color; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Wrapper around the Properties class with supprt for Heirarchical confogurations + * and more functionality. + * + * Except for the getXXXX methods, all other Map Interface methods operate on the + * current (non-parent) collection and do NOT touch the parent. + * + * @author Ayman Al-Sairafi + */ +public class Configuration implements Map { + + /** + * Our parent + */ + Configuration parent; + /** + * Our Class for the configuration + */ + Class clazz; + /** + * The properties we have, excluding the parents defaults + */ + Map props; + + /** + * Creates a new COnfiguration that uses parent as its parent + * Configuration. + * + * @param theClass + * @param parent + */ + public Configuration(Class theClass, Configuration parent) { + this(theClass); + this.parent = parent; + } + + /** + * Creates an empty Configuration + * @param theClass + */ + public Configuration(Class theClass) { + super(); + this.clazz = theClass; + } + + /** + * Get a string from this object or one of its parents. If nothing + * is found, null is returned. + * If the Regex ${key} is found, then it is replaced by the value of that + * key within this (or parent's) map. + * Special COnstructs in ${}: + *
  • class_path will be replaced by the name of the + * Configuration (usually ClassName) with "." replaced by "/", and then + * converted to all lowercase
  • + *
  • class_simpleName
  • is replaced by class.SimpleName + * @param key + * @return + */ + public String getString(String key) { + String value = null; + if (props != null) { + value = props.get(key); + } + for (Configuration p = parent; value == null && p != null; p = p.parent) { + value = p.get(key); + } + // if we have a parent, then perform ${} replacements + if (value != null) { + Matcher m = PARENT_KEY.matcher(value); + StringBuffer sb = new StringBuffer(); + while (m.find()) { + String p_key = m.group(1); + String p_value = getString(p_key); + if (p_key.equals("class_path")) { + p_value = clazz.getName().replace(".", "/").toLowerCase(); + } else if (p_key.equals("class_simpleName")) { + p_value = clazz.getSimpleName(); + } else { + p_value = getString(p_key); + if (p_value == null) { + Logger.getLogger(this.getClass().getName()).warning( + "no value for ${" + p_key + + "} is defined"); + } + } + m.appendReplacement(sb, p_value); + } + m.appendTail(sb); + value = sb.toString(); + } + return value; + } + + /** + * Returns a non-null value either by traversing the current + * and parent(s) map, or returning the defaultValue + * @param key + * @param defaultValue + * @throws NullPointerException if defaultValue is null + * @return + */ + public String getString(String key, String defaultValue) { + if (defaultValue == null) { + throw new NullPointerException("defaultValue cannot be null"); + } + String value = getString(key); + return (value == null) ? defaultValue : value; + } + + /** + * Gets an integer from the properties. If number cannot be found + * or if it cannot be decoded, the default is returned + * The integer is decoded using {@link Integer.decode(String)} + * @param key + * @param Default + * @return + */ + public int getInteger(String key, int Default) { + String v = getString(key); + if (v == null) { + return Default; + } + try { + int i = Integer.decode(v); + return i; + } catch (NumberFormatException e) { + LOG.log(Level.WARNING, null, e); + return Default; + } + } + + /** + * Returns a String[] of the comma separated items in the value. + * + * Does NOT return null. If the key is not found, + * then an empty string array is returned. So the return of this method + * can always be used directly in a foreach loop + * @param key + * @return non-null String[] + */ + public String[] getPropertyList(String key) { + String v = getString(key); + if (v == null) { + return EMPTY_LIST; + } else { + return COMMA_SEPARATOR.split(v); + } + } + + /** + * Returns a boolean from the configuration + * @param key + * @param Default + * @return + */ + public boolean getBoolean(String key, boolean Default) { + String b = getString(key); + if (b == null) { + return Default; + } + return Boolean.parseBoolean(b.trim()); + } + + /** + * return the Color that has the given key or the Default + * @param key + * @param Default + * @return + */ + public Color getColor(String key, Color Default) { + String c = getString(key); + if (c == null) { + return Default; + } else { + try { + return Color.decode(c); + } catch (NumberFormatException e) { + return Default; + } + } + } + + @SuppressWarnings("unchecked") + @Override + public void putAll(Map config) { + if (props == null) { + props = new HashMap(); + } + props.putAll(config); + } + + /** + * Returns ALL property names from this Configuration's parents and + * this Configuration. As usual, parents are added first so they + * are overriden by children. + * + * @return Set of all String keys in this and parents + */ + public Set stringPropertyNames() { + Set propNames = new HashSet(); + if (parent != null) { + propNames.addAll(parent.stringPropertyNames()); + } + if (props != null) { + for (Object k : props.keySet()) { + propNames.add(k.toString()); + } + } + return propNames; + } + + @Override + public String put(String key, String value) { + if (props == null) { + props = new HashMap(); + } + Object old = props.put(key, value); + return (old == null) ? null : old.toString(); + } + + @Override + public int size() { + return (props == null) ? 0 : props.size(); + } + + @Override + public boolean isEmpty() { + return (props == null) ? true : props.isEmpty(); + } + + @Override + public boolean containsKey(Object key) { + return (props == null) ? false : props.containsKey(key); + } + + @Override + public boolean containsValue(Object value) { + return (props == null) ? false : props.containsValue(value); + } + + @Override + public String get(Object key) { + return (props == null) ? null : props.get(key); + } + + @Override + public String remove(Object key) { + if (props == null) { + return null; + } + Object old = props.remove(key); + return (old == null) ? null : old.toString(); + } + + @Override + public void clear() { + if (props != null) { + props.clear(); + } + } + + @Override + @SuppressWarnings("unchecked") + public Set keySet() { + if (props == null) { + return Collections.EMPTY_SET; + } else { + return props.keySet(); + } + } + + @Override + @SuppressWarnings("unchecked") + public Collection values() { + if (props == null) { + return Collections.EMPTY_SET; + } else { + return props.values(); + } + } + + @Override + @SuppressWarnings("unchecked") + public Set> entrySet() { + if (props == null) { + return Collections.EMPTY_SET; + } else { + return props.entrySet(); + } + } + + @Override + public String toString() { + return "Configuration " + clazz + " for " + parent; + } + + /** + * Utility class to hold data for {@link getKeys} method. + */ + public static class StringKeyMatcher { + + private StringKeyMatcher(String key, Matcher matcher, String group1, String value) { + this.key = key; + this.matcher = matcher; + this.group1 = group1; + this.value = value; + } + /** + * The full key matched + */ + public final String key; + /** + * matcher instance for the key + */ + public final Matcher matcher; + /** + * Matched group 1. Could be null if no Group 1 is found + */ + public final String group1; + /** + * Value for key matched + */ + public final String value; + } + + /** + * Obtain a set of all keys (and parent's keys) that match the given pattern. + * If no keys match, then an empty set is returned. + * Use this instead of the {@link stringPropertyNames} + * @param pattern + * @return + */ + public Set getKeys(Pattern pattern) { + Set matched = new HashSet(); + Set all = stringPropertyNames(); + for (String k : all) { + Matcher m = pattern.matcher(k); + if (m.matches()) { + StringKeyMatcher skm = new StringKeyMatcher(k, m, + (m.groupCount() >= 1) ? m.group(1) : null, + getString(k)); + matched.add(skm); + } + } + return matched; + } + public static final String[] EMPTY_LIST = new String[0]; + public static final Pattern COMMA_SEPARATOR = Pattern.compile("\\s*,\\s*"); + private static Pattern PARENT_KEY = Pattern.compile("\\$\\{(\\w+)\\}"); + private static final Logger LOG = Logger.getLogger(Configuration.class.getName()); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/JarServiceProvider.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/JarServiceProvider.java new file mode 100644 index 000000000..2ef1d5669 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/JarServiceProvider.java @@ -0,0 +1,238 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.util; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author subwiz + * @author Ayman Al-Sairafi + */ +public class JarServiceProvider { + + public static final String SERVICES_ROOT = "META-INF/services/"; + private static final Logger LOG = Logger.getLogger(JarServiceProvider.class.getName()); + + /** + * Prevent anyone from instantiating this class. + * Just use the static method + */ + private JarServiceProvider() { + } + + private static ClassLoader getClassLoader() { + ClassLoader cl = JarServiceProvider.class.getClassLoader(); + return cl == null ? ClassLoader.getSystemClassLoader() : cl; + } + + /** + * Return an Object array from the file in META-INF/resources/{classname} + * @param cls + * @return + * @throws java.io.IOException + */ + public static List getServiceProviders(Class cls) throws IOException { + ArrayList l = new ArrayList(); + ClassLoader cl = getClassLoader(); + String serviceFile = SERVICES_ROOT + cls.getName(); + Enumeration e = cl.getResources(serviceFile); + while (e.hasMoreElements()) { + URL u = e.nextElement(); + InputStream is = u.openStream(); + BufferedReader br = null; + try { + br = new BufferedReader( + new InputStreamReader(is, Charset.forName("UTF-8"))); + String str = null; + while ((str = br.readLine()) != null) { + int commentStartIdx = str.indexOf("#"); + if (commentStartIdx != -1) { + str = str.substring(0, commentStartIdx); + } + str = str.trim(); + if (str.length() == 0) { + continue; + } + try { + Object obj = cl.loadClass(str).newInstance(); + l.add(obj); + } catch (Exception ex) { + LOG.warning("Could not load: " + str); + LOG.warning(ex.getMessage()); + } + } + } finally { + if (br != null) { + br.close(); + } + } + } + return l; + } + + /** + * Read a file in the META-INF/services location. File name will be + * fully qualified classname, in all lower-case, appended with ".properties" + * If no file is found, then a an empty Property instance will be returned + * @param clazz + * @return Property file read. + */ + public static Properties readProperties(Class clazz) { + return readProperties(clazz.getName()); + } + + /** + * Read a file in the META-INF/services named name appended with + * ".properties" + * + * If no file is found, then a an empty Property instance will be returned + * @param name name of file (use dots to separate subfolders). + * @return Property file read. + */ + public static Properties readProperties(String name) { + Properties props = new Properties(); + String serviceFile = name.toLowerCase(); + if (!serviceFile.endsWith(".properties")) { + serviceFile += ".properties"; + } + InputStream is = findResource(serviceFile); + if (is != null) { + try { + props.load(is); + } catch (IOException ex) { + Logger.getLogger(JarServiceProvider.class.getName()).log(Level.SEVERE, null, ex); + } + } + return props; + } + + /** + * Read a file in the META-INF/services named name appended with + * ".properties", and returns it as a Map + * If no file is found, then a an empty Property instance will be returned + * @param name name of file (use dots to separate subfolders). + * @return Map of keys and values + */ + public static Map readStringsMap(String name) { + Properties props = readProperties(name); + HashMap map = new HashMap(); + if (props != null) { + for (Map.Entry e : props.entrySet()) { + map.put(e.getKey().toString(), e.getValue().toString()); + } + } + return map; + } + + /** + * Read the given URL and returns a List of Strings for each input line + * Each line will not have the line terminator. + * + * The resource is searched in /META-INF/services/url, then in + * url, then the url is treated as a location in the current classpath + * and an attempt to read it from that location is done. + * + * @param url location of file to read + * @return List of Strings for each line read. or EMPTY_LIST if URL is not found + */ + @SuppressWarnings("unchecked") + public static List readLines(String url) { + InputStream is = findResource(url); + if (is == null) { + return Collections.EMPTY_LIST; + } + List lines = new ArrayList(); + try { + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + for (String line = br.readLine(); line != null; line = br.readLine()) { + // Trim and unescape some control chars + line = line.trim().replace("\\n", "\n").replace("\\t", "\t"); + lines.add(line); + } + } catch (IOException ex) { + LOG.log(Level.SEVERE, null, ex); + } finally { + try { + is.close(); + } catch (IOException ex) { + LOG.log(Level.SEVERE, null, ex); + } + return lines; + } + + } + + /** + * Attempt to find a location url. The following locations are searched in + * sequence: + * url, + * SERVICES_ROOT/url + * all classpath/url + * @param url + * @param cl classloader + * @return InputSTream at that location, or null if not found + * @see JarServiceProvider#findResource(java.lang.String) + */ + public static InputStream findResource(String url, ClassLoader cl) { + InputStream is = null; + + URL loc = cl.getResource(url); + if (loc == null) { + loc = cl.getResource(url); + } + if (loc == null) { + loc = cl.getResource(SERVICES_ROOT + url); + } + if (loc == null) { + is = ClassLoader.getSystemResourceAsStream(url); + } else { + try { + is = loc.openStream(); + } catch (IOException ex) { + Logger.getLogger(JarServiceProvider.class.getName()).log(Level.SEVERE, null, ex); + } + } + return is; + } + + /** + * Attempt to find a location url. The following locations are searched in + * sequence: + * url, + * SERVICES_ROOT/url + * all classpath/url + * The System ClassLoader is used. + * @param url + * @return InputSTream at that location, or null if not found + * @see JarServiceProvider#findResource(java.lang.String, java.lang.ClassLoader) + */ + public static InputStream findResource(String url) { + return findResource(url, getClassLoader()); + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/ReflectUtils.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/ReflectUtils.java new file mode 100644 index 000000000..5ada9877e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/ReflectUtils.java @@ -0,0 +1,362 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.util; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Reflection Utility methods + * @author Ayman Al-Sairafi + */ +public class ReflectUtils { + + /** + * Adds all methods (from Class.getMethodCalls) to the list + * @param aClass + * @param list + * @return number of methods added + */ + public static int addMethods(Class aClass, List list) { + Method[] methods = aClass.getMethods(); + for (Method m : methods) { + list.add(m); + } + return methods.length; + } + + /** + * Adds all static methods (from Class.getMethodCalls) to the list + * @param aClass + * @param list + * @return number of methods added + */ + public static int addStaticMethods(Class aClass, List list) { + Method[] methods = aClass.getMethods(); + for (Method m : methods) { + if (Modifier.isStatic(m.getModifiers())) { + list.add(m); + } + } + return methods.length; + } + + /** + * Adds all static Fields (from Class.getFields) to the list + * @param aClass + * @param list + * @return number of fields added + */ + public static int addStaticFields(Class aClass, List list) { + Field[] fields = aClass.getFields(); + for (Field f : fields) { + if (Modifier.isStatic(f.getModifiers())) { + list.add(f); + } + } + return fields.length; + } + + /** + * Adds all Fields (from Class.getFields) to the list + * @param aClass + * @param list + * @return number of fields added + */ + public static int addFields(Class aClass, List list) { + Field[] fields = aClass.getFields(); + for (Field f : fields) { + list.add(f); + } + return fields.length; + } + + /** + * Adds all Constructor (from Class.getConstructorCalls) to the list + * @param aClass + * @param list + * @return number of constructors added + */ + public static int addConstrcutors(Class aClass, List list) { + Constructor[] constructors = aClass.getConstructors(); + for (Constructor c : constructors) { + list.add(c); + } + return constructors.length; + } + + /** + * Convert the constructor to a Java Code String + * (arguments are replaced by the simple types) + * @param c Constructor + * @return + */ + public static String getJavaCallString(Constructor c) { + StringBuilder call = new StringBuilder(); + call.append(c.getDeclaringClass().getSimpleName()); + addParamsString(call, c.getParameterTypes()); + return call.toString(); + } + + /** + * Convert the Method to a Java Code String + * (arguments are replaced by the simple types) + * @param method Method + * @return + */ + public static String getJavaCallString(Method method) { + StringBuilder call = new StringBuilder(); + call.append(method.getName()); + addParamsString(call, method.getParameterTypes()); + return call.toString(); + } + + /** + * Adds the class SimpleNames, comma sepearated and surrounded by paranthesis to the + * call StringBuffer + * @param call + * @param params + * @return + */ + public static StringBuilder addParamsString(StringBuilder call, Class[] params) { + call.append("("); + boolean firstArg = true; + for (Class arg : params) { + if (firstArg) { + firstArg = false; + } else { + call.append(", "); + } + call.append(arg.getSimpleName()); + } + call.append(")"); + return call; + } + + /** + * Gets a String array of all method calls for the given class + * @param aClass + * @return + */ + public static String[] getMethodCalls(Class aClass) { + String[] methods = new String[aClass.getMethods().length]; + int i = 0; + for (Method method : aClass.getMethods()) { + methods[i++] = getJavaCallString(method); + } + return methods; + } + + /** + * Gets an array of all Constructor calls for the given class + * @param aClass + * @return + */ + public static String[] getConstructorCalls(Class aClass) { + Constructor[] constructors = aClass.getConstructors(); + String[] cons = new String[constructors.length]; + int i = 0; + for (Constructor c : constructors) { + cons[i++] = getJavaCallString(c); + } + return cons; + } + + /** + * Return a paranthesis enclosed, comma sepearated String of all + * SimpleClass names in params. + * @param params + * @return + */ + public static String getParamsString(Class[] params) { + StringBuilder sb = new StringBuilder(); + addParamsString(sb, params); + return sb.toString(); + } + + /** + * Scans all classes accessible from the context class loader which belong to the given package and subpackages. + * + * @param packageName The base package + * @return The classes + * @throws ClassNotFoundException + * @throws IOException + */ + private static Class[] getClasses(String packageName) + throws ClassNotFoundException, IOException { +// ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + assert classLoader != null; + String path = packageName.replace('.', '/'); + Enumeration resources = classLoader.getResources(path); + List dirs = new ArrayList(); + while (resources.hasMoreElements()) { + URL resource = resources.nextElement(); + dirs.add(new File(resource.getFile())); + } + ArrayList classes = new ArrayList(); + for (File directory : dirs) { + classes.addAll(findClasses(directory, packageName)); + } + return classes.toArray(new Class[classes.size()]); + } + + /** + * Recursive method used to find all classes in a given directory and subdirs. + * + * @param directory The base directory + * @param packageName The package name for classes found inside the base directory + * @return The classes + * @throws ClassNotFoundException + */ + private static List findClasses(File directory, String packageName) throws ClassNotFoundException { + List classes = new ArrayList(); + if (!directory.exists()) { + return classes; + } + File[] files = directory.listFiles(); + for (File file : files) { + if (file.isDirectory()) { + assert !file.getName().contains("."); + classes.addAll(findClasses(file, packageName + "." + file.getName())); + } else if (file.getName().endsWith(".class")) { + classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6))); + } + } + return classes; + } + + /** + * Attempt to find the given className within any of the packages. + * If the class is not found, then null is returned + * @param className Fully or partially qualified classname within any of the packages + * @param packages List of packages for search + * @return CLass object or null if not found. + */ + public static Class findClass(String className, List packages) { + try { + return Class.forName(className); + } catch (ClassNotFoundException ex) { + } catch (NoClassDefFoundError ex) { + } + for (String pack : packages) { + try { + return Class.forName(pack + "." + className); + } catch (ClassNotFoundException ex) { + } catch (NoClassDefFoundError ex) { + } + } + return null; + } + + /** + * Find a setter method for the give object's property and try to call it. + * No exceptions are thrown. You typically call this method because either + * you are sure no exceptions will be thrown, or to silently ignore + * any that may be thrown. + * This will also find a setter that accepts an interface that the value + * implements. + * This is still not very effcient and should only be called if + * performance is not of an issue. + * You can check the return value to see if the call was seuccessful or + * not. + * @param obj Object to receive the call + * @param property property name (without set. First letter will be + * capitalized) + * @param value Value of the property. + * @return + */ + public static boolean callSetter(Object obj, String property, Object value) { + String key = String.format("%s.%s(%s)", obj.getClass().getName(), + property, value.getClass().getName()); + Method m = null; + boolean result = false; + if(!SETTERS_MAP.containsKey(key)) { + m = findMethod(obj, property, value); + SETTERS_MAP.put(key, m); + } else { + m = SETTERS_MAP.get(key); + } + if(m != null) { + try { + m.invoke(obj, value); + result = true; + } catch (IllegalAccessException ex) { + Logger.getLogger(ReflectUtils.class.getName()).log(Level.SEVERE, null, ex); + } catch (IllegalArgumentException ex) { + Logger.getLogger(ReflectUtils.class.getName()).log(Level.SEVERE, null, ex); + } catch (InvocationTargetException ex) { + Logger.getLogger(ReflectUtils.class.getName()).log(Level.SEVERE, null, ex); + } + } + return result; + } + + private static synchronized Method findMethod(Object obj, + String property, Object value) { + Method m = null; + Class theClass = obj.getClass(); + String setter = String.format("set%C%s", + property.charAt(0), property.substring(1)); + Class paramType = value.getClass(); + while (paramType != null) { + try { + m = theClass.getMethod(setter, paramType); + return m; + } catch (NoSuchMethodException ex) { + // try on the interfaces of this class + for (Class iface : paramType.getInterfaces()) { + try { + m = theClass.getMethod(setter, iface); + return m; + } catch (NoSuchMethodException ex1) { + } + } + paramType = paramType.getSuperclass(); + } + } + return m; + } + public static final List DEFAULT_PACKAGES = new ArrayList(3); + + static { + DEFAULT_PACKAGES.add("java.lang"); + DEFAULT_PACKAGES.add("java.util"); + DEFAULT_PACKAGES.add("jsyntaxpane"); + } + /** + * To speed up find setter methods, this map will be used. + * The Key String will be of the format objectClass.property(valueclass) + * Where: + * objectClass = obj.getClass().getName + * property = property (as passed in to callSetter), before set is appended + * valueCLass = value.getClass().getName() + * The Method will be either the method, or null if a search was not and no + * method is found. + */ + private static HashMap SETTERS_MAP = new HashMap(); +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/StringUtils.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/StringUtils.java new file mode 100644 index 000000000..50c09c01f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/StringUtils.java @@ -0,0 +1,60 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.util; + +import java.io.Serializable; +import java.util.Comparator; + +/** + * Don't we all need one of those? + * + * @author Ayman Al-Sairafi + */ +public class StringUtils { + + /** + * Perfrom a String startsWith match with support for CamelCase. + * @param word full word + * @param abbr abbriviated word + * @return true if the word startsWith abbr, or if any uppercase char in abbr + * matches the next uppercase char in word + * + * FIXME: not so effecient as it creates a StringBuilder, but works + * FIXME: add {@code Comparator} + */ + public static boolean camelCaseMatch(String word, String abbr) { + StringBuilder sb = new StringBuilder(); + sb.append(word.charAt(0)); + for (int i = 1; i < word.length(); i++) { + char c = word.charAt(i); + if (Character.isUpperCase(c)) { + sb.append(c); + } + } + String cc = sb.toString(); + if (cc.startsWith(abbr)) { + return true; + } else { + return word.startsWith(abbr); + } + } + + static class CamelCaseCompare implements Comparator, Serializable { + + @Override + public int compare(String o1, String o2) { + throw new UnsupportedOperationException("Not supported yet."); + } + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/SwingUtils.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/SwingUtils.java new file mode 100644 index 000000000..0e7991b67 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/SwingUtils.java @@ -0,0 +1,49 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.util; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import javax.swing.JComponent; +import javax.swing.KeyStroke; +import jsyntaxpane.actions.gui.EscapeListener; + +/** + * As always, some general purpose handy Swing Utility methods + * @author Ayman Al-Sairafi + */ +public class SwingUtils { + + /** + * FIXME: These two addEscapeListener can be called on a new interface + * that implements RootPainCOntainer (Swing) and a new method that + * is called + * @param dialog + */ + public static void addEscapeListener(final EscapeListener dialog) { + ActionListener escListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + dialog.escapePressed(); + } + }; + + dialog.getRootPane().registerKeyboardAction(escListener, + KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), + JComponent.WHEN_IN_FOCUSED_WINDOW); + + } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex new file mode 100644 index 000000000..c4db6e2e2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex @@ -0,0 +1,266 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class ActionScriptLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ActionScriptLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctDigit = [0-7] + +/* floating point literals */ +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL + +%% + + { + + /* keywords */ + "abstract" | + "boolean" | + "break" | + "case" | + "catch" | + "char" | + "class" | + "const" | + "continue" | + "do" | + "else" | + "extends" | + "final" | + "finally" | + "for" | + "default" | + "implements" | + "import" | + "instanceof" | + "interface" | + "new" | + "if" | + "public" | + "super" | + "switch" | + "package" | + "private" | + "protected" | + "return" | + "void" | + "static" | + "while" | + "this" | + "throw" | + "throws" | + "try" | + "var" | + + "true" | + "false" | + "NaN" | + "function" | + "dynamic" | + "override" | +"with" | +"each" | + "null" { return token(TokenType.KEYWORD); } + + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + + {HexIntegerLiteral} | + + {OctIntegerLiteral} | + + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + // JavaDoc comments need a state so that we can highlight the @ controls + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/bash.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/bash.flex new file mode 100644 index 000000000..98e8d1791 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/bash.flex @@ -0,0 +1,365 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class BashLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public BashLexer() { + super(); + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte DO = 4; + private static final byte CASE = 5; + private static final byte IF = 5; + private static final byte INT_EXPR = 6; + + @Override + public int yychar() { + return yychar; + } + +%} + +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +Identifier = [a-zA-Z][a-zA-Z0-9_]* + +Comment = "#" {InputCharacter}* {LineTerminator}? +Shebang = "#!" {InputCharacter}* {LineTerminator}? + +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] +BackQuoteChars = [^\r\n\`\\] + + +%% + + +{ + /* Bash keywords */ + "if" { return token(TokenType.KEYWORD, IF); } + "fi" { return token(TokenType.KEYWORD, -IF); } + "do" { return token(TokenType.KEYWORD, DO); } + "done" { return token(TokenType.KEYWORD, -DO); } + "case" { return token(TokenType.KEYWORD, CASE); } + "esac" { return token(TokenType.KEYWORD, -CASE); } + "$((" { return token(TokenType.KEYWORD, INT_EXPR); } + "))" { return token(TokenType.KEYWORD, -INT_EXPR); } + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + "-eq" | + "-ne" | + "-lt" | + "-gt" | + "-ge" | + "-le" | + ">=" | + "<=" | + "==" | + "!=" | + "-z" | + "-n" | + "=~" | + + "$" | + "#" | + "&" | + "." | + ";" | + "+" | + "-" | + "=" | + "/" | + "++" | + "@" { return token(TokenType.OPERATOR); } + + "then" | + "else" | + "elif" | + "for" | + "in" | + "until" | + "while" | + "break" | + "local" | + "continue" { return token(TokenType.KEYWORD); } + + /* string literal */ + \"{StringCharacter}+\" | + + \'{SingleCharacter}+\ { return token(TokenType.STRING); } + + \`{BackQuoteChars}+\` { return token(TokenType.STRING2); } + + + /* Other commands */ + "alias" | + "apropos" | + "apt" | + "aspell" | + "awk" | + "bash" | + "basename" | + "bc" | + "bg" | + "builtin" | + "bzip2" | + "cal" | + "cat" | + "cd" | + "cfdisk" | + "chgrp" | + "chmod" | + "chown" | + "chroot" | + "chkconfig" | + "cksum" | + "clear" | + "cmp" | + "comm" | + "command" | + "continue" | + "cp" | + "cron" | + "crontab" | + "csplit" | + "cut" | + "date" | + "dc" | + "dd" | + "ddrescue" | + "declare" | + "df" | + "diff" | + "diff3" | + "dig" | + "dir" | + "dircolors" | + "dirname" | + "dirs" | + "dmesg" | + "du" | + "echo" | + "egrep" | + "eject" | + "enable" | + "env" | + "ethtool" | + "eval" | + "exec" | + "exit" | + "expect" | + "expand" | + "export" | + "expr" | + "false" | + "fdformat" | + "fdisk" | + "fg" | + "fgrep" | + "file" | + "find" | + "fmt" | + "fold" | + "format" | + "free" | + "fsck" | + "ftp" | + "function" | + "gawk" | + "getopts" | + "grep" | + "groups" | + "gzip" | + "hash" | + "head" | + "history" | + "hostname" | + "id" | + "ifconfig" | + "ifdown" | + "ifup" | + "import" | + "install" | + "join" | + "kill" | + "killall" | + "less" | + "let" | + "ln" | + "locate" | + "logname" | + "logout" | + "look" | + "lpc" | + "lpr" | + "lprint" | + "lprintd" | + "lprintq" | + "lprm" | + "ls" | + "lsof" | + "man" | + "mkdir" | + "mkfifo" | + "mkisofs" | + "mknod" | + "more" | + "mount" | + "mtools" | + "mv" | + "mmv" | + "netstat" | + "nice" | + "nl" | + "nohup" | + "nslookup" | + "open" | + "op" | + "passwd" | + "paste" | + "pathchk" | + "ping" | + "popd" | + "pr" | + "printcap" | + "printenv" | + "printf" | + "ps" | + "pushd" | + "pwd" | + "quota" | + "quotacheck" | + "quotactl" | + "ram" | + "rcp" | + "read" | + "readonly" | + "reboot" | + "renice" | + "remsync" | + "return" | + "rev" | + "rm" | + "rmdir" | + "rsync" | + "screen" | + "scp" | + "sdiff" | + "sed" | + "select" | + "seq" | + "set" | + "sftp" | + "shift" | + "shopt" | + "shutdown" | + "sleep" | + "slocate" | + "sort" | + "source" | + "split" | + "ssh" | + "strace" | + "su" | + "sudo" | + "sum" | + "symlink" | + "sync" | + "tail" | + "tar" | + "tee" | + "test" | + "time" | + "times" | + "touch" | + "top" | + "traceroute" | + "trap" | + "tr" | + "true" | + "tsort" | + "tty" | + "type" | + "ulimit" | + "umask" | + "umount" | + "unalias" | + "uname" | + "unexpand" | + "uniq" | + "units" | + "unset" | + "unshar" | + "useradd" | + "usermod" | + "users" | + "uuencode" | + "uudecode" | + "v" | + "vdir" | + "vi" | + "vmstat" | + "watch" | + "wc" | + "whereis" | + "which" | + "who" | + "whoami" | + "Wget" | + "write" | + "xargs" | + "yes" { return token(TokenType.KEYWORD); } + + {Identifier} { return token(TokenType.IDENTIFIER); } + + /* labels */ + ":" [a-zA-Z][a-zA-Z0-9_]* { return token(TokenType.TYPE); } + + /* comments */ + {Shebang} { return token(TokenType.COMMENT2); } + {Comment} { return token(TokenType.COMMENT); } + . | {LineTerminator} { /* skip */ } + +} + +<> { return null; } \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/c.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/c.flex new file mode 100644 index 000000000..e394822bc --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/c.flex @@ -0,0 +1,241 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Copyright 2006 Arnout Engelen . + * Copyright 2000-2006 Omnicore Software, Hans Kratz & Dennis Strein GbR, + * Geert Bevin . + * Distributed under the terms of either: + * - the common development and distribution license (CDDL), v1.0; or + * - the GNU Lesser General Public License, v2.1 or later + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class CLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + + public CLexer() { + super(); + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + @Override + public int yychar() { + return yychar; + } +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ + +ConstantIdentifier = {SimpleConstantIdentifier} +SimpleConstantIdentifier = [#A-Z0-9_]+ + +Identifier = [:jletter:][:jletterdigit:]* + +TypeIdentifier = {SimpleTypeIdentifier} +SimpleTypeIdentifier = [A-Z][:jletterdigit:]* + +/* int literals */ + +DecLiteral = 0 | [1-9][0-9]* {IntegerSuffix} + +HexLiteral = 0 [xX] 0* {HexDigit}* {IntegerSuffix} +HexDigit = [0-9a-fA-F] + +OctLiteral = 0+ {OctDigit}* {IntegerSuffix} +OctDigit = [0-7] + +IntegerSuffix = [uU]? [lL]? [uU]? + +/* float literals */ + +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}|{FLit4}) ([fF]|[dD])? + +FLit1 = [0-9]+ \. [0-9]* {Exponent}? +FLit2 = \. [0-9]+ {Exponent}? +FLit3 = [0-9]+ {Exponent} +FLit4 = [0-9]+ {Exponent}? + +Exponent = [eE] [+\-]? [0-9]+ + +%% + + { + + /* keywords */ + "break" | + "case" | + "catch" | + "continue" | + "default" | + "do" | + "else" | + "for" | + "goto" | + "enum" | + "if" | + "inline" | + "mutable" | + "noinline" | + "return" | + "safecast" | + "sealed" | + "selectany" | + "sizeof" | + "static_cast" | + "switch" | + "template" | + "this" | + "thread" | + "throw" | + "try" | + "typedef" | + "typeid" | + "typename" | + "using" | + "uuid" | + "value" | + "virtual" | + "while" + { return token(TokenType.KEYWORD); } + + "static" | + "struct" | + "union" | + "volatile" | + "register" | + "extern" | + "const" | + "signed" | + "unsigned" | + "bool" | + "char" | + "double" | + "int" | + "long" | + "float" | + "short" | + "void" { return token(TokenType.TYPE); } + + /* literals */ + + + (\" ( [^\"\n\\] | \\[^\n] )* (\n | \\\n | \")) | + (\' ( [^\'\n\\] | \\[^\n] )* (\n | \\\n | \')) + { return token(TokenType.STRING); } + + "true" | + "false" | + {DecLiteral} | + {OctLiteral} | + {HexLiteral} | + + {FloatLiteral} + { return token(TokenType.NUMBER); } + + /* preprocessor symbols */ + "#define" | + "#elif" | + "#else" | + "#endif" | + "#error" | + "#ifdef" | + "#ifndef" | + "#if" | + "#import" | + "#include" | + "#line" | + "#pragma" | + "#undef" | + "#using" + { return token(TokenType.KEYWORD2); } + + + /* separators */ + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + /* operators */ + "=" | + ";" | + "," | + "." | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + ">>" | + "<<" | + "%" { return token(TokenType.OPERATOR); } + + {ConstantIdentifier} { return token(TokenType.IDENTIFIER); } + + {TypeIdentifier} { return token(TokenType.IDENTIFIER); } + + \n | + {Identifier} | + {WhiteSpace} { return token(TokenType.IDENTIFIER); } + + + + {Comment} { return token(TokenType.COMMENT); } + +} + + + +/* error fallback */ +.|\n { } +<> { return null; } diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/clojure.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/clojure.flex new file mode 100644 index 000000000..7b0216676 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/clojure.flex @@ -0,0 +1,496 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class ClojureLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ClojureLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {EndOfLineComment} + +EndOfLineComment = ";" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL + +%% + + { + + /* keywords */ + "fn" | + "fn*" | + "if" | + "def" | + "let" | + "let*" | + "loop*" | + "new" | + "nil" | + "recur" | + "loop" | + "do" | + "quote" | + "the-var" | + "identical?" | + "throw" | + "set!" | + "monitor-enter" | + "monitor-exit" | + "try" | + "catch" | + "finally" | + "in-ns" { return token(TokenType.KEYWORD); } + + /* Built-ins */ + "*agent*" | + "*command-line-args*" | + "*in*" | + "*macro-meta*" | + "*ns*" | + "*out*" | + "*print-meta*" | + "*print-readably*" | + "*proxy-classes*" | + "*warn-on-reflection*" | + "+" | + "-" | + "->" | + ".." | + "/" | + "<" | + "<=" | + "=" | + "==" | + ">" | + ">=" | + "accessor" | + "agent" | + "agent-errors" | + "aget" | + "alength" | + "all-ns" | + "alter" | + "and" | + "apply" | + "array-map" | + "aset" | + "aset-boolean" | + "aset-byte" | + "aset-char" | + "aset-double" | + "aset-float" | + "aset-int" | + "aset-long" | + "aset-short" | + "assert" | + "assoc" | + "await" | + "await-for" | + "bean" | + "binding" | + "bit-and" | + "bit-not" | + "bit-or" | + "bit-shift-left" | + "bit-shift-right" | + "bit-xor" | + "boolean" | + "butlast" | + "byte" | + "cast" | + "char" | + "class" | + "clear-agent-errors" | + "comment" | + "commute" | + "comp" | + "comparator" | + "complement" | + "concat" | + "cond" | + "conj" | + "cons" | + "constantly" | + "construct-proxy" | + "contains?" | + "count" | + "create-ns" | + "create-struct" | + "cycle" | + "dec" | + "defmacro" | + "defmethod" | + "defmulti" | + "defn" | + "defn-" | + "defstruct" | + "deref" | + "destructure" | + "disj" | + "dissoc" | + "distinct" | + "doall" | + "doc" | + "dorun" | + "doseq" | + "dosync" | + "dotimes" | + "doto" | + "double" | + "drop" | + "drop-while" | + "ensure" | + "eval" | + "every?" | + "false?" | + "ffirst" | + "file-seq" | + "filter" | + "find" | + "find-doc" | + "find-ns" | + "find-var" | + "first" | + "float" | + "flush" | + "fnseq" | + "for" | + "frest" | + "gensym" | + "gen-class" | + "gen-interface" | + "get" | + "get-proxy-class" | + "hash-map" | + "hash-set" | + "identity" | + "if-let" | + "import" | + "inc" | + "instance?" | + "int" | + "interleave" | + "into" | + "into-array" | + "iterate" | + "key" | + "keys" | + "keyword" | + "keyword?" | + "last" | + "lazy-cat" | + "lazy-cons" | + "line-seq" | + "list" | + "list*" | + "load" | + "load-file" | + "locking" | + "long" | + "macroexpand" | + "macroexpand-1" | + "make-array" | + "map" | + "map?" | + "mapcat" | + "max" | + "max-key" | + "memfn" | + "merge" | + "merge-with" | + "meta" | + "min" | + "min-key" | + "name" | + "namespace" | + "neg?" | + "newline" | + "nil?" | + "not" | + "not-any?" | + "not-every?" | + "not=" | + "ns-imports" | + "ns-interns" | + "ns-map" | + "ns-name" | + "ns-publics" | + "ns-refers" | + "ns-resolve" | + "ns-unmap" | + "nth" | + "nthrest" | + "or" | + "partial" | + "peek" | + "pmap" | + "pop" | + "pos?" | + "pr" | + "pr-str" | + "print" | + "print-doc" | + "print-str" | + "println" | + "println-str" | + "prn" | + "prn-str" | + "proxy" | + "proxy-mappings" | + "quot" | + "rand" | + "rand-int" | + "range" | + "re-find" | + "re-groups" | + "re-matcher" | + "re-matches" | + "re-pattern" | + "re-seq" | + "read" | + "read-line" | + "reduce" | + "ref" | + "ref-set" | + "refer" | + "rem" | + "remove-method" | + "remove-ns" | + "repeat" | + "replace" | + "replicate" | + "require" | + "resolve" | + "rest" | + "resultset-seq" | + "reverse" | + "rfirst" | + "rrest" | + "rseq" | + "scan" | + "second" | + "select-keys" | + "send" | + "send-off" | + "seq" | + "seq?" | + "set" | + "short" | + "slurp" | + "some" | + "sort" | + "sort-by" | + "sorted-map" | + "sorted-map-by" | + "sorted-set" | + "special-symbol?" | + "split-at" | + "split-with" | + "str" | + "string?" | + "struct" | + "struct-map" | + "subs" | + "subvec" | + "symbol" | + "symbol?" | + "sync" | + "take" | + "take-nth" | + "take-while" | + "test" | + "time" | + "to-array" | + "to-array-2d" | + "touch" | + "tree-seq" | + "true?" | + "update-proxy" | + "val" | + "vals" | + "var-get" | + "var-set" | + "var?" | + "vector" | + "vector?" | + "when" | + "when-first" | + "when-let" | + "when-not" | + "while" | + "with-local-vars" | + "with-meta" | + "with-open" | + "with-out-str" | + "xml-seq" | + "zero?" | + "zipmap" | + "repeatedly" | + "add-classpath" | + "vec" | + "hash" { return token(TokenType.KEYWORD2); } + + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/cpp.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/cpp.flex new file mode 100644 index 000000000..f7393cb62 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/cpp.flex @@ -0,0 +1,274 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Copyright 2006 Arnout Engelen . + * Copyright 2000-2006 Omnicore Software, Hans Kratz & Dennis Strein GbR, + * Geert Bevin . + * Distributed under the terms of either: + * - the common development and distribution license (CDDL), v1.0; or + * - the GNU Lesser General Public License, v2.1 or later + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class CppLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + + public CppLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ + +ConstantIdentifier = {SimpleConstantIdentifier} +SimpleConstantIdentifier = [#A-Z0-9_]+ + +Identifier = [:jletter:][:jletterdigit:]* + +/* int literals */ + +DecLiteral = 0 | [1-9][0-9]* {IntegerSuffix} + +HexLiteral = 0 [xX] 0* {HexDigit}* {IntegerSuffix} +HexDigit = [0-9a-fA-F] + +OctLiteral = 0+ {OctDigit}* {IntegerSuffix} +OctDigit = [0-7] + +IntegerSuffix = [uU]? [lL]? [uU]? + +/* float literals */ + +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}|{FLit4}) ([fF]|[dD])? + +FLit1 = [0-9]+ \. [0-9]* {Exponent}? +FLit2 = \. [0-9]+ {Exponent}? +FLit3 = [0-9]+ {Exponent} +FLit4 = [0-9]+ {Exponent}? + +Exponent = [eE] [+\-]? [0-9]+ + +%% + + { + + /* keywords */ + "break" | + "case" | + "catch" | + "continue" | + "default" | + "do" | + "else" | + "for" | + "goto" | + "enum" | + "if" | + "inline" | + "mutable" | + "noinline" | + "return" | + "safecast" | + "sealed" | + "selectany" | + "sizeof" | + "static_cast" | + "switch" | + "template" | + "this" | + "thread" | + "throw" | + "try" | + "typedef" | + "typeid" | + "typename" | + "using" | + "uuid" | + "value" | + "virtual" | + "while" | + /* C++ Keywords */ + "new" | + "delete" | + "this" | + "friend" | + "using" | + "throw" | + "try" | + "catch" | + "class" | + "typename" | + "template" | + "namespace" + { return token(TokenType.KEYWORD); } + + "static" | + "struct" | + "union" | + "volatile" | + "register" | + "extern" | + "const" | + "signed" | + "unsigned" | + "bool" | + "char" | + "double" | + "int" | + "long" | + "float" | + "short" | + "void" | + + "public" | + "protected" | + "private" | + "virtual" | + "inline" | + "virtual" | + "explicit" | + "export" | + "bool" | + "wchar_t" + { return token(TokenType.TYPE); } + + /* literals */ + + + (\" ( [^\"\n\\] | \\[^\n] )* (\n | \\\n | \")) | + (\' ( [^\'\n\\] | \\[^\n] )* (\n | \\\n | \')) + { return token(TokenType.STRING); } + + "true" | + "false" | + {DecLiteral} | + {OctLiteral} | + {HexLiteral} | + + {FloatLiteral} + { return token(TokenType.NUMBER); } + + /* preprocessor symbols */ + "#define" | + "#elif" | + "#else" | + "#endif" | + "#error" | + "#ifdef" | + "#ifndef" | + "#if" | + "#import" | + "#include" | + "#line" | + "#pragma" | + "#undef" | + "#using" + { return token(TokenType.KEYWORD2); } + + + /* separators */ + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + /* operators */ + "=" | + ";" | + "," | + "." | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + ">>" | + "<<" | + "operator" | + "typeid" | + "and" | + "bitor" | + "or" | + "xor" | + "compl" | + "bitand" | + "and_eq" | + "or_eq" | + "xor_eq" | + "not" | + "not_eq" + { return token(TokenType.OPERATOR); } + + /** C++ standard and built-in objects */ + "cin" | + "cout" + { return token(TokenType.TYPE2); } + + {ConstantIdentifier} { return token(TokenType.TYPE); } + + {Identifier} { return token(TokenType.IDENTIFIER); } + + {Comment} { return token(TokenType.COMMENT); } +} + + + +/* error fallback */ +.|\n { } +<> { return null; } diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/dosbatch.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/dosbatch.flex new file mode 100644 index 000000000..f733059ab --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/dosbatch.flex @@ -0,0 +1,170 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class DOSBatchLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token +%ignorecase +%state ECHO_TEXT + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public DOSBatchLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } +%} + +StartComment = "rem" +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +Comment = {StartComment} {InputCharacter}* {LineTerminator}? + +%% + + { + /* DOS keywords */ + "@" | + "goto" | + "call" | + "exit" | + "if" | + "else" | + "for" | + "copy" | + "set" | + "dir" | + "cd" | + "set" | + "errorlevel" { return token(TokenType.KEYWORD); } + + "%" [:jletter:] [:jletterdigit:]* "%" { return token(TokenType.STRING2); } + + "%" [:digit:]+ { return token(TokenType.KEYWORD2); } + + "echo" { + yybegin(ECHO_TEXT); + return token(TokenType.KEYWORD); + } + + /* DOS commands */ + "append" | + "assoc" | + "at" | + "attrib" | + "break" | + "cacls" | + "cd" | + "chcp" | + "chdir" | + "chkdsk" | + "chkntfs" | + "cls" | + "cmd" | + "color" | + "comp" | + "compact" | + "convert" | + "copy" | + "date" | + "del" | + "dir" | + "diskcomp" | + "diskcopy" | + "doskey" | + "exist" | + "endlocal" | + "erase" | + "fc" | + "find" | + "findstr" | + "format" | + "ftype" | + "graftabl" | + "help" | + "keyb" | + "label" | + "md" | + "mkdir" | + "mode" | + "more" | + "move" | + "path" | + "pause" | + "popd" | + "print" | + "prompt" | + "pushd" | + "rd" | + "recover" | + "rem" | + "ren" | + "rename" | + "replace" | + "restore" | + "rmdir" | + "set" | + "setlocal" | + "shift" | + "sort" | + "start" | + "subst" | + "time" | + "title" | + "tree" | + "type" | + "ver" | + "verify" | + "vol" | + "xcopy" { return token(TokenType.KEYWORD); } + + [:jletterdigit:]+ { return token(TokenType.IDENTIFIER); } + + /* labels */ + ":" [a-zA-Z][a-zA-Z0-9_]* { return token(TokenType.TYPE3); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + . | {LineTerminator} { /* skip */ } +} + + { + "%" [:jletter:] [:jletterdigit:]* "%" { return token(TokenType.STRING2); } + + "%" [:digit:]+ { return token(TokenType.KEYWORD2); } + + . * { return token(TokenType.STRING); } + {LineTerminator} { yybegin(YYINITIAL) ; } +} +<> { return null; } \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm.flex new file mode 100644 index 000000000..02c36593f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm.flex @@ -0,0 +1,153 @@ +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class FlasmLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + +%{ + + StringBuffer string = new StringBuffer(); + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public FlasmLexer() { + + } + + public int yychar() { + return yychar; + } + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n + +InputCharacter = [^\r\n] +Comment = ";" {InputCharacter}* + +WhiteSpace = [ \t\f]+ + + +/* identifiers */ + +Identifier = [:jletter:][:jletterdigit:]* + +InstructionName = [a-zA-Z][a-zA-Z0-9_]* + +Label = {Identifier}: + +StartOfBlock = "{" + +EndOfBlock = "}" + +True = "true" +False = "false" +False = "false" +Null = "null" +Undefined = "undefined" + + + +/* integer literals */ +NumberLiteral = 0 | -?[1-9][0-9]* + +/* floating point literals */ +FloatLiteral = -?({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +OctDigit = [0-7] + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] + +Register= register{NumberLiteral} +Constant= constant{NumberLiteral} + +%state STRING,PARAMETERS + +%% + + { + + + /* whitespace */ + {WhiteSpace} { } + + {Label} { + return token(TokenType.IDENTIFIER,yychar,yylength()-1); + } + + /* identifiers */ + {InstructionName} { yybegin(PARAMETERS); + return token(TokenType.KEYWORD); + } + {EndOfBlock} { } +} + + { + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {NumberLiteral} { return token(TokenType.NUMBER); } + {FloatLiteral} { return token(TokenType.NUMBER); } + {LineTerminator} {yybegin(YYINITIAL); } + {Comment} {return token(TokenType.COMMENT);} + {StartOfBlock} { } + {True} {return token(TokenType.KEYWORD);} + {False} {return token(TokenType.KEYWORD);} + {Null} {return token(TokenType.KEYWORD);} + {Undefined} {return token(TokenType.KEYWORD);} + + {Register} { return token(TokenType.KEYWORD2); } + {Constant} { return token(TokenType.KEYWORD2); } + {Identifier} { return token(TokenType.IDENTIFIER); } + +} + + { + \" { + yybegin(PARAMETERS); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + +{StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); + return token(TokenType.ERROR,tokenStart, tokenLength);} +} + +/* error fallback */ +.|\n { } +<> { return null; } diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm3.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm3.flex new file mode 100644 index 000000000..3b309ce76 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm3.flex @@ -0,0 +1,140 @@ +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class Flasm3Lexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + +%{ + + StringBuffer string = new StringBuffer(); + boolean isMultiname=false; + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public Flasm3Lexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n + +WhiteSpace = [ \t\f]+ + +Multiname = m\[[0-9]+\] + +/* identifiers */ + +Identifier = [:jletter:][:jletterdigit:]* + +InstructionName = [a-z][a-z0-9_]* + +Label = {Identifier}: + + + +/* integer literals */ +NumberLiteral = 0 | -?[1-9][0-9]* + +/* floating point literals */ +FloatLiteral = -?({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +OctDigit = [0-7] + +InputCharacter = [^\r\n] +Comment = ";" {InputCharacter}* {LineTerminator}? + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] + +%state STRING,PARAMETERS + +%% + + { + + + /* whitespace */ + {WhiteSpace} { } + + {Label} {return token(TokenType.IDENTIFIER,yychar,yylength()-1); } + + /* identifiers */ + {InstructionName} { yybegin(PARAMETERS); + return token(TokenType.KEYWORD); } +} + + { + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + isMultiname=false; + } + {Multiname}\" { + isMultiname=true; + yybegin(STRING); + tokenStart = yychar; + tokenLength = yylength(); } + + /* numeric literals */ + + {NumberLiteral} { return token(TokenType.NUMBER); } + {FloatLiteral} { return token(TokenType.NUMBER); } + {Identifier} { return token(TokenType.IDENTIFIER); } + {LineTerminator} {yybegin(YYINITIAL);} + {Comment} {yybegin(YYINITIAL); return token(TokenType.COMMENT);} +} + + { + \" { + yybegin(PARAMETERS); + // length also includes the trailing quote + if(isMultiname){ + return token(TokenType.IDENTIFIER, tokenStart, tokenLength + 1);//multiname + }else{ + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); + return token(TokenType.ERROR,tokenStart, tokenLength);} +} + +/* error fallback */ +.|\n { } +<> { return null; } diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/groovy.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/groovy.flex new file mode 100644 index 000000000..3560a120d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/groovy.flex @@ -0,0 +1,491 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class GroovyLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Default constructor is needed as we will always call the yyreset + */ + public GroovyLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f] + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* Groovy and generally Java types have first UpperCase Letter */ +// Type = [:uppercase:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\\$] +SingleCharacter = [^\r\n\'\\] +RegexCharacter = [^\r\n\/] + +%state STRING, CHARLITERAL, REGEX, GSTRING_EXPR, CHARLITERAL, JDOC, JDOC_TAG +%state ML_STRING, ML_STRING_EXPR + +%% + + { + + /* keywords */ + "abstract" | + "boolean" | + "break" | + "byte" | + "case" | + "catch" | + "char" | + "class" | + "const" | + "continue" | + "do" | + "double" | + "enum" | + "else" | + "extends" | + "final" | + "finally" | + "float" | + "for" | + "default" | + "implements" | + "import" | + "instanceof" | + "int" | + "interface" | + "long" | + "native" | + "new" | + "goto" | + "if" | + "public" | + "short" | + "super" | + "switch" | + "synchronized" | + "package" | + "private" | + "protected" | + "transient" | + "return" | + "void" | + "static" | + "while" | + "this" | + "throw" | + "throws" | + "try" | + "volatile" | + "strictfp" | + + /* Groovy reserved words not in Java */ + "as" | + "asssert" | + "def" | + "in" | + "threadsafe" | + + /* Booleans and null */ + "true" | + "false" | + "null" { return token(TokenType.KEYWORD); } + + + /* Builtin Types and Object Wrappers */ + "Boolean" | + "Byte" | + "Character" | + "Double" | + "Float" | + "Integer" | + "Object" | + "Short" | + "String" | + "Void" | + "Class" | + "Number" | + "Package" | + "StringBuffer" | + "StringBuilder" | + "CharSequence" | + "Thread" | + "Regex" { return token(TokenType.TYPE); } + + /* Some Java standard Library Types */ + "Throwable" | + "Cloneable" | + "Comparable" | + "Serializable" | + "Runnable" { return token(TokenType.TYPE); } + + /* Groovy commonly used methods */ + "print" | + "println" { return token(TokenType.KEYWORD); } + + /* Frequently used Standard Exceptions */ + "ArithmeticException" | + "ArrayIndexOutOfBoundsException" | + "ClassCastException" | + "ClassNotFoundException" | + "CloneNotSupportedException" | + "Exception" | + "IllegalAccessException" | + "IllegalArgumentException" | + "IllegalStateException" | + "IllegalThreadStateException" | + "IndexOutOfBoundsException" | + "InstantiationException" | + "InterruptedException" | + "NegativeArraySizeException" | + "NoSuchFieldException" | + "NoSuchMethodException" | + "NullPointerException" | + "NumberFormatException" | + "RuntimeException" | + "SecurityException" | + "StringIndexOutOfBoundsException" | + "UnsupportedOperationException" { return token(TokenType.TYPE2); } + + /* operators */ + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + ";" | + "," | + "." | + "@" | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + "~=" | + "?." { return token(TokenType.OPERATOR); } + + /* string literal */ + \"{3} { + yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + // JavaDoc comments need a state so that we can highlight the @ controls + "/**" { + yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace}+ { /* skip */ } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } + + /* + Groovy Regex -- state cannot be easily used here due to / by itself being + a valid operator. So if we flip into the REGEX state, we cannot distinguish + a regular / + */ + "/" [^*] {RegexCharacter}+ "/" { return token(TokenType.REGEX); } + +} + + + { + + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + "${" { + yybegin(GSTRING_EXPR); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength; + tokenStart = yychar; + tokenLength = 2; + return token(TokenType.STRING, s, l); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } + +} + + { + "}" { + yybegin(STRING); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength + 1; + tokenStart = yychar + 1; + tokenLength = 0; + return token(TokenType.STRING2, s, l); + } + + {StringCharacter} { tokenLength ++; } +} + + { + + \"{3} { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + + "${" { + yybegin(ML_STRING_EXPR); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength; + tokenStart = yychar; + tokenLength = 2; + return token(TokenType.STRING, s, l); + } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + .|{LineTerminator} { tokenLength += yylength(); } + +} + + { + "}" { + yybegin(ML_STRING); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength + 1; + tokenStart = yychar + 1; + tokenLength = 0; + return token(TokenType.STRING2, s, l); + } + + .|\n|\r { tokenLength ++; } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + "@" { + yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + + .|\n { tokenLength ++; } + +} + + { + ([:letter:])+ ":"? { tokenLength += yylength(); } + + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + .|\n { + yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } +} + + { + "/" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.REGEX, tokenStart, tokenLength + 1); + } + + {RegexCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/java.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/java.flex new file mode 100644 index 000000000..e67524635 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/java.flex @@ -0,0 +1,376 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class JavaLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JavaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL, JDOC, JDOC_TAG + +%% + + { + + /* keywords */ + "abstract" | + "boolean" | + "break" | + "byte" | + "case" | + "catch" | + "char" | + "class" | + "const" | + "continue" | + "do" | + "double" | + "enum" | + "else" | + "extends" | + "final" | + "finally" | + "float" | + "for" | + "default" | + "implements" | + "import" | + "instanceof" | + "int" | + "interface" | + "long" | + "native" | + "new" | + "goto" | + "if" | + "public" | + "short" | + "super" | + "switch" | + "synchronized" | + "package" | + "private" | + "protected" | + "transient" | + "return" | + "void" | + "static" | + "while" | + "this" | + "throw" | + "throws" | + "try" | + "volatile" | + "strictfp" | + + "true" | + "false" | + "null" { return token(TokenType.KEYWORD); } + + /* Java Built in types and wrappers */ + "Boolean" | + "Byte" | + "Character" | + "Double" | + "Float" | + "Integer" | + "Object" | + "Short" | + "Void" | + "Class" | + "Number" | + "Package" | + "StringBuffer" | + "StringBuilder" | + "CharSequence" | + "Thread" | + "String" { return token(TokenType.TYPE); } + + /* Some Java standard Library Types */ + "Throwable" | + "Cloneable" | + "Comparable" | + "Serializable" | + "Runnable" { return token(TokenType.TYPE); } + + "WARNING" { return token(TokenType.WARNING); } + "ERROR" { return token(TokenType.ERROR); } + + /* Frequently used Standard Exceptions */ + "ArithmeticException" | + "ArrayIndexOutOfBoundsException" | + "ClassCastException" | + "ClassNotFoundException" | + "CloneNotSupportedException" | + "Exception" | + "IllegalAccessException" | + "IllegalArgumentException" | + "IllegalStateException" | + "IllegalThreadStateException" | + "IndexOutOfBoundsException" | + "InstantiationException" | + "InterruptedException" | + "NegativeArraySizeException" | + "NoSuchFieldException" | + "NoSuchMethodException" | + "NullPointerException" | + "NumberFormatException" | + "RuntimeException" | + "SecurityException" | + "StringIndexOutOfBoundsException" | + "UnsupportedOperationException" { return token(TokenType.TYPE2); } + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + // JavaDoc comments need a state so that we can highlight the @ controls + "/**" { + yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + "@" { + yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + + .|\n { tokenLength ++; } + +} + + { + ([:letter:])+ ":"? { tokenLength += yylength(); } + + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + .|\n { + yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } +} + + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/javascript.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/javascript.flex new file mode 100644 index 000000000..e1a01580e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/javascript.flex @@ -0,0 +1,279 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class JavaScriptLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JavaScriptLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SStringCharacter = [^\r\n\'\\] + +%state STRING SSTRING + +%% + + { + + /* keywords */ + "break" | + "case" | + "catch" | + "continue" | + "do" | + "else" | + "finally" | + "for" | + "default" | + "delete" | + "new" | + "goto" | + "if" | + "switch" | + "return" | + "while" | + "this" | + "try" | + "var" | + "function" | + "with" | + "in" | + + /* boolean literals */ + "true" | + "false" | + + /* null literal */ + "null" { return token(TokenType.KEYWORD); } + + /* standard / builtin functions */ + "Infinity" | + "NaN" | + "undefined" | + "decodeURI" | + "encodeURIComponent" | + "escape" | + "eval" | + "isFinite" | + "isNaN" | + "parseFloat" | + "parseInt" | + "unescape" { return token(TokenType.KEYWORD2); } + + /* Built-in Types*/ + "Array" | + "Boolean" | + "Date" | + "Math" | + "Number" | + "Object" | + "RegExp" | + "String" | + {Identifier} ":" { return token(TokenType.TYPE); } + + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + \' { + yybegin(SSTRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SStringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/jflex.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/jflex.flex new file mode 100644 index 000000000..a0696912a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/jflex.flex @@ -0,0 +1,400 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class JFlexLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JFlexLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL, JDOC, JDOC_TAG + +%% + + { + + /* keywords */ + "abstract" | + "boolean" | + "break" | + "byte" | + "case" | + "catch" | + "char" | + "class" | + "const" | + "continue" | + "do" | + "double" | + "enum" | + "else" | + "extends" | + "final" | + "finally" | + "float" | + "for" | + "default" | + "implements" | + "import" | + "instanceof" | + "int" | + "interface" | + "long" | + "native" | + "new" | + "goto" | + "if" | + "public" | + "short" | + "super" | + "switch" | + "synchronized" | + "package" | + "private" | + "protected" | + "transient" | + "return" | + "void" | + "static" | + "while" | + "this" | + "throw" | + "throws" | + "try" | + "volatile" | + "strictfp" | + "true" | + "false" | + "null" { return token(TokenType.KEYWORD); } + + /* JFlex special types */ + "<>" | + "[:jletter:]" | + "[:jletterdigit:]" | + "[:letter:]" | + "[:digit:]" | + "[:uppercase:]" | + "[:lowercase:]" | + "<" [a-zA-Z][a-zA-Z0-9_]* ">" { return token(TokenType.TYPE2); } + + /* JFlex Specials */ + "%%" | + "%{" | + "%}" | + "%class" | + "%implements" | + "%extends" | + "%public" | + "%final" | + "%abstract" | + "%apiprivate" | + "%init{" | + "%init}" | + "%initthrow{" | + "%initthrow}" | + "%initthrow" | + "%ctorarg" | + "%scanerror" | + "%buffer" | + "%include" | + "%function" | + "%integer" | + "%int" | + "%intwrap" | + "%yylexthrow{" | + "%yylexthrow}" | + "%yylexthrow" | + "%eofval{" | + "%eofval}" | + "%eof{" | + "%eof}" | + "%eofthrow{" | + "%eofthrow}" | + "%eofthrow" | + "%eofclose" | + "%debug" | + "%standalone" | + "%cup" | + "%cupsym" | + "%cupdebug" | + "%byacc" | + "%switch" | + "%table" | + "%pack" | + "%7bit" | + "%8bit" | + "%full" | + "%unicode" | + "%16bit" | + "%caseless" | + "%ignorecase" | + "%char" | + "%line" | + "%column" | + "%notunix" | + "%yyeof" | + "%s" | + "%state" | + "%x" | + "%xstate" | + "%type" { return token(TokenType.KEYWORD2); } + + + /* Java Built in types and wrappers */ + "Boolean" | + "Byte" | + "Double" | + "Float" | + "Integer" | + "Object" | + "Short" | + "String" { return token(TokenType.TYPE); } + + /* operators */ + + "(" | + ")" | + "{" | + "}" | + "[" | + "]" | + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + // JavaDoc comments need a state so that we can highlight the @ controls + "/**" { + yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + "@" { + yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + + .|\n { tokenLength ++; } + +} + + { + ([:letter:])+ ":"? { tokenLength += yylength(); } + + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + .|\n { + yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } +} + + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/lua.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/lua.flex new file mode 100644 index 000000000..7ddcdce35 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/lua.flex @@ -0,0 +1,298 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class LuaLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public LuaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte ENDBLOCK = 4; + private static final byte REPEATBLOCK = 5; + + TokenType longType; + int longLen; +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +LongStart = \[=*\[ +LongEnd = \]=*\] + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = [0-9]+ +HexDigit = [0-9a-fA-F] + +HexIntegerLiteral = 0x{HexDigit}+ + +/* floating point literals */ +DoubleLiteral = ({FLit1}|{FLit2}) {Exponent}? + +FLit1 = [0-9]+(\.[0-9]*)? +FLit2 = \.[0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter1 = [^\r\n\"\\] +StringCharacter2 = [^\r\n\'\\] + +%state STRING1 +%state STRING2 +%state LONGSTRING + +%state COMMENT +%state LINECOMMENT + +%% + + { + + /* keywords */ + "and" | + "break" | + "for" | + "if" | + "in" | + "local" | + "not" | + "or" | + "return" | + "while" | + + /* boolean literals */ + "true" | + "false" | + + /* nil literal */ + "nil" { return token(TokenType.KEYWORD); } + + "repeat" { return token(TokenType.KEYWORD, REPEATBLOCK); } + "until" { return token(TokenType.KEYWORD, -REPEATBLOCK); } + + "function" { return token(TokenType.KEYWORD, ENDBLOCK); } + "then" { return token(TokenType.KEYWORD, ENDBLOCK); } + "do" { return token(TokenType.KEYWORD, ENDBLOCK); } + + "else" { return token(TokenType.KEYWORD); } + "elseif" { return token(TokenType.KEYWORD); } + + "end" { return token(TokenType.KEYWORD, -ENDBLOCK); } + + /* operators */ + + "+" | + "-" | + "*" | + "/" | + "%" | + "^" | + "#" | + "==" | + "~=" | + "<=" | + ">=" | + "<" | + ">" | + "=" | + ";" | + ":" | + "," | + "." | + ".." | + "..." { return token(TokenType.OPERATOR); } + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + + + {LongStart} { + longType = TokenType.STRING; + yybegin(LONGSTRING); + tokenStart = yychar; + tokenLength = yylength(); + longLen = tokenLength; + } + + "--" { + yybegin(COMMENT); + tokenStart = yychar; + tokenLength = yylength(); + } + + + /* string literal */ + \" { + yybegin(STRING1); + tokenStart = yychar; + tokenLength = 1; + } + \' { + yybegin(STRING2); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + + {HexIntegerLiteral} | + + {DoubleLiteral} { return token(TokenType.NUMBER); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + { + {LongEnd} { + if (longLen == yylength()) { + tokenLength += yylength(); + yybegin(YYINITIAL); + return token(longType, tokenStart, tokenLength); + } else { + tokenLength++; + yypushback(yylength() - 1); + } + + } + {LineTerminator} { tokenLength += yylength(); } + . { tokenLength++; } + <> { + yybegin(YYINITIAL); + return token(longType, tokenStart, tokenLength); + } +} + + { + {LongStart} { + longType = TokenType.COMMENT; + yybegin(LONGSTRING); + tokenLength += yylength(); + longLen = yylength(); + } + + {LineTerminator} { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + + . { + yybegin(LINECOMMENT); + tokenLength += yylength(); + } + <> { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + +} + + { + {LineTerminator} { + yybegin(YYINITIAL); + tokenLength += yylength(); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + {LineTerminator} { tokenLength += yylength(); } + . { tokenLength++; } + <> { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter1}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } + <> { + yybegin(YYINITIAL); + return token(TokenType.STRING, tokenStart, tokenLength); + } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter2}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } + <> { + yybegin(YYINITIAL); + return token(TokenType.STRING, tokenStart, tokenLength); + } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/properties.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/properties.flex new file mode 100644 index 000000000..68fdaad14 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/properties.flex @@ -0,0 +1,63 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class PropertiesLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public PropertiesLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } +%} + +StartComment = # +WhiteSpace = [ \t] +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] +KeyCharacter = [a-zA-Z0-9._ ] + +%% + + +{ + {KeyCharacter}+{WhiteSpace}*= { return token(TokenType.KEYWORD); } + {StartComment} {InputCharacter}* {LineTerminator}? + { return token(TokenType.COMMENT); } + . | {LineTerminator} { /* skip */ } +} + +<> { return null; } \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/python.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/python.flex new file mode 100644 index 000000000..5f32d45fe --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/python.flex @@ -0,0 +1,386 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class PythonLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public PythonLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = "#" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [a-zA-Z][a-zA-Z0-9_]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SQStringCharacter = [^\r\n\'\\] + +%state STRING, ML_STRING, SQSTRING, SQML_STRING + +%% + + { + + /* keywords */ + "and" | + "as" | + "assert" | + "break" | + "class" | + "continue" | + "def" | + "del" | + "elif" | + "else" | + "except" | + "exec" | + "finally" | + "for" | + "from" | + "global" | + "if" | + "import" | + "in" | + "is" | + "lambda" | + "not" | + "or" | + "pass" | + "print" | + "self" | /* not exactly keyword, but almost */ + "raise" | + "return" | + "try" | + "while" | + "with" | + "yield" { return token(TokenType.KEYWORD); } + + /* Built-in Types*/ + "yield" | + "Ellipsis" | + "False" | + "None" | + "NotImplemented" | + "True" | + "__import__" | + "__name__" | + "abs" | + "apply" | + "bool" | + "buffer" | + "callable" | + "chr" | + "classmethod" | + "cmp" | + "coerce" | + "compile" | + "complex" | + "delattr" | + "dict" | + "dir" | + "divmod" | + "enumerate" | + "eval" | + "execfile" | + "file" | + "filter" | + "float" | + "frozenset" | + "getattr" | + "globals" | + "hasattr" | + "hash" | + "help" | + "hex" | + "id" | + "input" | + "int" | + "intern" | + "isinstance" | + "issubclass" | + "iter" | + "len" | + "list" | + "locals" | + "long" | + "map" | + "max" | + "min" | + "object" | + "oct" | + "open" | + "ord" | + "pow" | + "property" | + "range" | + "raw_input" | + "reduce" | + "reload" | + "repr" | + "reversed" | + "round" | + "set" | + "setattr" | + "slice" | + "sorted" | + "staticmethod" | + "str" | + "sum" | + "super" | + "tuple" | + "type" | + "unichr" | + "unicode" | + "vars" | + "xrange" | + "zip" { return token(TokenType.TYPE); } + + + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + "+" | + "-" | + "*" | + "**" | + "/" | + "//" | + "%" | + "<<" | + ">>" | + "&" | + "|" | + "^" | + "~" | + "<" | + ">" | + "<=" | + ">=" | + "==" | + "!=" | + "<>" | + "@" | + "," | + ":" | + "." | + "`" | + "=" | + ";" | + "+=" | + "-=" | + "*=" | + "/=" | + "//=" | + "%=" | + "&=" | + "|=" | + "^=" | + ">>=" | + "<<=" | + "**=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \"{3} { + yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + \'{3} { + yybegin(SQML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + + \' { + yybegin(SQSTRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {FloatLiteral}[jJ] { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } + + "$" | "?" { return token(TokenType.ERROR); } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \"{3} { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + \" { tokenLength ++; } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { tokenLength ++; } +} + + { + "'" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SQStringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \'{3} { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + + {SQStringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + \' { tokenLength ++; } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { tokenLength ++; } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/ruby.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/ruby.flex new file mode 100644 index 000000000..61b49d3dd --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/ruby.flex @@ -0,0 +1,276 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class RubyLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public RubyLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte WORD = 4; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = "#" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [a-zA-Z][a-zA-Z0-9_]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] + +%state STRING, ML_STRING + +%% + + { + + /* keywords */ + "BEGIN" | + "ensure" | + "assert" | + "nil" | + "self" | + "when" | + "END" | + "false" | + "not" | + "super" | + "alias" | + "defined" | + "or" | + "then" | + "yield" | + "and" | + "redo" | + "true" | + "else" | + "in" | + "rescue" | + "undef" | + "break" | + "elsif" | + "module" | + "retry" | + "unless" | + "next" | + "return" { return token(TokenType.KEYWORD); } + + "begin" | + "case" | + "class" | + "def" | + "for" | + "while" | + "until" | + "do" | + "if" { return token(TokenType.KEYWORD, WORD); } + + "end" { return token(TokenType.KEYWORD, -WORD); } + + + /* Built-in Types*/ + "self" | + "nil" | + "true" | + "false" | + "__FILE__" | + "__LINE__" { return token(TokenType.TYPE); } + + + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + "+" | + "-" | + "*" | + "**" | + "/" | + "//" | + "%" | + "<<" | + ">>" | + "&" | + "|" | + "^" | + "~" | + "<" | + ">" | + "<=" | + ">=" | + "==" | + "!=" | + "<>" | + "@" | + "," | + ":" | + "." | + ".." | + "`" | + "=" | + ";" | + "+=" | + "-=" | + "*=" | + "/=" | + "//=" | + "%=" | + "&=" | + "|=" | + "^=" | + ">>=" | + "<<=" | + "**=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \"{3} { + yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {FloatLiteral}[jJ] { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier}"?" { return token(TokenType.TYPE2); } + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \"{3} { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { tokenLength ++; } +} + + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/scala.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/scala.flex new file mode 100644 index 000000000..34376a318 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/scala.flex @@ -0,0 +1,344 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class ScalaLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ScalaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* +DecLongLiteral = {DecIntegerLiteral} [lL] + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = 0+ [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] +DoubleLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%state STRING, CHARLITERAL, JDOC, JDOC_TAG + +%% + + { + + /* keywords */ + "def" | + "import" | + "package" | + "if" | + "then" | + "else" | + "while" | + "for" | + "do" | + "boolean" | + "int" | + "double" | + "byte" | + "short" | + "char" | + "long" | + "float" | + "unit" | + "val" | + "with" | + "type" | + "var" | + "yield" | + "return" | + "true" | + "false" | + "null" | + "this" | + "super" | + "String" | + "Array" | + "private" | + "protected" | + "override" | + "abstract" | + "final" | + "sealed" | + "throw" | + "try" | + "catch" | + "finally" | + "extends" { return token(TokenType.KEYWORD); } + + /* Java Built in types and wrappers */ + "object" | + "Boolean" | + "Byte" | + "Character" | + "Double" | + "Float" | + "Integer" | + "Object" | + "Short" | + "Void" | + "Class" | + "Number" | + "Package" | + "StringBuffer" | + "StringBuilder" | + "CharSequence" | + "Thread" | + "String" { return token(TokenType.TYPE); } + + /* Some Scala predefines */ + "println" { return token(TokenType.KEYWORD2); } + + /* Some Java standard Library Types */ + "Throwable" | + "Cloneable" | + "Comparable" | + "Serializable" | + "Runnable" { return token(TokenType.TYPE); } + + "WARNING" { return token(TokenType.WARNING); } + "ERROR" { return token(TokenType.ERROR); } + + /* operators */ + + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" | + "==" | + "<=" | + ">=" | + "!=" | + "&&" | + "||" | + "++" | + "--" | + "+" | + "-" | + "*" | + "/" | + "&" | + "|" | + "^" | + "%" | + "<<" | + ">>" | + ">>>" | + "+=" | + "-=" | + "*=" | + "/=" | + "&=" | + "|=" | + "^=" | + "%=" | + "<<=" | + ">>=" | + ">>>=" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* character literal */ + \' { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + {DecLongLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FloatLiteral} | + {DoubleLiteral} | + {DoubleLiteral}[dD] { return token(TokenType.NUMBER); } + + // JavaDoc comments need a state so that we can highlight the @ controls + "/**" { + yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {StringCharacter}+ { tokenLength += yylength(); } + + \\[0-3]?{OctDigit}?{OctDigit} { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + {SingleCharacter}+ { tokenLength += yylength(); } + + /* escape sequences */ + + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } +} + + { + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + "@" { + yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + + .|\n { tokenLength ++; } + +} + + { + ([:letter:])+ ":"? { tokenLength += yylength(); } + + "*/" { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + + .|\n { + yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } +} + + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/sql.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/sql.flex new file mode 100644 index 000000000..f3c20e2fb --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/sql.flex @@ -0,0 +1,383 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class SqlLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token +%caseless + + +%{ + /** + * Default constructor is needed as we will always call the yyreset + */ + public SqlLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f] + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} | {DocumentationComment} + +TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +DocumentationComment = "/**" {CommentContent} "*"+ "/" +CommentContent = ( [^*] | \*+ [^/*] )* +EndOfLineComment = "--" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [:jletter:][:jletterdigit:]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* + +/* floating point literals */ +FloatLiteral = ({FLit1}|{FLit2}|{FLit3}) {Exponent}? [fF] + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +// Create states for Double Quoted and Single Quoted Strings +%state DQ_STRING, SQ_STRING + +Reserved = + "ADD" | + "ALL" | + "ALLOW REVERSE SCANS" | + "ALTER" | + "ANALYZE" | + "AND" | + "AS" | + "ASC" | + "AUTOMATIC" | + "BEGIN" | + "BEFORE" | + "BETWEEN" | + "BIGINT" | + "BINARY" | + "BLOB" | + "BOTH" | + "BUFFERPOOL" | + "BY" | + "CACHE" | + "CALL" | + "CASCADE" | + "CASE" | + "CHANGE" | + "CHAR" | + "CHARACTER" | + "CHECK" | + "COLLATE" | + "COLUMN" | + "COMMIT" | + "CONDITION" | + "CONSTANT" | + "CONSTRAINT" | + "CONTINUE" | + "CONVERT" | + "CREATE" | + "CROSS" | + "CURSOR" | + "DATE" | + "DATABASE" | + "DATABASES" | + "DEC" | + "DECIMAL" | + "DECODE" | + "DECLARE" | + "DEFAULT" | + "DELAYED" | + "DELETE" | + "DESC" | + "DESCRIBE" | + "DETERMINISTIC" | + "DISTINCT" | + "DISTINCTROW" | + "DIV" | + "DOUBLE" | + "DROP" | + "DUAL" | + "EACH" | + "ELSE" | + "ELSEIF" | + "ENCLOSED" | + "END" | + "ESCAPED" | + "EXCEPTION" | + "EXISTS" | + "EXIT" | + "EXPLAIN" | + "FALSE" | + "FETCH" | + "FLOAT" | + "FLOAT4" | + "FLOAT8" | + "FOR" | + "FORCE" | + "FOREIGN" | + "FROM" | + "FUNCTION" | + "FULLTEXT" | + "GLOBAL TEMPORARY" | + "GRANT" | + "GROUP" | + "HAVING" | + "IF" | + "IGNORE" | + "IN" | + "INDEX" | + "INFILE" | + "INNER" | + "INOUT" | + "INSENSITIVE" | + "INSERT" | + "INT" | + "INTEGER" | + "INTERVAL" | + "INTO" | + "IS" | + "IS REF CURSOR" | + "ITERATE" | + "JOIN" | + "KEY" | + "KEYS" | + "KILL" | + "LEADING" | + "LEAVE" | + "LEFT" | + "LIKE" | + "LIMIT" | + "LINES" | + "LOAD" | + "LOCK" | + "LONG" | + "LOOP" | + "MATCH" | + "MERGE" | + "MINVALUE" | + "MAXVALUE" | + "MOD" | + "MODIFIES" | + "NATURAL" | + "NOCYCLE" | + "NOORDER" | + "NOT" | + "NULL" | + "NUMERIC" | + "NUMBER" | + "ON" | + "OPEN" | + "OPTIMIZE" | + "OPTION" | + "OPTIONALLY" | + "OR" | + "ORDER" | + "OTHERS" | + "OUT" | + "OUTER" | + "OUTFILE" | + "PACKAGE" | + "PACKAGE BODY" | + "PAGESIZE" | + "PLS_INTEGER" | + "PRAGMA" | + "PRECISION" | + "PRIMARY" | + "PROCEDURE" | + "PURGE" | + "RAISE" | + "READ" | + "READS" | + "REAL" | + "REFERENCES" | + "REGEXP" | + "RELEASE" | + "RENAME" | + "REPEAT" | + "REPLACE" | + "REQUIRE" | + "RESTRICT" | + "RETURN" | + "REVOKE" | + "RIGHT" | + "RLIKE" | + "ROLLBACK" | + "ROWCOUNT" | + "ROWTYPE" | + "SIZE" | + "SCHEMA" | + "SCHEMAS" | + "SELECT" | + "SENSITIVE" | + "SEPARATOR" | + "SEQUENCE" | + "SET" | + "SHOW" | + "SMALLINT" | + "SONAME" | + "SPATIAL" | + "SPECIFIC" | + "SQL" | + "SQLEXCEPTION" | + "SQLSTATE" | + "SQLWARNING" | + "STARTING" | + "SYSDATE" | + "TABLE" | + "TABLESPACE" | + "TERMINATED" | + "THEN" | + "TO" | + "TO_CHAR" | + "TO_DATE" | + "TRAILING" | + "TRIGGER" | + "TRUE" | + "TRUNCATE" | + "TYPE" | + "UNDO" | + "UNION" | + "UNIQUE" | + "UNLOCK" | + "UNSIGNED" | + "UPDATE" | + "USAGE" | + "USE" | + "USER" | + "USING" | + "VALUES" | + "VARBINARY" | + "VARCHAR" | + "VARCHAR2" | + "VARCHARACTER" | + "VARYING" | + "WHEN" | + "WHERE" | + "WHILE" | + "WITH" | + "WRITE" | + "XOR" | + "ZEROFILL" +%% + + { + + /* keywords */ + {Reserved} { return token(TokenType.KEYWORD); } + + /* operators */ + + "(" | + ")" | + "{" | + "}" | + "[" | + "]" | + ";" | + "," | + "." | + "@" | + "=" | + ">" | + "<" | + "!" | + "~" | + "?" | + ":" { return token(TokenType.OPERATOR); } + + /* string literal */ + \" { + yybegin(DQ_STRING); + tokenStart = yychar; + tokenLength = 1; + } + \' { + yybegin(SQ_STRING); + tokenStart = yychar; + tokenLength = 1; + } + + /* numeric literals */ + + {DecIntegerLiteral} | + + {FloatLiteral} { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace}+ { /* skip */ } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } + +} + + { + {StringCharacter}+ { tokenLength += yylength(); } + \"\" { tokenLength += 2; } + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } +} + + { + {SingleCharacter}+ { tokenLength += yylength(); } + \'\' { tokenLength += 2; } + \\. { tokenLength += 2; } + {LineTerminator} { yybegin(YYINITIAL); } + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } +} + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/tal.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/tal.flex new file mode 100644 index 000000000..74cb7272e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/tal.flex @@ -0,0 +1,166 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class TALLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token +%caseless + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public TALLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n +InputCharacter = [^\r\n] + +WhiteSpace = {LineTerminator} | [ \t\f]+ + +/* comments */ +Comment = {TraditionalComment} | {EndOfLineComment} + +TraditionalComment = "!" [^\r\n!]* ( "!" | {LineTerminator} ) +EndOfLineComment = "--" {InputCharacter}* {LineTerminator}? + +/* identifiers */ +Identifier = [A-Za-z_][A-Za-z0-9\^_]* + +/* integer literals */ +DecIntegerLiteral = 0 | [1-9][0-9]* + +HexIntegerLiteral = 0 [xX] 0* {HexDigit} {1,8} +HexLongLiteral = 0 [xX] 0* {HexDigit} {1,16} [lL] +HexDigit = [0-9a-fA-F] + +OctIntegerLiteral = "%" [1-3]? {OctDigit} {1,15} +OctLongLiteral = 0+ 1? {OctDigit} {1,21} [lL] +OctDigit = [0-7] + +FixedLiteral = DecIntegerLiteral [fF] +DoubleLiteral = DecIntegerLiteral [dD] + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] +SingleCharacter = [^\r\n\'\\] + +%% + + { + + /* keywords */ + "begin" | + "end" | + "struct" | + "fieldalign" | + "shared" | + "shared2" | + "literal" | + "for" | + "do" | + "while" | + "?page" | + "?section" { return token(TokenType.KEYWORD); } + + "int" | + "string" | + "int(32)" | + "fixed" | + "byte" | + "float" | + "filler" { return token(TokenType.TYPE); } + + + "(" | + ")" | + "{" | + "}" | + "[" | + "]" | + ";" | + "," | + "." | + "=" | + ">" | + "<" | + "!" | + "?" | + ":" | + ":=" | + "':='" | + "'=:'" | + "<>" | + "+" | + "-" | + "*" | + "/" | + "<<" | + ">>" { return token(TokenType.OPERATOR); } + + /* string literal */ + \"{StringCharacter}+\" { return token(TokenType.STRING); } + + /* character literal */ + \'{SingleCharacter}\' { return token(TokenType.STRING); } + + /* numeric literals */ + + {DecIntegerLiteral} | + + {HexIntegerLiteral} | + {HexLongLiteral} | + + {OctIntegerLiteral} | + {OctLongLiteral} | + + {FixedLiteral} | + {DoubleLiteral} { return token(TokenType.NUMBER); } + + /* comments */ + {Comment} { return token(TokenType.COMMENT); } + + /* whitespace */ + {WhiteSpace} { } + + /* identifiers */ + {Identifier} { return token(TokenType.IDENTIFIER); } +} + + +/* error fallback */ +.|\n { } +<> { return null; } + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xhtml.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xhtml.flex new file mode 100644 index 000000000..07b9bb166 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xhtml.flex @@ -0,0 +1,371 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class XHTMLLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token +%ignorecase + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XHTMLLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte TAG_OPEN = 1; + private static final byte TAG_CLOSE = -1; + + private static final byte INSTR_OPEN = 2; + private static final byte INSTR_CLOSE = -2; + + private static final byte CDATA_OPEN = 3; + private static final byte CDATA_CLOSE = -3; + + private static final byte COMMENT_OPEN = 4; + private static final byte COMMENT_CLOSE = -4; +%} + +%xstate COMMENT, CDATA, TAG, INSTR, DOCTYPE + +/* main character classes */ + +/* white space */ +S = (\u0020 | \u0009 | \u000D | \u000A)+ + +/* characters */ +// Char = \u0009 | \u000A | \u000D | [\u0020-\uD7FF] | [\uE000-\uFFFD] | [\u10000-\u10FFFF] + +/* comments */ +CommentStart = "" + +NameStartChar = ":" | [A-Z] | "_" | [a-z] +NameChar = {NameStartChar} | "-" | "." | [0-9] | \u00B7 +Name = {NameStartChar} {NameChar}* + +/* XML Processing Instructions */ +InstrStart = "" + +DocTypeStart = "" + +/* Tags */ +OpenTagStart = "<" {Name} +OpenTagClose = "/>" +OpenTagEnd = ">" +CloseTag = "" + +/* attribute */ +Attribute = {Name} "=" + +/* HTML specifics */ +HTMLTagName = + "address" | + "applet" | + "area" | + "a" | + "b" | + "base" | + "basefont" | + "big" | + "blockquote" | + "body" | + "br" | + "caption" | + "center" | + "cite" | + "code" | + "dd" | + "dfn" | + "dir" | + "div" | + "dl" | + "dt" | + "font" | + "form" | + "h"[1-6] | + "head" | + "hr" | + "html" | + "img" | + "input" | + "isindex" | + "kbd" | + "li" | + "link" | + "LINK" | + "map" | + "META" | + "menu" | + "meta" | + "ol" | + "option" | + "param" | + "pre" | + "p" | + "samp" | + "span" | + "select" | + "small" | + "strike" | + "sub" | + "sup" | + "table" | + "td" | + "textarea" | + "th" | + "title" | + "tr" | + "tt" | + "ul" | + "var" | + "xmp" | + "script" | + "noscript" | + "style" + +HTMLAttrName = + "action" | + "align" | + "alink" | + "alt" | + "archive" | + "background" | + "bgcolor" | + "border" | + "bordercolor" | + "cellpadding" | + "cellspacing" | + "checked" | + "class" | + "clear" | + "code" | + "codebase" | + "color" | + "cols" | + "colspan" | + "content" | + "coords" | + "enctype" | + "face" | + "gutter" | + "height" | + "hspace" | + "href" | + "id" | + "link" | + "lowsrc" | + "marginheight" | + "marginwidth" | + "maxlength" | + "method" | + "name" | + "prompt" | + "rel" | + "rev" | + "rows" | + "rowspan" | + "scrolling" | + "selected" | + "shape" | + "size" | + "src" | + "start" | + "target" | + "text" | + "type" | + "url" | + "usemap" | + "ismap" | + "valign" | + "value" | + "vlink" | + "vspace" | + "width" | + "wrap" | + "abbr" | + "accept" | + "accesskey" | + "axis" | + "char" | + "charoff" | + "charset" | + "cite" | + "classid" | + "codetype" | + "compact" | + "data" | + "datetime" | + "declare" | + "defer" | + "dir" | + "disabled" | + "for" | + "frame" | + "headers" | + "hreflang" | + "lang" | + "language" | + "longdesc" | + "multiple" | + "nohref" | + "nowrap" | + "object" | + "profile" | + "readonly" | + "rules" | + "scheme" | + "scope" | + "span" | + "standby" | + "style" | + "summary" | + "tabindex" | + "valuetype" | + "version" + +HTMLOpenTagStart = "<" {HTMLTagName} +HTMLCloseTag = "" +HTMLAttribute = {HTMLAttrName} "=" + +/* string and character literals */ +DQuoteStringChar = [^\r\n\"] +SQuoteStringChar = [^\r\n\'] + +%% + + { + + "&" [a-z]+ ";" | + "&#" [:digit:]+ ";" { return token(TokenType.KEYWORD2); } + + {InstrStart} { + yybegin(INSTR); + return token(TokenType.TYPE2, INSTR_OPEN); + } + {DocTypeStart} { + yybegin(DOCTYPE); + return token(TokenType.TYPE2, INSTR_OPEN); + } + {HTMLOpenTagStart} { + yybegin(TAG); + return token(TokenType.KEYWORD2, TAG_OPEN); + } + {HTMLCloseTag} { return token(TokenType.KEYWORD2, TAG_CLOSE); } + {OpenTagStart} { + yybegin(TAG); + return token(TokenType.KEYWORD, TAG_OPEN); + } + {CloseTag} { return token(TokenType.KEYWORD, TAG_CLOSE); } + {CommentStart} { + yybegin(COMMENT); + return token(TokenType.COMMENT2, COMMENT_OPEN); + } + {CDataStart} { + yybegin(CDATA); + return token(TokenType.COMMENT2, CDATA_OPEN); + } +} + + { + {Attribute} { return token(TokenType.IDENTIFIER); } + + \"{DQuoteStringChar}*\" | + \'{SQuoteStringChar}*\' { return token(TokenType.STRING); } + + {InstrEnd} { + yybegin(YYINITIAL); + return token(TokenType.TYPE2, INSTR_CLOSE); + } +} + + { + [^>]* { } + + {OpenTagEnd} { + yybegin(YYINITIAL); + return token(TokenType.TYPE2, INSTR_CLOSE); + } +} + + { + {HTMLAttribute} { return token(TokenType.KEYWORD2); } + {Attribute} { return token(TokenType.IDENTIFIER); } + + \"{DQuoteStringChar}*\" | + \'{SQuoteStringChar}*\' { return token(TokenType.STRING); } + + + {OpenTagClose} { + yybegin(YYINITIAL); + return token(TokenType.KEYWORD, TAG_CLOSE); +} + + {OpenTagEnd} { + yybegin(YYINITIAL); + return token(TokenType.KEYWORD); + } +} + + { + {CommentEnd} { + yybegin(YYINITIAL); + return token(TokenType.COMMENT2, COMMENT_CLOSE); + } + ~{CommentEnd} { + yypushback(3); + return token(TokenType.COMMENT); + } +} + + { + {CDataEnd} { + yybegin(YYINITIAL); + return token(TokenType.COMMENT2, CDATA_CLOSE); + } + ~{CDataEnd} { + yypushback(3); + return token(TokenType.COMMENT); + } +} + + { +/* error fallback */ + .|\n { } + <> { return null; } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xml.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xml.flex new file mode 100644 index 000000000..741b71773 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xml.flex @@ -0,0 +1,196 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class XmlLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XmlLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte TAG_OPEN = 1; + private static final byte TAG_CLOSE = -1; + + private static final byte INSTR_OPEN = 2; + private static final byte INSTR_CLOSE = -2; + + private static final byte CDATA_OPEN = 3; + private static final byte CDATA_CLOSE = -3; + + private static final byte COMMENT_OPEN = 4; + private static final byte COMMENT_CLOSE = -4; +%} + +%xstate COMMENT, CDATA, TAG, INSTR + +/* main character classes */ + +/* white space */ +S = (\u0020 | \u0009 | \u000D | \u000A)+ + +/* characters */ + +Char = \u0009 | \u000A | \u000D | [\u0020-\uD7FF] | [\uE000-\uFFFD] | [\u10000-\u10FFFF] + +/* comments */ +CommentStart = "" + +NameStartChar = ":" | [A-Z] | "_" | [a-z] +NameStartCharUnicode = [\u00C0-\u00D6] | + [\u00D8-\u00F6] | + [\u00F8-\u02FF] | + [\u0370-\u037D] | + [\u037F-\u1FFF] | + [\u200C-\u200D] | + [\u2070-\u218F] | + [\u2C00-\u2FEF] | + [\u3001-\uD7FF] | + [\uF900-\uFDCF] | + [\uFDF0-\uFFFD] | + [\u10000-\uEFFFF] + +NameChar = {NameStartChar} | "-" | "." | [0-9] | \u00B7 +NameCharUnicode = [\u0300-\u036F] | [\u0203F-\u2040] +Name = {NameStartChar} {NameChar}* +NameUnicode = ({NameStartChar}|{NameStartCharUnicode}) ({NameChar}|{NameCharUnicode})* + +/* XML Processing Instructions */ +InstrStart = "" + +/* CDATA */ +CDataStart = "" + +/* Tags */ +OpenTagStart = "<" {Name} +OpenTagClose = "/>" +OpenTagEnd = ">" + +CloseTag = "" + +/* attribute */ +Attribute = {Name} "=" + +/* string and character literals */ +DQuoteStringChar = [^\r\n\"] +SQuoteStringChar = [^\r\n\'] + +%% + + { + + "&" [a-z]+ ";" | + "&#" [:digit:]+ ";" { return token(TokenType.KEYWORD2); } + + {InstrStart} { + yybegin(INSTR); + return token(TokenType.TYPE2, INSTR_OPEN); + } + {OpenTagStart} { + yybegin(TAG); + return token(TokenType.TYPE, TAG_OPEN); + } + {CloseTag} { return token(TokenType.TYPE, TAG_CLOSE); } + {CommentStart} { + yybegin(COMMENT); + return token(TokenType.COMMENT2, COMMENT_OPEN); + } + {CDataStart} { + yybegin(CDATA); + return token(TokenType.COMMENT2, CDATA_OPEN); + } +} + + { + {Attribute} { return token(TokenType.IDENTIFIER); } + + \"{DQuoteStringChar}*\" | + \'{SQuoteStringChar}*\' { return token(TokenType.STRING); } + + {InstrEnd} { + yybegin(YYINITIAL); + return token(TokenType.TYPE2, INSTR_CLOSE); + } + } + + { + {Attribute} { return token(TokenType.IDENTIFIER); } + + \"{DQuoteStringChar}*\" | + \'{SQuoteStringChar}*\' { return token(TokenType.STRING); } + + + {OpenTagClose} { + yybegin(YYINITIAL); + return token(TokenType.TYPE, TAG_CLOSE); +} + + {OpenTagEnd} { + yybegin(YYINITIAL); + return token(TokenType.TYPE); + } +} + + { + {CommentEnd} { + yybegin(YYINITIAL); + return token(TokenType.COMMENT2, COMMENT_CLOSE); + } + ~{CommentEnd} { + yypushback(3); + return token(TokenType.COMMENT); + } +} + + { + {CDataEnd} { + yybegin(YYINITIAL); + return token(TokenType.COMMENT2, CDATA_CLOSE); + } + ~{CDataEnd} { + yypushback(3); + return token(TokenType.COMMENT); + } +} + + { +/* error fallback */ + .|\n { } + <> { return null; } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xpath.flex b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xpath.flex new file mode 100644 index 000000000..fe514e1c4 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xpath.flex @@ -0,0 +1,266 @@ +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This flex file originally donated to the project by HeyChinaski + * + */ + +package jsyntaxpane.lexers; + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + +%% + +%public +%class XPathLexer +%extends DefaultJFlexLexer +%final +%unicode +%char +%type Token + + +%{ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XPathLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + +%} + +Digits = [0-9]+ +Letter = {BaseChar} | {Ideographic} +BaseChar = [\u0041-\u005A] | [\u0061-\u007A] | [\u00C0-\u00D6] | [\u00D8-\u00F6] | [\u00F8-\u00FF] | [\u0100-\u0131] | [\u0134-\u013E] | [\u0141-\u0148] | [\u014A-\u017E] | [\u0180-\u01C3] | [\u01CD-\u01F0] | [\u01F4-\u01F5] | [\u01FA-\u0217] | [\u0250-\u02A8] | [\u02BB-\u02C1] | \u0386 | [\u0388-\u038A] | \u038C | [\u038E-\u03A1] | [\u03A3-\u03CE] | [\u03D0-\u03D6] | \u03DA | \u03DC | \u03DE | \u03E0 | [\u03E2-\u03F3] | [\u0401-\u040C] | [\u040E-\u044F] | [\u0451-\u045C] | [\u045E-\u0481] | [\u0490-\u04C4] | [\u04C7-\u04C8] | [\u04CB-\u04CC] | [\u04D0-\u04EB] | [\u04EE-\u04F5] | [\u04F8-\u04F9] | [\u0531-\u0556] | \u0559 | [\u0561-\u0586] | [\u05D0-\u05EA] | [\u05F0-\u05F2] | [\u0621-\u063A] | [\u0641-\u064A] | [\u0671-\u06B7] | [\u06BA-\u06BE] | [\u06C0-\u06CE] | [\u06D0-\u06D3] | \u06D5 | [\u06E5-\u06E6] | [\u0905-\u0939] | \u093D | [\u0958-\u0961] | [\u0985-\u098C] | [\u098F-\u0990] | [\u0993-\u09A8] | [\u09AA-\u09B0] | \u09B2 | [\u09B6-\u09B9] | [\u09DC-\u09DD] | [\u09DF-\u09E1] | [\u09F0-\u09F1] | [\u0A05-\u0A0A] | [\u0A0F-\u0A10] | [\u0A13-\u0A28] | [\u0A2A-\u0A30] | [\u0A32-\u0A33] | [\u0A35-\u0A36] | [\u0A38-\u0A39] | [\u0A59-\u0A5C] | \u0A5E | [\u0A72-\u0A74] | [\u0A85-\u0A8B] | \u0A8D | [\u0A8F-\u0A91] | [\u0A93-\u0AA8] | [\u0AAA-\u0AB0] | [\u0AB2-\u0AB3] | [\u0AB5-\u0AB9] | \u0ABD | \u0AE0 | [\u0B05-\u0B0C] | [\u0B0F-\u0B10] | [\u0B13-\u0B28] | [\u0B2A-\u0B30] | [\u0B32-\u0B33] | [\u0B36-\u0B39] | \u0B3D | [\u0B5C-\u0B5D] | [\u0B5F-\u0B61] | [\u0B85-\u0B8A] | [\u0B8E-\u0B90] | [\u0B92-\u0B95] | [\u0B99-\u0B9A] | \u0B9C | [\u0B9E-\u0B9F] | [\u0BA3-\u0BA4] | [\u0BA8-\u0BAA] | [\u0BAE-\u0BB5] | [\u0BB7-\u0BB9] | [\u0C05-\u0C0C] | [\u0C0E-\u0C10] | [\u0C12-\u0C28] | [\u0C2A-\u0C33] | [\u0C35-\u0C39] | [\u0C60-\u0C61] | [\u0C85-\u0C8C] | [\u0C8E-\u0C90] | [\u0C92-\u0CA8] | [\u0CAA-\u0CB3] | [\u0CB5-\u0CB9] | \u0CDE | [\u0CE0-\u0CE1] | [\u0D05-\u0D0C] | [\u0D0E-\u0D10] | [\u0D12-\u0D28] | [\u0D2A-\u0D39] | [\u0D60-\u0D61] | [\u0E01-\u0E2E] | \u0E30 | [\u0E32-\u0E33] | [\u0E40-\u0E45] | [\u0E81-\u0E82] | \u0E84 | [\u0E87-\u0E88] | \u0E8A | \u0E8D | [\u0E94-\u0E97] | [\u0E99-\u0E9F] | [\u0EA1-\u0EA3] | \u0EA5 | \u0EA7 | [\u0EAA-\u0EAB] | [\u0EAD-\u0EAE] | \u0EB0 | [\u0EB2-\u0EB3] | \u0EBD | [\u0EC0-\u0EC4] | [\u0F40-\u0F47] | [\u0F49-\u0F69] | [\u10A0-\u10C5] | [\u10D0-\u10F6] | \u1100 | [\u1102-\u1103] | [\u1105-\u1107] | \u1109 | [\u110B-\u110C] | [\u110E-\u1112] | \u113C | \u113E | \u1140 | \u114C | \u114E | \u1150 | [\u1154-\u1155] | \u1159 | [\u115F-\u1161] | \u1163 | \u1165 | \u1167 | \u1169 | [\u116D-\u116E] | [\u1172-\u1173] | \u1175 | \u119E | \u11A8 | \u11AB | [\u11AE-\u11AF] | [\u11B7-\u11B8] | \u11BA | [\u11BC-\u11C2] | \u11EB | \u11F0 | \u11F9 | [\u1E00-\u1E9B] | [\u1EA0-\u1EF9] | [\u1F00-\u1F15] | [\u1F18-\u1F1D] | [\u1F20-\u1F45] | [\u1F48-\u1F4D] | [\u1F50-\u1F57] | \u1F59 | \u1F5B | \u1F5D | [\u1F5F-\u1F7D] | [\u1F80-\u1FB4] | [\u1FB6-\u1FBC] | \u1FBE | [\u1FC2-\u1FC4] | [\u1FC6-\u1FCC] | [\u1FD0-\u1FD3] | [\u1FD6-\u1FDB] | [\u1FE0-\u1FEC] | [\u1FF2-\u1FF4] | [\u1FF6-\u1FFC] | \u2126 | [\u212A-\u212B] | \u212E | [\u2180-\u2182] | [\u3041-\u3094] | [\u30A1-\u30FA] | [\u3105-\u312C] | [\uAC00-\uD7A3] +Ideographic = [\u4E00-\u9FA5] | \u3007 | [\u3021-\u3029] +NCNameStartChar = {Letter} | "_" +NameStartCharMinusColon = [A-Z] | "_" | [a-z] | [\uC0-\uD6] | [\uD8-\uF6] | [\uF8-\u2FF] | [\u370-\u37D] | [\u37F-\u1FFF] | [\u200C-\u200D] | [\u2070-\u218F] | [\u2C00-\u2FEF] | [\u3001-\uD7FF] | [\uF900-\uFDCF] | [\uFDF0-\uFFFD] +NCNameChar = {NameStartCharMinusColon} | "-" | "." | [0-9] | \uB7 | [\u0300-\u036F] | [\u203F-\u2040] +NCName = {NCNameStartChar} {NCNameChar}* +LocalPart = {NCName} +UnprefixedName = {LocalPart} +Prefix = {NCName} +PrefixedName = {Prefix} ":" {LocalPart} +QName = {PrefixedName} | {UnprefixedName} +NameTest = "*" | {NCName} ":" "*" | {QName} +VariableReference = "$" {QName} +LineTerminator = \r|\n|\r\n + +NodeType = "comment" + | "text" + | "processing-instruction" + | "node" + +OperatorName = "and" | "or" | "mod" | "div" + +Operator = {OperatorName} | "*" | "/" | "//" | "|" | "+" | "-" | "=" | "!=" | "<" | "<=" | ">" | ">=" + +FunctionName = {QName} + +XPathFunction = "default" + | "node-name" + | "nilled" + | "data" + | "base-uri" + | "document-uri" + | "error" + | "trace" + | "number" + | "abs" + | "ceiling" + | "floor" + | "round" + | "round-half-to-even" + | "string" + | "codepoints-to-string" + | "string-to-codepoints" + | "codepoint-equal" + | "compare" + | "concat" + | "string-join" + | "substring" + | "string-length" + | "normalize-space" + | "normalize-unicode" + | "upper-case" + | "lower-case" + | "translate" + | "escape-uri" + | "contains" + | "starts-with" + | "ends-with" + | "substring-before" + | "substring-after" + | "matches" + | "replace" + | "tokenize" + | "resolve-uri" + | "boolean" + | "not" + | "true" + | "false" + | "dateTime" + | "years-from-duration" + | "months-from-duration" + | "days-from-duration" + | "hours-from-duration" + | "minutes-from-duration" + | "seconds-from-duration" + | "year-from-dateTime" + | "month-from-dateTime" + | "day-from-dateTime" + | "hours-from-dateTime" + | "minutes-from-dateTime" + | "seconds-from-dateTime" + | "timezone-from-dateTime" + | "year-from-date" + | "month-from-date" + | "day-from-date" + | "timezone-from-date" + | "hours-from-time" + | "minutes-from-time" + | "seconds-from-time" + | "timezone-from-time" + | "adjust-dateTime-to-timezone" + | "adjust-date-to-timezone" + | "adjust-time-to-timezone" + | "QName" + | "local-name-from-QName" + | "namespace-uri-from-QName" + | "namespace-uri-for-prefix" + | "in-scope-prefixes" + | "resolve-QName" + | "name" + | "local-name" + | "namespace-uri" + | "lang" + | "root" + | "index-of" + | "remove" + | "empty" + | "exists" + | "distinct-values" + | "insert-before" + | "reverse" + | "subsequence" + | "unordered" + | "zero-or-one" + | "one-or-more" + | "exactly-one" + | "deep-equal" + | "count" + | "avg" + | "max" + | "min" + | "sum" + | "id" + | "idref" + | "doc" + | "doc-available" + | "collection" + | "position" + | "last" + | "current-dateTime" + | "current-date" + | "current-time" + | "implicit-timezone" + | "default-collation" + | "static-base-uri" + +AxisName = "ancestor" + | "ancestor-or-self" + | "attribute" + | "child" + | "descendant" + | "descendant-or-self" + | "following" + | "following-sibling" + | "namespace" + | "parent" + | "preceding" + | "preceding-sibling" + | "self" + +Number = {Digits} | {Digits} "." {Digits} + +S = [\u20] | [\u9] | [\uD] | [\uA] + +%state STRING_DOUBLE, STRING_SINGLE + +%% + + { + {VariableReference} { return token(TokenType.IDENTIFIER); } + {Number} { return token(TokenType.NUMBER); } + {AxisName} { return token(TokenType.TYPE); } + "(" { return token(TokenType.OPERATOR, PARAN); } + ")" { return token(TokenType.OPERATOR, -PARAN); } + "{" { return token(TokenType.OPERATOR, CURLY); } + "}" { return token(TokenType.OPERATOR, -CURLY); } + "[" { return token(TokenType.OPERATOR, BRACKET); } + "]" { return token(TokenType.OPERATOR, -BRACKET); } + "." | ".." | "@" | "," | "::" { return token(TokenType.OPERATOR); } + {Operator} { return token(TokenType.OPERATOR); } + {NodeType} { return token(TokenType.KEYWORD); } + {XPathFunction} { return token(TokenType.KEYWORD2); } + {FunctionName} { return token(TokenType.IDENTIFIER); } + {NameTest} { return token(TokenType.IDENTIFIER); } + + /* string literal */ + \" { + yybegin(STRING_DOUBLE); + tokenStart = yychar; + tokenLength = 1; + } + + /* string literal */ + \' { + yybegin(STRING_SINGLE); + tokenStart = yychar; + tokenLength = 1; + } + ":" | {S} | "\"" {} + . | {LineTerminator} { /* skip */ } +} + + { + \" { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + [^\"] { tokenLength += yylength(); } +} + + { + \' { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + + [^\'] { tokenLength += yylength(); } +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/annotation_type.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/annotation_type.png new file mode 100644 index 000000000..52ff9d6ee Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/annotation_type.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/class.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/class.png new file mode 100644 index 000000000..220e6f385 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/class.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor.png new file mode 100644 index 000000000..fd95f9d19 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_private.png new file mode 100644 index 000000000..eb58f0ab0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_protected.png new file mode 100644 index 000000000..006e905ab Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/constructor_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field.png new file mode 100644 index 000000000..06a86fb1d Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_private.png new file mode 100644 index 000000000..1d0ee3e4d Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_protected.png new file mode 100644 index 000000000..589610ca7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static.png new file mode 100644 index 000000000..32394788c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_private.png new file mode 100644 index 000000000..3b1c00aa0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_protected.png new file mode 100644 index 000000000..09cb7fb97 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/field_static_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method.png new file mode 100644 index 000000000..7be8a378a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_private.png new file mode 100644 index 000000000..5bbdd1782 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_protected.png new file mode 100644 index 000000000..325ed1875 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static.png new file mode 100644 index 000000000..414e584d2 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_private.png new file mode 100644 index 000000000..0a5e4b160 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_protected.png new file mode 100644 index 000000000..e5f9c9bf8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/completions/method_static_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/Thumbs.db b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/Thumbs.db new file mode 100644 index 000000000..1b208f783 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/Thumbs.db differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/comment.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/comment.png new file mode 100644 index 000000000..fb1aa5ca6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/comment.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/complete-word.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/complete-word.png new file mode 100644 index 000000000..32943e985 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/complete-word.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/completions.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/completions.png new file mode 100644 index 000000000..8851b99ba Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/completions.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/copy-to-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/copy-to-clipboard.png new file mode 100644 index 000000000..8dd48c494 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/copy-to-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/cut-to-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/cut-to-clipboard.png new file mode 100644 index 000000000..dc9eb9a7a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/cut-to-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace-all.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace-all.png new file mode 100644 index 000000000..8bf48cbdd Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace-all.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace.png new file mode 100644 index 000000000..6edbef614 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/edit-find-replace.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find-next.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find-next.png new file mode 100644 index 000000000..4d6b1252f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find-next.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find.png new file mode 100644 index 000000000..d072d3cbe Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/find.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-down.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-down.png new file mode 100644 index 000000000..3dd7fccdf Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-down.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-next.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-next.png new file mode 100644 index 000000000..6ef8de76e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-next.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-previous.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-previous.png new file mode 100644 index 000000000..659cd90d7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-previous.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-up.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-up.png new file mode 100644 index 000000000..fa9a7d71b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/go-up.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/goto-line.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/goto-line.png new file mode 100644 index 000000000..684c24799 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/goto-line.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/highlight.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/highlight.png new file mode 100644 index 000000000..fd9e6ec52 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/highlight.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/html-preview.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/html-preview.png new file mode 100644 index 000000000..ac5957ad6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/html-preview.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/indent.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/indent.png new file mode 100644 index 000000000..6bad6bbac Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/indent.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/jump-to-pair.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/jump-to-pair.png new file mode 100644 index 000000000..ddf0ee32c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/jump-to-pair.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/paste-from-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/paste-from-clipboard.png new file mode 100644 index 000000000..24588a3a4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/paste-from-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/play.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/play.png new file mode 100644 index 000000000..a7de0feb0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/play.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/redo.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/redo.png new file mode 100644 index 000000000..c3b0df039 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/redo.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/reflect.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/reflect.png new file mode 100644 index 000000000..01cfa6e96 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/reflect.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/select-all.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/select-all.png new file mode 100644 index 000000000..f4b0b19e0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/select-all.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/show-abbs.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/show-abbs.png new file mode 100644 index 000000000..7406c9566 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/show-abbs.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-comment.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-comment.png new file mode 100644 index 000000000..8c2b0ce4f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-comment.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-debug.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-debug.png new file mode 100644 index 000000000..39b906d0f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-debug.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-if.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-if.png new file mode 100644 index 000000000..8391c248f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-if.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-try.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-try.png new file mode 100644 index 000000000..074f88214 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-try.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-while.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-while.png new file mode 100644 index 000000000..890e2fc39 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-while.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-with.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-with.png new file mode 100644 index 000000000..d4f01a616 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround-with.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround.png new file mode 100644 index 000000000..d0d333169 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/surround.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-lines.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-lines.png new file mode 100644 index 000000000..a8909bb43 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-lines.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-token-marker.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-token-marker.png new file mode 100644 index 000000000..3cf16ed05 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/toggle-token-marker.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/undo.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/undo.png new file mode 100644 index 000000000..8b0fef9a8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/undo.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/unindent.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/unindent.png new file mode 100644 index 000000000..1787a7ff4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/images/small-icons/unindent.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties new file mode 100644 index 000000000..6a2f213c1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties @@ -0,0 +1,153 @@ +# +# Main Configuration of JSyntaxPane +# +# ----------------------------------------------------------------------------- +# +# These will be used by all kits, unless the same key is used for a specific +# kit, in which case the specific will be used: +# +# These are the componets that will be installed be default for any kit, +# unless specified otherwise +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler +# This is the color to highlight tokens whenever the cursor is on them +TokenMarker.Color = 0xffeeaa +# Colors for PairMarkers +PairMarker.Color = 0xffbb77 +# +# Right Margin for LineNumbers border in pixels, Default = 5 +LineNumbers.RightMargin = 7 +# Foreground for line numbers, Default = Black +LineNumbers.Foreground = 0x333300 +# Background for line numbers, Default = White +LineNumbers.Background = 0xeeeeff +# Color to use for highlighting current line background +LineNumbers.CurrentBack = 0xccccee +# Default color for the Caret, Black +CaretColor = 0x000000 +# +# Actions: +# The key is of the format: +# Actions.NAME = class [, key]* +# where NAME is the name to be given to the Action. Any String [alpha or -] is valid. +# class is the fully qualified class name of the SyntaxAction class. +# Starting from 0.9.5, each Action will instantiate a new class. If you need +# to share some data between the Actions, then add a Property to the Document +# Key is the keyboard key to map it to as specified by +# KeyStroke.getKeyStroge(String key). You may have zero or more key bindings +# to an Action. The last Key bound will be shown in the popup menu if enabled. +# You can also specify the "menu" modifier, and it will be mapped to the proper menu +# key depending on the running platform (CTRL on Windows and ALT on Mac) +# +# Each fully qualified key can also be used as a prefix for configuring the Action +# Action.NAME.MenuText = The description to use in menus (This sets the Action NAME property) +# Action.NAME.SmallIcon = the smallicon to use. The default is to look for an icon +# with the same name as the action + ".png". This sets the Actions SMALL_ICON property +# Action.NAME.Tooltip = Tooltip displayed for menu. This sets the +# Actions SHORT_DESCRIPTION property +Action.quick-find = jsyntaxpane.actions.QuickFindAction, control F +Action.find = jsyntaxpane.actions.FindReplaceAction, control H +Action.find.MenuText = Find +Action.find.ToolTip= Display Find And Replace Dialog +Action.find-next = jsyntaxpane.actions.FindNextAction, F3 +Action.find-next.MenuText = Find Next +Action.find-next.ToolTip = Repeat Last Find +Action.goto-line = jsyntaxpane.actions.GotoLineAction, control G +Action.goto-line.MenuText = Goto Line Number +Action.goto-line.ToolTip = Goto Line Number +Action.indent = jsyntaxpane.actions.IndentAction, TAB +Action.indent.MenuText = Indent +Action.indent.Abbreviations = ${class_path}/abbreviations.properties +Action.unindent = jsyntaxpane.actions.UnindentAction, shift TAB +Action.unindent.MenuText = Un-Indent +Action.jindent = jsyntaxpane.actions.JIndentAction, ENTER +Action.undo = jsyntaxpane.actions.UndoAction, menu Z +Action.undo.MenuText = Undo +Action.redo = jsyntaxpane.actions.RedoAction, menu Y +Action.redo.MenuText = Redo +Action.delete-lines = jsyntaxpane.actions.DeleteLinesAction, control E +Action.delete-lines.MenuText = Delete Line(s) +Action.dup-lines-up = jsyntaxpane.actions.DuplicateLinesAction, shift control UP +Action.dup-lines-up.MenuText = DUplicate Lines Above +Action.dup-lines-down = jsyntaxpane.actions.DuplicateLinesAction, shift control DOWN +Action.dup-lines-down.MenuText = Duplicate Lines Below +Action.toggle-lines = jsyntaxpane.actions.ToggleComponentAction, control F2 +Action.toggle-lines.Component = jsyntaxpane.components.LineNumbersRuler +Action.toggle-lines.MenuText = Toggle Line Numbers +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.MenuText = Toggle Comments +Action.toggle-comments.SmallIcon = comment.png +Action.jump-to-pair = jsyntaxpane.actions.JumpToPairAction, control OPEN_BRACKET +Action.jump-to-pair.MenuText = Jump to Pair +Action.complete-word = jsyntaxpane.actions.CompleteWordAction, control K +Action.complete-word.MenuText = Complete Word +Action.smart-home = jsyntaxpane.actions.SmartHomeAction, HOME +Action.smart-home-select = jsyntaxpane.actions.SmartHomeSelectAction, shift HOME +Action.show-abbs = jsyntaxpane.actions.ShowAbbsAction, F8 +Action.show-abbs.MenuText = Show abbreviations +Action.show-abbs.ToolTip = Show abbreviations +# +# These configure the Default Actions provided by DefaultEditorKit for popup menus +DefaultAction.copy-to-clipboard.MenuText = Copy +DefaultAction.cut-to-clipboard.MenuText = Cut +DefaultAction.paste-from-clipboard.MenuText = Paste +DefaultAction.select-all.MenuText = Select All +# +# View configuration: +# This controls how text is anti-aliased on the editor control: +# see the RenderingHints.VALUE_TEXT_ANTIALIAS.... for details +# DEFAULT: use the JRE default (default value) +# ON: set to on, let the JRE determine best method for the display +# OFF: no AA +# GASP: used on GTK +# HBGR: +# HRGB: +# VBGR: +# VRGM +TextAA = ON +DEFAULT_EDIT_MENU= \ + cut-to-clipboard , \ + copy-to-clipboard , \ + paste-from-clipboard , \ + - , \ + select-all , \ + - , \ + undo , \ + redo , \ + - , \ + find , \ + find-next , \ + goto-line , \ + jump-to-pair , \ + - , \ + complete-word , \ + show-abbs + +# Default Popup Menu +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + goto-line , \ + toggle-comments +# +# These are the various Attributes for each TokenType. +# The keys of this map are the TokenType Strings, and the values are: +# color (hex, or integer), Font.Style attribute +# Style is one of: 0 = plain, 1=bold, 2=italic, 3=bold/italic +Style.OPERATOR = 0x000000, 0 +Style.DELIMITER = 0x000000, 1 +Style.KEYWORD = 0x3333ee, 0 +Style.KEYWORD2 = 0x3333ee, 3 +Style.TYPE = 0x000000, 2 +Style.TYPE2 = 0x000000, 1 +Style.TYPE3 = 0x000000, 3 +Style.STRING = 0xcc6600, 0 +Style.STRING2 = 0xcc6600, 1 +Style.NUMBER = 0x999933, 1 +Style.REGEX = 0xcc6600, 0 +Style.IDENTIFIER = 0x000000, 0 +Style.COMMENT = 0x339933, 2 +Style.COMMENT2 = 0x339933, 3 +Style.DEFAULT = 0x000000, 0 +Style.WARNING = 0xCC0000, 0 +Style.ERROR = 0xCC0000, 3 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/kitsfortypes.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/kitsfortypes.properties new file mode 100644 index 000000000..6387cf423 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/kitsfortypes.properties @@ -0,0 +1,29 @@ +# This file contains the default content types and the SyntaxKit class names +# that will be used for them. +# The keys are content types, and the values are the fully qualified class +# names +text/c=jsyntaxpane.syntaxkits.CSyntaxKit +text/cpp=jsyntaxpane.syntaxkits.CppSyntaxKit +text/java=jsyntaxpane.syntaxkits.JavaSyntaxKit +text/groovy=jsyntaxpane.syntaxkits.GroovySyntaxKit +text/javascript=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/js=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/json=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/xml=jsyntaxpane.syntaxkits.XmlSyntaxKit +text/sql=jsyntaxpane.syntaxkits.SqlSyntaxKit +text/properties=jsyntaxpane.syntaxkits.PropertiesSyntaxKit +text/python=jsyntaxpane.syntaxkits.PythonSyntaxKit +text/tal=jsyntaxpane.syntaxkits.TALSyntaxKit +text/jflex=jsyntaxpane.syntaxkits.JFlexSyntaxKit +text/ruby=jsyntaxpane.syntaxkits.RubySyntaxKit +text/scala=jsyntaxpane.syntaxkits.ScalaSyntaxKit +text/clojure=jsyntaxpane.syntaxkits.ClojureSyntaxKit +text/dosbatch=jsyntaxpane.syntaxkits.DOSBatchSyntaxKit +text/bash=jsyntaxpane.syntaxkits.BashSyntaxKit +text/xpath=jsyntaxpane.syntaxkits.XPathSyntaxKit +text/xhtml=jsyntaxpane.syntaxkits.XHTMLSyntaxKit +text/lua=jsyntaxpane.syntaxkits.LuaSyntaxKit +text/plain=jsyntaxpane.syntaxkits.PlainSyntaxKit +text/flasm3=jsyntaxpane.syntaxkits.Flasm3SyntaxKit +text/flasm=jsyntaxpane.syntaxkits.FlasmSyntaxKit +text/actionscript=jsyntaxpane.syntaxkits.ActionScriptSyntaxKit \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/scripts/insertdate.js b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/scripts/insertdate.js new file mode 100644 index 000000000..ea61d4d13 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/scripts/insertdate.js @@ -0,0 +1,8 @@ +// Import the needed java packages and classes +importPackage(java.util); +importClass(javax.swing.JOptionPane) + +function putDate() { + TARGET.replaceSelection("This is a dummy proc that inserts the Current Date:\n" + new Date()); + TARGET.replaceSelection("\nTab Size of doc = " + AU.getTabSize(TARGET)); +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties new file mode 100644 index 000000000..a33e52ed3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties @@ -0,0 +1,28 @@ +# +# JavaScript +# +Action.execute-script = jsyntaxpane.actions.ScriptRunnerAction, control R +Action.execute-script.ScriptExtension = js +Action.execute-script.MenuText = Execute Script +Action.execute-script.ToolTip = Execute JavaScript in internal JRE +Action.execute-script.SmallIcon = play.png + +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + toggle-lines , \ + - , \ + execute-script + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties new file mode 100644 index 000000000..47503d6ea --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# BashSyntaxKit Specifics +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties new file mode 100644 index 000000000..4ec839104 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# ClojureSyntaxKit +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "; " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties new file mode 100644 index 000000000..6c3c767d0 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# DOS Batch Specifics +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "rem " diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties new file mode 100644 index 000000000..c2e13c019 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties @@ -0,0 +1,4 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/combocompletions.txt new file mode 100644 index 000000000..e69de29bb diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties new file mode 100644 index 000000000..23a063c35 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties @@ -0,0 +1,36 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties new file mode 100644 index 000000000..c2e13c019 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties @@ -0,0 +1,4 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/combocompletions.txt new file mode 100644 index 000000000..e69de29bb diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties new file mode 100644 index 000000000..23a063c35 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties @@ -0,0 +1,36 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties new file mode 100644 index 000000000..b2f71b7f1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties @@ -0,0 +1,41 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced +pu=public +pr=private +st=static +cl=class #{p:TheClass} {\n} +St=String +In=Integer +Bo=Boolean +bo=boolean +fl=float +ch=char +wh=while +ex=extends +im=implements +Ex=Exception +en=enum #{p:TheEnum} {\n} +re=return +df=default: +cs=case #{p:value}:\n break; +sw=switch(#{p:expr}){\n case 1:\n break;\n} +iof=instanceof +trc=try {\n #{p:statements;}\n} catch (Exception e) {\n} +th=throw +thn=throw new +ths=throws +fori=for(int i=0; i<#{p:max}; i++) {\n // statement\n} +fore=for(#{p:Object} o: items) {\n // statement\n} +ife=if(#{p:condition}) {\n // When true\n} else {\n // when false\n} +iff=if(#{p:condition}) {\n // When true\n} +sout=System.out.println("#{p:text}"); +serr=System.err.println("#{p:Error text}"); +psvm=public static void main(String[] args) {\n #{p:}\n} +psfs=public static final String #{p:CONST} = ""; +psfi=public static final int #{p:CONST} = 0; +psfb=public static final boolean #{p:CONST} = true; +Psfs=private static final String #{p:CONST} = ""; +Psfi=private static final int #{p:CONST} = 0; +IAE=IllegalArgumentException \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties new file mode 100644 index 000000000..f9b01ebcb --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# Other Java type actions for other languages: +# +Style.COMMENT = 0x666666, 2 +Style.COMMENT2 = 0x666666, 3 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties new file mode 100644 index 000000000..a33e52ed3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties @@ -0,0 +1,28 @@ +# +# JavaScript +# +Action.execute-script = jsyntaxpane.actions.ScriptRunnerAction, control R +Action.execute-script.ScriptExtension = js +Action.execute-script.MenuText = Execute Script +Action.execute-script.ToolTip = Execute JavaScript in internal JRE +Action.execute-script.SmallIcon = play.png + +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + toggle-lines , \ + - , \ + execute-script + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties new file mode 100644 index 000000000..e510d7049 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties @@ -0,0 +1,43 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced +pu=public +pr=private +st=static +cl=class #{p:TheClass} {\n} +St=String +In=Integer +Bo=Boolean +bo=boolean +fl=float +ch=char +wh=while +ex=extends +im=implements +Ex=Exception +en=enum #{p:TheEnum} {\n} +re=return +df=default: +cs=case #{p:value}:\n break; +sw=switch(#{p:expr}){\n case 1:\n break;\n} +iof=instanceof +trc=try {\n #{p:statements;}\n} catch (Exception e) {\n} +th=throw +thn=throw new +ths=throws +fori=for(int i=0; i<#{p:max}; i++) {\n // statement\n} +fore=for(#{p:Object} o: items) {\n // statement\n} +ife=if(#{p:condition}) {\n // When true\n} else {\n // when false\n} +iff=if(#{p:condition}) {\n // When true\n} +sout=System.out.println("#{p:text}"); +serr=System.err.println("#{p:Error text}"); +psvm=public static void main(String[] args) {\n #{p:}\n} +psfs=public static final String #{p:CONST} = ""; +psfi=public static final int #{p:CONST} = 0; +psfb=public static final boolean #{p:CONST} = true; +Psfs=private static final String #{p:CONST} = ""; +Psfi=private static final int #{p:CONST} = 0; +IAE=IllegalArgumentException +/*=/* #{p:} */ +/**=/**\n * #{p:}\n */ \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt new file mode 100644 index 000000000..916b81178 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt @@ -0,0 +1,18 @@ +public +protected +private +class +static +toString() +equals(|) +hashCode() +JTextField +JEditorPane +JTextPane +JComboBox +JList +JTree +jsyntaxpane +setContentType("text/|lang|") +setProperty("|key|") +for(int i=0; i < |max|; i++) {\n\t// loop body \n} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties new file mode 100644 index 000000000..974062bb2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties @@ -0,0 +1,86 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +Action.reflect = jsyntaxpane.actions.ReflectCompletionAction, control I, shift F1 +Action.reflect.MenuText = Reflections +# Enclose selection: Try Catch +Action.surround-try = jsyntaxpane.actions.TemplateAction, control T +Action.surround-try.MenuText = try catch block +Action.surround-try.ToolTip = Surround selection with a try catch block +Action.surround-try.Template = try {\n #{selection}\n} catch (#{p:Exception} ex) {\n} finally {\n} +Action.surround-try.WholeLines= true +Action.surround-while = jsyntaxpane.actions.TemplateAction, control W +Action.surround-while.MenuText = while loop +Action.surround-while.ToolTip = Surround selection in while loop +Action.surround-while.Template = while(#{p:condition}) {\n #{selection}\n} +Action.surround-while.WholeLines = true +Action.surround-debug = jsyntaxpane.actions.TemplateAction, control D +Action.surround-debug.MenuText = Debug Expression +Action.surround-debug.ToolTip = Output expression to System.out +Action.surround-debug.Template = System.out.println("The value of #{selection} = " + (#{selection})); +Action.surround-debug.WholeLines = false +Action.surround-debug.MustHaveSelection = true +Action.surround-if = jsyntaxpane.actions.TemplateAction, control I +Action.surround-if.MenuText = Surround with If +Action.surround-if.ToolTip = Surround expression with If condition +Action.surround-if.Template = if(#{p:condition}) {\n #{selection}\n}\n +Action.surround-if.WholeLines = true +Action.surround-if.MustHaveSelection = true +Action.surround-comment = jsyntaxpane.actions.TemplateAction +Action.surround-comment.MenuText = Block comment +Action.surround-comment.ToolTip = Surround lines with block comments +Action.surround-comment.Template = /*\n#{selection}\n*/ +Action.surround-comment.WholeLines = true +Action.surround-comment.MustHaveSelection = true +Action.insert-date = jsyntaxpane.actions.ScriptAction, F12 +Action.insert-date.Function = putDate +Script.insert-date.URL = jsyntaxpane/scripts/insertdate.js +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + reflect , \ + >Surround with , \ + surround-try , \ + surround-while , \ + surround-debug , \ + surround-if , \ + surround-comment , \ + < , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt new file mode 100644 index 000000000..e0afce77d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt @@ -0,0 +1,30 @@ +and +break +do +else +else \n\t#{p:block} +elseif +elseif (#{p:exp}) then \n\t#{p:block} +end +false +for +for #{p:var}=#{p:num},#{p:max} do \n\t|block \nend +for #{p:namelist} in #{p:explist} do \n\t#{p:block} \nend +function +function #{p:name} () \n\nend +if +if (#{p:exp}) then \n\t#{p:block} \nend +in +local +local function #{p:name} () \n\nend +nil +not +or +repeat +repeat \n\t#{p:block} \nuntil #{p:exp} +return +then +true +until +while +while (#{p:exp}) do \n\t#{p:block} \nend \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties new file mode 100644 index 000000000..8758f7c54 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties @@ -0,0 +1,23 @@ +# +# Lua Properties: +# + +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt + +# auto fill-in actions +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +# Style is one of: 0 = plain, 1=bold, 2=italic, 3=bold/italic +Style.OPERATOR = 0x000000, 0 +Style.KEYWORD = 0x3333ee, 0 +Style.STRING = 0xcc6600, 0 +Style.NUMBER = 0x999933, 1 +Style.IDENTIFIER = 0x000000, 0 +Style.COMMENT = 0x339933, 2 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties new file mode 100644 index 000000000..e29844cc6 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties @@ -0,0 +1,19 @@ +# +# Plain / Empty Document +# +Components = jsyntaxpane.components.LineNumbersRuler +PopupMenu = \ + cut-to-clipboard , \ + copy-to-clipboard , \ + paste-from-clipboard , \ + - , \ + select-all , \ + - , \ + undo , \ + redo , \ + - , \ + find , \ + find-next , \ + goto-line , \ + - , \ + complete-word diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties new file mode 100644 index 000000000..c707a1a33 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties new file mode 100644 index 000000000..3d41bd0b4 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties @@ -0,0 +1,14 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.jindent = jsyntaxpane.actions.PythonIndentAction, ENTER +# Action.unindent = jsyntaxpane.actions.PythonUnindentAction, shift TAB +Action.unindent.MenuText = Un-Indent +Action.unindent.Tooltip = Un-Indent block + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties new file mode 100644 index 000000000..6b0973237 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties @@ -0,0 +1,6 @@ +# +# Ruby +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " +Action.complete-word.WordsRegexp = \\w+(\\?)? \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties new file mode 100644 index 000000000..c707a1a33 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties new file mode 100644 index 000000000..0d6480fa8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "-- " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties new file mode 100644 index 000000000..0d6480fa8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "-- " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties new file mode 100644 index 000000000..736e9dd0f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties @@ -0,0 +1,18 @@ +# +# XHTMLSyntaxKit +# +Action.html-preview = jsyntaxpane.actions.HTMLPreviewAction, F1 +Action.html-preview.MenuText = Preview HTML +Action.html-preview.ToolTip = Preview in Java Swing internal Viewer, with auto update +Action.toggle-comments = jsyntaxpane.actions.TemplateAction, control SLASH +Action.toggle-comments.MenuText = Comment Block +Action.toggle-comments.SmallIcon = comment.png +Action.toggle-comments.MustHaveSelection = true +Action.toggle-comments.Template = +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-comments , \ + html-preview , \ + - , \ + toggle-lines \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties new file mode 100644 index 000000000..dc342eb24 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties @@ -0,0 +1,24 @@ +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler +PairMarker.Color = 0xffeeaa +Action.toggle-comments = jsyntaxpane.actions.TemplateAction, control SLASH +Action.toggle-comments.MenuText = Comment Block +Action.toggle-comments.SmallIcon = comment.png +Action.toggle-comments.MustHaveSelection = true +Action.toggle-comments.Template = +Action.prettify = jsyntaxpane.actions.XmlPrettifyAction, control P +Action.prettify.MenuText = Reformat XML +Action.prettify.ToolTip = Reformat XML +# The XmlPrettifyAction takes these config parameters: +# IndentAmount = int (amount of spaces for indentation, default = 4) +# StandAlone = yes/no, default = yes. see OutputKeys.STANDALONE +# OmitDeclaration = yes/no, default = yes. see OutputKeys.OMIT_XML_DECLARATION +# Indent = yes/no, default = yes. see OutputKeys.INDENT +Action.prettify.IndentAmount = 2 +Action.tag-close = jsyntaxpane.actions.XmlTagCompleteAction, typed > +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-comments , \ + prettify , \ + toggle-lines \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties new file mode 100644 index 000000000..3bcbe61bd --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties @@ -0,0 +1,4 @@ +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + Toggle Line Numbers = toggle-lines diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/annotation_type.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/annotation_type.png new file mode 100644 index 000000000..52ff9d6ee Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/annotation_type.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/class.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/class.png new file mode 100644 index 000000000..220e6f385 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/class.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor.png new file mode 100644 index 000000000..fd95f9d19 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_private.png new file mode 100644 index 000000000..eb58f0ab0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_protected.png new file mode 100644 index 000000000..006e905ab Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/constructor_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field.png new file mode 100644 index 000000000..06a86fb1d Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_private.png new file mode 100644 index 000000000..1d0ee3e4d Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_protected.png new file mode 100644 index 000000000..589610ca7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static.png new file mode 100644 index 000000000..32394788c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_private.png new file mode 100644 index 000000000..3b1c00aa0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_protected.png new file mode 100644 index 000000000..09cb7fb97 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/field_static_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method.png new file mode 100644 index 000000000..7be8a378a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_private.png new file mode 100644 index 000000000..5bbdd1782 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_protected.png new file mode 100644 index 000000000..325ed1875 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static.png new file mode 100644 index 000000000..414e584d2 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_private.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_private.png new file mode 100644 index 000000000..0a5e4b160 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_private.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_protected.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_protected.png new file mode 100644 index 000000000..e5f9c9bf8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/completions/method_static_protected.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/Thumbs.db b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/Thumbs.db new file mode 100644 index 000000000..1b208f783 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/Thumbs.db differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/comment.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/comment.png new file mode 100644 index 000000000..fb1aa5ca6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/comment.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/complete-word.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/complete-word.png new file mode 100644 index 000000000..32943e985 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/complete-word.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/completions.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/completions.png new file mode 100644 index 000000000..8851b99ba Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/completions.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/copy-to-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/copy-to-clipboard.png new file mode 100644 index 000000000..8dd48c494 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/copy-to-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/cut-to-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/cut-to-clipboard.png new file mode 100644 index 000000000..dc9eb9a7a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/cut-to-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace-all.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace-all.png new file mode 100644 index 000000000..8bf48cbdd Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace-all.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace.png new file mode 100644 index 000000000..6edbef614 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/edit-find-replace.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find-next.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find-next.png new file mode 100644 index 000000000..4d6b1252f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find-next.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find.png new file mode 100644 index 000000000..d072d3cbe Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/find.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-down.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-down.png new file mode 100644 index 000000000..3dd7fccdf Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-down.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-next.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-next.png new file mode 100644 index 000000000..6ef8de76e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-next.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-previous.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-previous.png new file mode 100644 index 000000000..659cd90d7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-previous.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-up.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-up.png new file mode 100644 index 000000000..fa9a7d71b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/go-up.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/goto-line.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/goto-line.png new file mode 100644 index 000000000..684c24799 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/goto-line.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/highlight.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/highlight.png new file mode 100644 index 000000000..fd9e6ec52 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/highlight.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/html-preview.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/html-preview.png new file mode 100644 index 000000000..ac5957ad6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/html-preview.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/indent.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/indent.png new file mode 100644 index 000000000..6bad6bbac Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/indent.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/jump-to-pair.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/jump-to-pair.png new file mode 100644 index 000000000..ddf0ee32c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/jump-to-pair.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/paste-from-clipboard.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/paste-from-clipboard.png new file mode 100644 index 000000000..24588a3a4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/paste-from-clipboard.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/play.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/play.png new file mode 100644 index 000000000..a7de0feb0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/play.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/redo.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/redo.png new file mode 100644 index 000000000..c3b0df039 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/redo.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/reflect.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/reflect.png new file mode 100644 index 000000000..01cfa6e96 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/reflect.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/select-all.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/select-all.png new file mode 100644 index 000000000..f4b0b19e0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/select-all.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/show-abbs.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/show-abbs.png new file mode 100644 index 000000000..7406c9566 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/show-abbs.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-comment.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-comment.png new file mode 100644 index 000000000..8c2b0ce4f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-comment.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-debug.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-debug.png new file mode 100644 index 000000000..39b906d0f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-debug.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-if.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-if.png new file mode 100644 index 000000000..8391c248f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-if.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-try.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-try.png new file mode 100644 index 000000000..074f88214 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-try.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-while.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-while.png new file mode 100644 index 000000000..890e2fc39 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-while.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-with.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-with.png new file mode 100644 index 000000000..d4f01a616 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround-with.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround.png new file mode 100644 index 000000000..d0d333169 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/surround.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-lines.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-lines.png new file mode 100644 index 000000000..a8909bb43 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-lines.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-token-marker.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-token-marker.png new file mode 100644 index 000000000..3cf16ed05 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/toggle-token-marker.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/undo.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/undo.png new file mode 100644 index 000000000..8b0fef9a8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/undo.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/unindent.png b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/unindent.png new file mode 100644 index 000000000..1787a7ff4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/images/small-icons/unindent.png differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties new file mode 100644 index 000000000..6a2f213c1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/defaultsyntaxkit/config.properties @@ -0,0 +1,153 @@ +# +# Main Configuration of JSyntaxPane +# +# ----------------------------------------------------------------------------- +# +# These will be used by all kits, unless the same key is used for a specific +# kit, in which case the specific will be used: +# +# These are the componets that will be installed be default for any kit, +# unless specified otherwise +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler +# This is the color to highlight tokens whenever the cursor is on them +TokenMarker.Color = 0xffeeaa +# Colors for PairMarkers +PairMarker.Color = 0xffbb77 +# +# Right Margin for LineNumbers border in pixels, Default = 5 +LineNumbers.RightMargin = 7 +# Foreground for line numbers, Default = Black +LineNumbers.Foreground = 0x333300 +# Background for line numbers, Default = White +LineNumbers.Background = 0xeeeeff +# Color to use for highlighting current line background +LineNumbers.CurrentBack = 0xccccee +# Default color for the Caret, Black +CaretColor = 0x000000 +# +# Actions: +# The key is of the format: +# Actions.NAME = class [, key]* +# where NAME is the name to be given to the Action. Any String [alpha or -] is valid. +# class is the fully qualified class name of the SyntaxAction class. +# Starting from 0.9.5, each Action will instantiate a new class. If you need +# to share some data between the Actions, then add a Property to the Document +# Key is the keyboard key to map it to as specified by +# KeyStroke.getKeyStroge(String key). You may have zero or more key bindings +# to an Action. The last Key bound will be shown in the popup menu if enabled. +# You can also specify the "menu" modifier, and it will be mapped to the proper menu +# key depending on the running platform (CTRL on Windows and ALT on Mac) +# +# Each fully qualified key can also be used as a prefix for configuring the Action +# Action.NAME.MenuText = The description to use in menus (This sets the Action NAME property) +# Action.NAME.SmallIcon = the smallicon to use. The default is to look for an icon +# with the same name as the action + ".png". This sets the Actions SMALL_ICON property +# Action.NAME.Tooltip = Tooltip displayed for menu. This sets the +# Actions SHORT_DESCRIPTION property +Action.quick-find = jsyntaxpane.actions.QuickFindAction, control F +Action.find = jsyntaxpane.actions.FindReplaceAction, control H +Action.find.MenuText = Find +Action.find.ToolTip= Display Find And Replace Dialog +Action.find-next = jsyntaxpane.actions.FindNextAction, F3 +Action.find-next.MenuText = Find Next +Action.find-next.ToolTip = Repeat Last Find +Action.goto-line = jsyntaxpane.actions.GotoLineAction, control G +Action.goto-line.MenuText = Goto Line Number +Action.goto-line.ToolTip = Goto Line Number +Action.indent = jsyntaxpane.actions.IndentAction, TAB +Action.indent.MenuText = Indent +Action.indent.Abbreviations = ${class_path}/abbreviations.properties +Action.unindent = jsyntaxpane.actions.UnindentAction, shift TAB +Action.unindent.MenuText = Un-Indent +Action.jindent = jsyntaxpane.actions.JIndentAction, ENTER +Action.undo = jsyntaxpane.actions.UndoAction, menu Z +Action.undo.MenuText = Undo +Action.redo = jsyntaxpane.actions.RedoAction, menu Y +Action.redo.MenuText = Redo +Action.delete-lines = jsyntaxpane.actions.DeleteLinesAction, control E +Action.delete-lines.MenuText = Delete Line(s) +Action.dup-lines-up = jsyntaxpane.actions.DuplicateLinesAction, shift control UP +Action.dup-lines-up.MenuText = DUplicate Lines Above +Action.dup-lines-down = jsyntaxpane.actions.DuplicateLinesAction, shift control DOWN +Action.dup-lines-down.MenuText = Duplicate Lines Below +Action.toggle-lines = jsyntaxpane.actions.ToggleComponentAction, control F2 +Action.toggle-lines.Component = jsyntaxpane.components.LineNumbersRuler +Action.toggle-lines.MenuText = Toggle Line Numbers +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.MenuText = Toggle Comments +Action.toggle-comments.SmallIcon = comment.png +Action.jump-to-pair = jsyntaxpane.actions.JumpToPairAction, control OPEN_BRACKET +Action.jump-to-pair.MenuText = Jump to Pair +Action.complete-word = jsyntaxpane.actions.CompleteWordAction, control K +Action.complete-word.MenuText = Complete Word +Action.smart-home = jsyntaxpane.actions.SmartHomeAction, HOME +Action.smart-home-select = jsyntaxpane.actions.SmartHomeSelectAction, shift HOME +Action.show-abbs = jsyntaxpane.actions.ShowAbbsAction, F8 +Action.show-abbs.MenuText = Show abbreviations +Action.show-abbs.ToolTip = Show abbreviations +# +# These configure the Default Actions provided by DefaultEditorKit for popup menus +DefaultAction.copy-to-clipboard.MenuText = Copy +DefaultAction.cut-to-clipboard.MenuText = Cut +DefaultAction.paste-from-clipboard.MenuText = Paste +DefaultAction.select-all.MenuText = Select All +# +# View configuration: +# This controls how text is anti-aliased on the editor control: +# see the RenderingHints.VALUE_TEXT_ANTIALIAS.... for details +# DEFAULT: use the JRE default (default value) +# ON: set to on, let the JRE determine best method for the display +# OFF: no AA +# GASP: used on GTK +# HBGR: +# HRGB: +# VBGR: +# VRGM +TextAA = ON +DEFAULT_EDIT_MENU= \ + cut-to-clipboard , \ + copy-to-clipboard , \ + paste-from-clipboard , \ + - , \ + select-all , \ + - , \ + undo , \ + redo , \ + - , \ + find , \ + find-next , \ + goto-line , \ + jump-to-pair , \ + - , \ + complete-word , \ + show-abbs + +# Default Popup Menu +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + goto-line , \ + toggle-comments +# +# These are the various Attributes for each TokenType. +# The keys of this map are the TokenType Strings, and the values are: +# color (hex, or integer), Font.Style attribute +# Style is one of: 0 = plain, 1=bold, 2=italic, 3=bold/italic +Style.OPERATOR = 0x000000, 0 +Style.DELIMITER = 0x000000, 1 +Style.KEYWORD = 0x3333ee, 0 +Style.KEYWORD2 = 0x3333ee, 3 +Style.TYPE = 0x000000, 2 +Style.TYPE2 = 0x000000, 1 +Style.TYPE3 = 0x000000, 3 +Style.STRING = 0xcc6600, 0 +Style.STRING2 = 0xcc6600, 1 +Style.NUMBER = 0x999933, 1 +Style.REGEX = 0xcc6600, 0 +Style.IDENTIFIER = 0x000000, 0 +Style.COMMENT = 0x339933, 2 +Style.COMMENT2 = 0x339933, 3 +Style.DEFAULT = 0x000000, 0 +Style.WARNING = 0xCC0000, 0 +Style.ERROR = 0xCC0000, 3 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/kitsfortypes.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/kitsfortypes.properties new file mode 100644 index 000000000..6387cf423 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/kitsfortypes.properties @@ -0,0 +1,29 @@ +# This file contains the default content types and the SyntaxKit class names +# that will be used for them. +# The keys are content types, and the values are the fully qualified class +# names +text/c=jsyntaxpane.syntaxkits.CSyntaxKit +text/cpp=jsyntaxpane.syntaxkits.CppSyntaxKit +text/java=jsyntaxpane.syntaxkits.JavaSyntaxKit +text/groovy=jsyntaxpane.syntaxkits.GroovySyntaxKit +text/javascript=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/js=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/json=jsyntaxpane.syntaxkits.JavaScriptSyntaxKit +text/xml=jsyntaxpane.syntaxkits.XmlSyntaxKit +text/sql=jsyntaxpane.syntaxkits.SqlSyntaxKit +text/properties=jsyntaxpane.syntaxkits.PropertiesSyntaxKit +text/python=jsyntaxpane.syntaxkits.PythonSyntaxKit +text/tal=jsyntaxpane.syntaxkits.TALSyntaxKit +text/jflex=jsyntaxpane.syntaxkits.JFlexSyntaxKit +text/ruby=jsyntaxpane.syntaxkits.RubySyntaxKit +text/scala=jsyntaxpane.syntaxkits.ScalaSyntaxKit +text/clojure=jsyntaxpane.syntaxkits.ClojureSyntaxKit +text/dosbatch=jsyntaxpane.syntaxkits.DOSBatchSyntaxKit +text/bash=jsyntaxpane.syntaxkits.BashSyntaxKit +text/xpath=jsyntaxpane.syntaxkits.XPathSyntaxKit +text/xhtml=jsyntaxpane.syntaxkits.XHTMLSyntaxKit +text/lua=jsyntaxpane.syntaxkits.LuaSyntaxKit +text/plain=jsyntaxpane.syntaxkits.PlainSyntaxKit +text/flasm3=jsyntaxpane.syntaxkits.Flasm3SyntaxKit +text/flasm=jsyntaxpane.syntaxkits.FlasmSyntaxKit +text/actionscript=jsyntaxpane.syntaxkits.ActionScriptSyntaxKit \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/scripts/insertdate.js b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/scripts/insertdate.js new file mode 100644 index 000000000..ea61d4d13 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/scripts/insertdate.js @@ -0,0 +1,8 @@ +// Import the needed java packages and classes +importPackage(java.util); +importClass(javax.swing.JOptionPane) + +function putDate() { + TARGET.replaceSelection("This is a dummy proc that inserts the Current Date:\n" + new Date()); + TARGET.replaceSelection("\nTab Size of doc = " + AU.getTabSize(TARGET)); +} \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties new file mode 100644 index 000000000..a33e52ed3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/actionscriptsyntaxkit/config.properties @@ -0,0 +1,28 @@ +# +# JavaScript +# +Action.execute-script = jsyntaxpane.actions.ScriptRunnerAction, control R +Action.execute-script.ScriptExtension = js +Action.execute-script.MenuText = Execute Script +Action.execute-script.ToolTip = Execute JavaScript in internal JRE +Action.execute-script.SmallIcon = play.png + +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + toggle-lines , \ + - , \ + execute-script + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties new file mode 100644 index 000000000..47503d6ea --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/bashsyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# BashSyntaxKit Specifics +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties new file mode 100644 index 000000000..4ec839104 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/clojuresyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# ClojureSyntaxKit +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "; " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties new file mode 100644 index 000000000..6c3c767d0 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/dosbatchsyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# DOS Batch Specifics +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "rem " diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties new file mode 100644 index 000000000..c2e13c019 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/abbreviations.properties @@ -0,0 +1,4 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/combocompletions.txt new file mode 100644 index 000000000..e69de29bb diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties new file mode 100644 index 000000000..23a063c35 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit/config.properties @@ -0,0 +1,36 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties new file mode 100644 index 000000000..c2e13c019 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/abbreviations.properties @@ -0,0 +1,4 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/combocompletions.txt new file mode 100644 index 000000000..e69de29bb diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties new file mode 100644 index 000000000..23a063c35 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit/config.properties @@ -0,0 +1,36 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +#Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +#Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties new file mode 100644 index 000000000..b2f71b7f1 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/abbreviations.properties @@ -0,0 +1,41 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced +pu=public +pr=private +st=static +cl=class #{p:TheClass} {\n} +St=String +In=Integer +Bo=Boolean +bo=boolean +fl=float +ch=char +wh=while +ex=extends +im=implements +Ex=Exception +en=enum #{p:TheEnum} {\n} +re=return +df=default: +cs=case #{p:value}:\n break; +sw=switch(#{p:expr}){\n case 1:\n break;\n} +iof=instanceof +trc=try {\n #{p:statements;}\n} catch (Exception e) {\n} +th=throw +thn=throw new +ths=throws +fori=for(int i=0; i<#{p:max}; i++) {\n // statement\n} +fore=for(#{p:Object} o: items) {\n // statement\n} +ife=if(#{p:condition}) {\n // When true\n} else {\n // when false\n} +iff=if(#{p:condition}) {\n // When true\n} +sout=System.out.println("#{p:text}"); +serr=System.err.println("#{p:Error text}"); +psvm=public static void main(String[] args) {\n #{p:}\n} +psfs=public static final String #{p:CONST} = ""; +psfi=public static final int #{p:CONST} = 0; +psfb=public static final boolean #{p:CONST} = true; +Psfs=private static final String #{p:CONST} = ""; +Psfi=private static final int #{p:CONST} = 0; +IAE=IllegalArgumentException \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties new file mode 100644 index 000000000..f9b01ebcb --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/groovysyntaxkit/config.properties @@ -0,0 +1,5 @@ +# +# Other Java type actions for other languages: +# +Style.COMMENT = 0x666666, 2 +Style.COMMENT2 = 0x666666, 3 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties new file mode 100644 index 000000000..a33e52ed3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javascriptsyntaxkit/config.properties @@ -0,0 +1,28 @@ +# +# JavaScript +# +Action.execute-script = jsyntaxpane.actions.ScriptRunnerAction, control R +Action.execute-script.ScriptExtension = js +Action.execute-script.MenuText = Execute Script +Action.execute-script.ToolTip = Execute JavaScript in internal JRE +Action.execute-script.SmallIcon = play.png + +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + toggle-lines , \ + - , \ + execute-script + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties new file mode 100644 index 000000000..e510d7049 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/abbreviations.properties @@ -0,0 +1,43 @@ +# This file contains the code templates that will be used by the Java Syntax +# editor kit. +# The keys are the completion strings, and the values are the full expansion +# of the text. The #{p:TEXT} will be replaced +pu=public +pr=private +st=static +cl=class #{p:TheClass} {\n} +St=String +In=Integer +Bo=Boolean +bo=boolean +fl=float +ch=char +wh=while +ex=extends +im=implements +Ex=Exception +en=enum #{p:TheEnum} {\n} +re=return +df=default: +cs=case #{p:value}:\n break; +sw=switch(#{p:expr}){\n case 1:\n break;\n} +iof=instanceof +trc=try {\n #{p:statements;}\n} catch (Exception e) {\n} +th=throw +thn=throw new +ths=throws +fori=for(int i=0; i<#{p:max}; i++) {\n // statement\n} +fore=for(#{p:Object} o: items) {\n // statement\n} +ife=if(#{p:condition}) {\n // When true\n} else {\n // when false\n} +iff=if(#{p:condition}) {\n // When true\n} +sout=System.out.println("#{p:text}"); +serr=System.err.println("#{p:Error text}"); +psvm=public static void main(String[] args) {\n #{p:}\n} +psfs=public static final String #{p:CONST} = ""; +psfi=public static final int #{p:CONST} = 0; +psfb=public static final boolean #{p:CONST} = true; +Psfs=private static final String #{p:CONST} = ""; +Psfi=private static final int #{p:CONST} = 0; +IAE=IllegalArgumentException +/*=/* #{p:} */ +/**=/**\n * #{p:}\n */ \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt new file mode 100644 index 000000000..916b81178 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/combocompletions.txt @@ -0,0 +1,18 @@ +public +protected +private +class +static +toString() +equals(|) +hashCode() +JTextField +JEditorPane +JTextPane +JComboBox +JList +JTree +jsyntaxpane +setContentType("text/|lang|") +setProperty("|key|") +for(int i=0; i < |max|; i++) {\n\t// loop body \n} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties new file mode 100644 index 000000000..974062bb2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/javasyntaxkit/config.properties @@ -0,0 +1,86 @@ +# +# JavaSyntaxKit Specific properties. +# +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler, \ + jsyntaxpane.components.TokenMarker +TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3 +# +# Performs single color selection (Default = false) +# +SingleColorSelect = true +RightMarginColumn = 80 +RightMarginColor = 0xdddddd +# +# Java Actions +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.toggle-token-marker = jsyntaxpane.actions.ToggleComponentAction, control F3 +Action.toggle-token-marker.MenuText = Toggle Token Marker +Action.toggle-token-marker.Component = jsyntaxpane.components.TokenMarker +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt +Action.reflect = jsyntaxpane.actions.ReflectCompletionAction, control I, shift F1 +Action.reflect.MenuText = Reflections +# Enclose selection: Try Catch +Action.surround-try = jsyntaxpane.actions.TemplateAction, control T +Action.surround-try.MenuText = try catch block +Action.surround-try.ToolTip = Surround selection with a try catch block +Action.surround-try.Template = try {\n #{selection}\n} catch (#{p:Exception} ex) {\n} finally {\n} +Action.surround-try.WholeLines= true +Action.surround-while = jsyntaxpane.actions.TemplateAction, control W +Action.surround-while.MenuText = while loop +Action.surround-while.ToolTip = Surround selection in while loop +Action.surround-while.Template = while(#{p:condition}) {\n #{selection}\n} +Action.surround-while.WholeLines = true +Action.surround-debug = jsyntaxpane.actions.TemplateAction, control D +Action.surround-debug.MenuText = Debug Expression +Action.surround-debug.ToolTip = Output expression to System.out +Action.surround-debug.Template = System.out.println("The value of #{selection} = " + (#{selection})); +Action.surround-debug.WholeLines = false +Action.surround-debug.MustHaveSelection = true +Action.surround-if = jsyntaxpane.actions.TemplateAction, control I +Action.surround-if.MenuText = Surround with If +Action.surround-if.ToolTip = Surround expression with If condition +Action.surround-if.Template = if(#{p:condition}) {\n #{selection}\n}\n +Action.surround-if.WholeLines = true +Action.surround-if.MustHaveSelection = true +Action.surround-comment = jsyntaxpane.actions.TemplateAction +Action.surround-comment.MenuText = Block comment +Action.surround-comment.ToolTip = Surround lines with block comments +Action.surround-comment.Template = /*\n#{selection}\n*/ +Action.surround-comment.WholeLines = true +Action.surround-comment.MustHaveSelection = true +Action.insert-date = jsyntaxpane.actions.ScriptAction, F12 +Action.insert-date.Function = putDate +Script.insert-date.URL = jsyntaxpane/scripts/insertdate.js +# +# These are the completions to be in the IntelliSense completion dialog +# comma separated values. +# Vertical bars: if there is one, it will position the cursor. If there are +# two, they will be start and end of selection +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent , \ + - , \ + toggle-comments , \ + - , \ + reflect , \ + >Surround with , \ + surround-try , \ + surround-while , \ + surround-debug , \ + surround-if , \ + surround-comment , \ + < , \ + toggle-lines , \ + toggle-token-marker \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt new file mode 100644 index 000000000..e0afce77d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/combocompletions.txt @@ -0,0 +1,30 @@ +and +break +do +else +else \n\t#{p:block} +elseif +elseif (#{p:exp}) then \n\t#{p:block} +end +false +for +for #{p:var}=#{p:num},#{p:max} do \n\t|block \nend +for #{p:namelist} in #{p:explist} do \n\t#{p:block} \nend +function +function #{p:name} () \n\nend +if +if (#{p:exp}) then \n\t#{p:block} \nend +in +local +local function #{p:name} () \n\nend +nil +not +or +repeat +repeat \n\t#{p:block} \nuntil #{p:exp} +return +then +true +until +while +while (#{p:exp}) do \n\t#{p:block} \nend \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties new file mode 100644 index 000000000..8758f7c54 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/luasyntaxkit/config.properties @@ -0,0 +1,23 @@ +# +# Lua Properties: +# + +# For completions, you have to define the Action (key to trigger completions): +Action.combo-completion = jsyntaxpane.actions.ComboCompletionAction, control SPACE +Action.combo-completion.MenuText = Completions +Action.combo-completion.ItemsURL=${class_path}/combocompletions.txt + +# auto fill-in actions +Action.parenthesis = jsyntaxpane.actions.PairAction, typed ( +Action.brackets = jsyntaxpane.actions.PairAction, typed [ +Action.quotes = jsyntaxpane.actions.PairAction, typed ' +Action.double-quotes = jsyntaxpane.actions.PairAction, typed " +Action.close-curly = jsyntaxpane.actions.JUnindentAction, typed } + +# Style is one of: 0 = plain, 1=bold, 2=italic, 3=bold/italic +Style.OPERATOR = 0x000000, 0 +Style.KEYWORD = 0x3333ee, 0 +Style.STRING = 0xcc6600, 0 +Style.NUMBER = 0x999933, 1 +Style.IDENTIFIER = 0x000000, 0 +Style.COMMENT = 0x339933, 2 \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties new file mode 100644 index 000000000..e29844cc6 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/plainsyntaxkit/config.properties @@ -0,0 +1,19 @@ +# +# Plain / Empty Document +# +Components = jsyntaxpane.components.LineNumbersRuler +PopupMenu = \ + cut-to-clipboard , \ + copy-to-clipboard , \ + paste-from-clipboard , \ + - , \ + select-all , \ + - , \ + undo , \ + redo , \ + - , \ + find , \ + find-next , \ + goto-line , \ + - , \ + complete-word diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties new file mode 100644 index 000000000..c707a1a33 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/propertiessyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties new file mode 100644 index 000000000..3d41bd0b4 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/pythonsyntaxkit/config.properties @@ -0,0 +1,14 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " +Action.indent.WordRegex=\\w+|\\/(\\*)+ +Action.jindent = jsyntaxpane.actions.PythonIndentAction, ENTER +# Action.unindent = jsyntaxpane.actions.PythonUnindentAction, shift TAB +Action.unindent.MenuText = Un-Indent +Action.unindent.Tooltip = Un-Indent block + +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + indent , \ + unindent + diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties new file mode 100644 index 000000000..6b0973237 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/rubysyntaxkit/config.properties @@ -0,0 +1,6 @@ +# +# Ruby +# +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control NUMBER_SIGN +Action.toggle-comments.LineComments = "# " +Action.complete-word.WordsRegexp = \\w+(\\?)? \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties new file mode 100644 index 000000000..c707a1a33 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/scalasyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "# " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties new file mode 100644 index 000000000..0d6480fa8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/sqlsyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "-- " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties new file mode 100644 index 000000000..0d6480fa8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/talsyntaxkit/config.properties @@ -0,0 +1,2 @@ +Action.toggle-comments = jsyntaxpane.actions.ToggleCommentsAction, control SLASH +Action.toggle-comments.LineComments = "-- " \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties new file mode 100644 index 000000000..736e9dd0f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xhtmlsyntaxkit/config.properties @@ -0,0 +1,18 @@ +# +# XHTMLSyntaxKit +# +Action.html-preview = jsyntaxpane.actions.HTMLPreviewAction, F1 +Action.html-preview.MenuText = Preview HTML +Action.html-preview.ToolTip = Preview in Java Swing internal Viewer, with auto update +Action.toggle-comments = jsyntaxpane.actions.TemplateAction, control SLASH +Action.toggle-comments.MenuText = Comment Block +Action.toggle-comments.SmallIcon = comment.png +Action.toggle-comments.MustHaveSelection = true +Action.toggle-comments.Template = +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-comments , \ + html-preview , \ + - , \ + toggle-lines \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties new file mode 100644 index 000000000..dc342eb24 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xmlsyntaxkit/config.properties @@ -0,0 +1,24 @@ +Components = jsyntaxpane.components.PairsMarker, \ + jsyntaxpane.components.LineNumbersRuler +PairMarker.Color = 0xffeeaa +Action.toggle-comments = jsyntaxpane.actions.TemplateAction, control SLASH +Action.toggle-comments.MenuText = Comment Block +Action.toggle-comments.SmallIcon = comment.png +Action.toggle-comments.MustHaveSelection = true +Action.toggle-comments.Template = +Action.prettify = jsyntaxpane.actions.XmlPrettifyAction, control P +Action.prettify.MenuText = Reformat XML +Action.prettify.ToolTip = Reformat XML +# The XmlPrettifyAction takes these config parameters: +# IndentAmount = int (amount of spaces for indentation, default = 4) +# StandAlone = yes/no, default = yes. see OutputKeys.STANDALONE +# OmitDeclaration = yes/no, default = yes. see OutputKeys.OMIT_XML_DECLARATION +# Indent = yes/no, default = yes. see OutputKeys.INDENT +Action.prettify.IndentAmount = 2 +Action.tag-close = jsyntaxpane.actions.XmlTagCompleteAction, typed > +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + toggle-comments , \ + prettify , \ + toggle-lines \ No newline at end of file diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties new file mode 100644 index 000000000..3bcbe61bd --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/META-INF/services/jsyntaxpane/syntaxkits/xpathsyntaxkit/config.properties @@ -0,0 +1,4 @@ +PopupMenu = \ + ${DEFAULT_EDIT_MENU} , \ + - , \ + Toggle Line Numbers = toggle-lines diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan$MyCompoundEdit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan$MyCompoundEdit.class new file mode 100644 index 000000000..c8a1424d8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan$MyCompoundEdit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan.class new file mode 100644 index 000000000..dc2b41f0b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/CompoundUndoMan.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/DefaultSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/DefaultSyntaxKit.class new file mode 100644 index 000000000..0a77e51dd Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/DefaultSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/JavaRegexKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/JavaRegexKit.class new file mode 100644 index 000000000..d0b6f69c8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/JavaRegexKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Lexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Lexer.class new file mode 100644 index 000000000..2ffeee742 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Lexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$1.class new file mode 100644 index 000000000..1c46b10ff Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$TokenIterator.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$TokenIterator.class new file mode 100644 index 000000000..524eebeb0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument$TokenIterator.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument.class new file mode 100644 index 000000000..c5df0af73 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxDocument.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyle.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyle.class new file mode 100644 index 000000000..5f31f60ec Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyle.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyles.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyles.class new file mode 100644 index 000000000..505231af7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxStyles.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$1.class new file mode 100644 index 000000000..696dce4c6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$2.class new file mode 100644 index 000000000..cb4cc3c04 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$3.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$3.class new file mode 100644 index 000000000..bd38cdc8e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester$3.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester.class new file mode 100644 index 000000000..1e9bad8d0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxTester.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxView.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxView.class new file mode 100644 index 000000000..d9e89aa53 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/SyntaxView.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Token.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Token.class new file mode 100644 index 000000000..946878c18 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/Token.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$1.class new file mode 100644 index 000000000..ac6c0451f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$LongestFirst.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$LongestFirst.class new file mode 100644 index 000000000..30366dc2e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$LongestFirst.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$ShortestFirst.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$ShortestFirst.class new file mode 100644 index 000000000..a31f912c6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators$ShortestFirst.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators.class new file mode 100644 index 000000000..23bf9e2ec Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenComparators.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenConstants.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenConstants.class new file mode 100644 index 000000000..2b381f875 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenConstants.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenType.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenType.class new file mode 100644 index 000000000..60ddd638f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/TokenType.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ActionUtils.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ActionUtils.class new file mode 100644 index 000000000..44213d529 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ActionUtils.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CaretMonitor.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CaretMonitor.class new file mode 100644 index 000000000..c156f94b4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CaretMonitor.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ComboCompletionAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ComboCompletionAction.class new file mode 100644 index 000000000..be4b56223 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ComboCompletionAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CompleteWordAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CompleteWordAction.class new file mode 100644 index 000000000..980a47e82 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/CompleteWordAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DefaultSyntaxAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DefaultSyntaxAction.class new file mode 100644 index 000000000..7686d82fe Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DefaultSyntaxAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DeleteLinesAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DeleteLinesAction.class new file mode 100644 index 000000000..824a47e7b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DeleteLinesAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DocumentSearchData.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DocumentSearchData.class new file mode 100644 index 000000000..5ed38b4c5 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DocumentSearchData.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DuplicateLinesAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DuplicateLinesAction.class new file mode 100644 index 000000000..2d6a9b03c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/DuplicateLinesAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindNextAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindNextAction.class new file mode 100644 index 000000000..00bd2671e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindNextAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindReplaceAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindReplaceAction.class new file mode 100644 index 000000000..11fccceb3 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/FindReplaceAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/GotoLineAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/GotoLineAction.class new file mode 100644 index 000000000..d3525939f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/GotoLineAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/HTMLPreviewAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/HTMLPreviewAction.class new file mode 100644 index 000000000..21e04fc10 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/HTMLPreviewAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/IndentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/IndentAction.class new file mode 100644 index 000000000..1f678e693 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/IndentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JIndentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JIndentAction.class new file mode 100644 index 000000000..81426e0c5 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JIndentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JUnindentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JUnindentAction.class new file mode 100644 index 000000000..69b326cec Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JUnindentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JumpToPairAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JumpToPairAction.class new file mode 100644 index 000000000..99edb2978 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/JumpToPairAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/MapCompletionAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/MapCompletionAction.class new file mode 100644 index 000000000..7e0691c4f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/MapCompletionAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PairAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PairAction.class new file mode 100644 index 000000000..85072159f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PairAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PythonIndentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PythonIndentAction.class new file mode 100644 index 000000000..226ea7d11 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/PythonIndentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/QuickFindAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/QuickFindAction.class new file mode 100644 index 000000000..37db64f83 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/QuickFindAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/RedoAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/RedoAction.class new file mode 100644 index 000000000..1031fce46 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/RedoAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ReflectCompletionAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ReflectCompletionAction.class new file mode 100644 index 000000000..8116056ed Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ReflectCompletionAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptAction.class new file mode 100644 index 000000000..665682e35 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptRunnerAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptRunnerAction.class new file mode 100644 index 000000000..02bdfc2a1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ScriptRunnerAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ShowAbbsAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ShowAbbsAction.class new file mode 100644 index 000000000..95978df28 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ShowAbbsAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeAction.class new file mode 100644 index 000000000..b15b733c8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeSelectAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeSelectAction.class new file mode 100644 index 000000000..7385db0c2 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SmartHomeSelectAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SyntaxAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SyntaxAction.class new file mode 100644 index 000000000..ab5ff80bf Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/SyntaxAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/TemplateAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/TemplateAction.class new file mode 100644 index 000000000..6fb378339 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/TemplateAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleCommentsAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleCommentsAction.class new file mode 100644 index 000000000..648b956c4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleCommentsAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleComponentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleComponentAction.class new file mode 100644 index 000000000..2c0065775 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/ToggleComponentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UndoAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UndoAction.class new file mode 100644 index 000000000..34d2b1853 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UndoAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UnindentAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UnindentAction.class new file mode 100644 index 000000000..ac90afc51 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/UnindentAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlPrettifyAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlPrettifyAction.class new file mode 100644 index 000000000..c0fcc7a2c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlPrettifyAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlTagCompleteAction.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlTagCompleteAction.class new file mode 100644 index 000000000..6321f1a71 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/XmlTagCompleteAction.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$1.class new file mode 100644 index 000000000..77f7cc225 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$2.class new file mode 100644 index 000000000..e6d879599 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$3.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$3.class new file mode 100644 index 000000000..294135b0b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog$3.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog.class new file mode 100644 index 000000000..11ddb7e9b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ComboCompletionDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ConstructorCell.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ConstructorCell.class new file mode 100644 index 000000000..841795283 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ConstructorCell.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/EscapeListener.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/EscapeListener.class new file mode 100644 index 000000000..255168124 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/EscapeListener.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/FieldCell.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/FieldCell.class new file mode 100644 index 000000000..f4d1748d4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/FieldCell.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$1.class new file mode 100644 index 000000000..b9a6c7566 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$2.class new file mode 100644 index 000000000..b3fd06108 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog.class new file mode 100644 index 000000000..63c291081 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/GotoLineDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame$1.class new file mode 100644 index 000000000..6c4ad32ac Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame.class new file mode 100644 index 000000000..ed30a28ca Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/HTMLPreviewFrame.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MemberCell.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MemberCell.class new file mode 100644 index 000000000..90cb96885 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MemberCell.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MembersListRenderer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MembersListRenderer.class new file mode 100644 index 000000000..e1f5bf15c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MembersListRenderer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MethodCell.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MethodCell.class new file mode 100644 index 000000000..3912315b5 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/MethodCell.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$1.class new file mode 100644 index 000000000..57ddd7ca1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$2.class new file mode 100644 index 000000000..dd09b8b2b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$3.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$3.class new file mode 100644 index 000000000..d8980962c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog$3.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog.class new file mode 100644 index 000000000..3f744b223 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/QuickFindDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$1.class new file mode 100644 index 000000000..be0061021 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$2.class new file mode 100644 index 000000000..088bcde07 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$3.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$3.class new file mode 100644 index 000000000..a32665293 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$3.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$4.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$4.class new file mode 100644 index 000000000..17b681580 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$4.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$5.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$5.class new file mode 100644 index 000000000..65a4790c8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog$5.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog.class new file mode 100644 index 000000000..35f230ef3 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReflectCompletionDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$1.class new file mode 100644 index 000000000..96bfa2649 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$2.class new file mode 100644 index 000000000..22098cd40 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$3.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$3.class new file mode 100644 index 000000000..94d6c36c0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$3.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$4.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$4.class new file mode 100644 index 000000000..52ed1d01d Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$4.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$5.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$5.class new file mode 100644 index 000000000..3dfefac99 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog$5.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog.class new file mode 100644 index 000000000..bede088fc Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ReplaceDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog$1.class new file mode 100644 index 000000000..cb5987e86 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog.class new file mode 100644 index 000000000..b4bdd5b8a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/actions/gui/ShowAbbsDialog.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$1.class new file mode 100644 index 000000000..b9af864cb Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$2.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$2.class new file mode 100644 index 000000000..3b4d4a5e8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler$2.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler.class new file mode 100644 index 000000000..61a924fe3 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/LineNumbersRuler.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers$SimpleMarker.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers$SimpleMarker.class new file mode 100644 index 000000000..c03625665 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers$SimpleMarker.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers.class new file mode 100644 index 000000000..e730f0f05 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/Markers.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/PairsMarker.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/PairsMarker.class new file mode 100644 index 000000000..8d05c0f7f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/PairsMarker.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent$Status.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent$Status.class new file mode 100644 index 000000000..178e86193 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent$Status.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent.class new file mode 100644 index 000000000..9ccfd59f3 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/SyntaxComponent.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/TokenMarker.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/TokenMarker.class new file mode 100644 index 000000000..7b47344b1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/components/TokenMarker.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ActionScriptLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ActionScriptLexer.class new file mode 100644 index 000000000..7bf36e543 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ActionScriptLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/BashLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/BashLexer.class new file mode 100644 index 000000000..ba00e5f98 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/BashLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CLexer.class new file mode 100644 index 000000000..099925f52 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ClojureLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ClojureLexer.class new file mode 100644 index 000000000..00431633b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ClojureLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CppLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CppLexer.class new file mode 100644 index 000000000..3ea83907c Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/CppLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DOSBatchLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DOSBatchLexer.class new file mode 100644 index 000000000..cdd26f449 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DOSBatchLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DefaultJFlexLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DefaultJFlexLexer.class new file mode 100644 index 000000000..562aa20a7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/DefaultJFlexLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/EmptyLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/EmptyLexer.class new file mode 100644 index 000000000..6f0c61db8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/EmptyLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/Flasm3Lexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/Flasm3Lexer.class new file mode 100644 index 000000000..b081c64bf Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/Flasm3Lexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/FlasmLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/FlasmLexer.class new file mode 100644 index 000000000..06e279d97 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/FlasmLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/GroovyLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/GroovyLexer.class new file mode 100644 index 000000000..989c1a8ab Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/GroovyLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JFlexLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JFlexLexer.class new file mode 100644 index 000000000..2a9b2d4ab Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JFlexLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaLexer.class new file mode 100644 index 000000000..615da1171 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaScriptLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaScriptLexer.class new file mode 100644 index 000000000..1ce88d708 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/JavaScriptLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/LuaLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/LuaLexer.class new file mode 100644 index 000000000..c66f361f6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/LuaLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PropertiesLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PropertiesLexer.class new file mode 100644 index 000000000..e967aa5f0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PropertiesLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PythonLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PythonLexer.class new file mode 100644 index 000000000..1014c4f53 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/PythonLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/RubyLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/RubyLexer.class new file mode 100644 index 000000000..ea865713f Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/RubyLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ScalaLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ScalaLexer.class new file mode 100644 index 000000000..db6d5e363 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/ScalaLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SimpleRegexLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SimpleRegexLexer.class new file mode 100644 index 000000000..2eedd40ad Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SimpleRegexLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SqlLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SqlLexer.class new file mode 100644 index 000000000..c170e5d45 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/SqlLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/TALLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/TALLexer.class new file mode 100644 index 000000000..9ec89bae1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/TALLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XHTMLLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XHTMLLexer.class new file mode 100644 index 000000000..71c5781e4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XHTMLLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XPathLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XPathLexer.class new file mode 100644 index 000000000..ab9ff24c6 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XPathLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XmlLexer.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XmlLexer.class new file mode 100644 index 000000000..eba64bf78 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/lexers/XmlLexer.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.class new file mode 100644 index 000000000..04ae29cda Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ActionScriptSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/BashSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/BashSyntaxKit.class new file mode 100644 index 000000000..3a7243242 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/BashSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CSyntaxKit.class new file mode 100644 index 000000000..32c0e1c07 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ClojureSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ClojureSyntaxKit.class new file mode 100644 index 000000000..7cd6f2ac5 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ClojureSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CppSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CppSyntaxKit.class new file mode 100644 index 000000000..85969f774 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/CppSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.class new file mode 100644 index 000000000..93e19b41a Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/DOSBatchSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.class new file mode 100644 index 000000000..a97a54bde Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/Flasm3SyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/FlasmSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/FlasmSyntaxKit.class new file mode 100644 index 000000000..1eb7507e9 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/FlasmSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/GroovySyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/GroovySyntaxKit.class new file mode 100644 index 000000000..0d3388ba7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/GroovySyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JFlexSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JFlexSyntaxKit.class new file mode 100644 index 000000000..6cfe40a47 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JFlexSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.class new file mode 100644 index 000000000..6e3c96e7b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaScriptSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaSyntaxKit.class new file mode 100644 index 000000000..49b76e731 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/JavaSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/LuaSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/LuaSyntaxKit.class new file mode 100644 index 000000000..daf737da2 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/LuaSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PlainSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PlainSyntaxKit.class new file mode 100644 index 000000000..aa0842ea0 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PlainSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.class new file mode 100644 index 000000000..8c0cc0b8e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PropertiesSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PythonSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PythonSyntaxKit.class new file mode 100644 index 000000000..ddb41d802 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/PythonSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/RubySyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/RubySyntaxKit.class new file mode 100644 index 000000000..eea212c73 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/RubySyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ScalaSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ScalaSyntaxKit.class new file mode 100644 index 000000000..4788a1c77 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/ScalaSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/SqlSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/SqlSyntaxKit.class new file mode 100644 index 000000000..cef9cb85e Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/SqlSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/TALSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/TALSyntaxKit.class new file mode 100644 index 000000000..3d8ae1289 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/TALSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.class new file mode 100644 index 000000000..a978eac8b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XHTMLSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XPathSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XPathSyntaxKit.class new file mode 100644 index 000000000..e39aaadc3 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XPathSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XmlSyntaxKit.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XmlSyntaxKit.class new file mode 100644 index 000000000..2a5b128d8 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/syntaxkits/XmlSyntaxKit.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$1.class new file mode 100644 index 000000000..2c6ffda09 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$StringKeyMatcher.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$StringKeyMatcher.class new file mode 100644 index 000000000..d67b376e1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration$StringKeyMatcher.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration.class new file mode 100644 index 000000000..93b9c5d9b Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/Configuration.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/JarServiceProvider.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/JarServiceProvider.class new file mode 100644 index 000000000..36e52b5e4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/JarServiceProvider.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/ReflectUtils.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/ReflectUtils.class new file mode 100644 index 000000000..8aea12018 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/ReflectUtils.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils$CamelCaseCompare.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils$CamelCaseCompare.class new file mode 100644 index 000000000..d1dca33bb Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils$CamelCaseCompare.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils.class new file mode 100644 index 000000000..df4a2b7a7 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/StringUtils.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils$1.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils$1.class new file mode 100644 index 000000000..e5fed2eb4 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils$1.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils.class b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils.class new file mode 100644 index 000000000..2072939b1 Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/classes/jsyntaxpane/util/SwingUtils.class differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java new file mode 100644 index 000000000..766aa396e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java @@ -0,0 +1,1025 @@ +/* The following code was generated by JFlex 1.4.3 on 28.7.10 14:58 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 28.7.10 14:58 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex + */ +public final class ActionScriptLexer extends DefaultJFlexLexer { + + /** + * This character denotes the end of file + */ + public static final int YYEOF = -1; + + /** + * initial size of the lookahead buffer + */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** + * lexical states + */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\66" + + "\1\21\1\0\1\6\1\66\1\67\1\22\1\54\1\55\1\5\1\71" + + "\1\62\1\20\1\16\1\4\1\10\3\14\4\15\2\11\1\62\1\62" + + "\1\65\1\63\1\64\1\62\1\0\3\13\1\72\1\17\1\13\7\6" + + "\1\53\11\6\1\12\2\6\1\60\1\23\1\61\1\66\1\6\1\0" + + "\1\24\1\25\1\31\1\42\1\34\1\44\1\51\1\37\1\40\1\6" + + "\1\36\1\33\1\46\1\35\1\32\1\47\1\6\1\30\1\26\1\27" + + "\1\41\1\52\1\50\1\43\1\45\1\6\1\56\1\70\1\57\1\62" + + "\41\7\2\0\4\6\4\0\1\6\2\0\1\7\7\0\1\6\4\0" + + "\1\6\5\0\27\6\1\0\37\6\1\0\u013f\6\31\0\162\6\4\0" + + "\14\6\16\0\5\6\11\0\1\6\21\0\130\7\5\0\23\7\12\0" + + "\1\6\13\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6\1\0" + + "\54\6\1\0\46\6\1\0\5\6\4\0\202\6\1\0\4\7\3\0" + + "\105\6\1\0\46\6\2\0\2\6\6\0\20\6\41\0\46\6\2\0" + + "\1\6\7\0\47\6\11\0\21\7\1\0\27\7\1\0\3\7\1\0" + + "\1\7\1\0\2\7\1\0\1\7\13\0\33\6\5\0\3\6\15\0" + + "\4\7\14\0\6\7\13\0\32\6\5\0\13\6\16\7\7\0\12\7" + + "\4\0\2\6\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6" + + "\2\7\1\0\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7" + + "\1\6\1\7\36\6\33\7\2\0\3\6\60\0\46\6\13\7\1\6" + + "\u014f\0\3\7\66\6\2\0\1\7\1\6\20\7\2\0\1\6\4\7" + + "\3\0\12\6\2\7\2\0\12\7\21\0\3\7\1\0\10\6\2\0" + + "\2\6\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0" + + "\1\7\1\6\7\7\2\0\2\7\2\0\3\7\11\0\1\7\4\0" + + "\2\6\1\0\3\6\2\7\2\0\12\7\4\6\15\0\3\7\1\0" + + "\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0" + + "\2\6\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0" + + "\3\7\13\0\4\6\1\0\1\6\7\0\14\7\3\6\14\0\3\7" + + "\1\0\11\6\1\0\3\6\1\0\26\6\1\0\7\6\1\0\2\6" + + "\1\0\5\6\2\0\1\7\1\6\10\7\1\0\3\7\1\0\3\7" + + "\2\0\1\6\17\0\2\6\2\7\2\0\12\7\1\0\1\6\17\0" + + "\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0" + + "\2\6\1\0\5\6\2\0\1\7\1\6\6\7\3\0\2\7\2\0" + + "\3\7\10\0\2\7\4\0\2\6\1\0\3\6\4\0\12\7\1\0" + + "\1\6\20\0\1\7\1\6\1\0\6\6\3\0\3\6\1\0\4\6" + + "\3\0\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0\3\6" + + "\3\0\10\6\1\0\3\6\4\0\5\7\3\0\3\7\1\0\4\7" + + "\11\0\1\7\17\0\11\7\11\0\1\6\7\0\3\7\1\0\10\6" + + "\1\0\3\6\1\0\27\6\1\0\12\6\1\0\5\6\4\0\7\7" + + "\1\0\3\7\1\0\4\7\7\0\2\7\11\0\2\6\4\0\12\7" + + "\22\0\2\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6" + + "\1\0\5\6\2\0\1\7\1\6\7\7\1\0\3\7\1\0\4\7" + + "\7\0\2\7\7\0\1\6\1\0\2\6\4\0\12\7\22\0\2\7" + + "\1\0\10\6\1\0\3\6\1\0\27\6\1\0\20\6\4\0\6\7" + + "\2\0\3\7\1\0\4\7\11\0\1\7\10\0\2\6\4\0\12\7" + + "\22\0\2\7\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6" + + "\2\0\7\6\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7" + + "\22\0\2\7\15\0\60\6\1\7\2\6\7\7\4\0\10\6\10\7" + + "\1\0\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6" + + "\2\0\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6" + + "\1\0\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0" + + "\2\7\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7" + + "\2\0\2\6\42\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7" + + "\1\0\1\7\1\0\1\7\4\0\2\7\10\6\1\0\42\6\6\0" + + "\24\7\1\0\2\7\4\6\4\0\10\7\1\0\44\7\11\0\1\7" + + "\71\0\42\6\1\0\5\6\1\0\2\6\1\0\7\7\3\0\4\7" + + "\6\0\12\7\6\0\6\6\4\7\106\0\46\6\12\0\51\6\7\0" + + "\132\6\5\0\104\6\5\0\122\6\6\0\7\6\1\0\77\6\1\0" + + "\1\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0" + + "\47\6\1\0\1\6\1\0\4\6\2\0\37\6\1\0\1\6\1\0" + + "\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\7\6\1\0" + + "\7\6\1\0\27\6\1\0\37\6\1\0\1\6\1\0\4\6\2\0" + + "\7\6\1\0\47\6\1\0\23\6\16\0\11\7\56\0\125\6\14\0" + + "\u026c\6\2\0\10\6\12\0\32\6\5\0\113\6\3\0\3\6\17\0" + + "\15\6\1\0\4\6\3\7\13\0\22\6\3\7\13\0\22\6\2\7" + + "\14\0\15\6\1\0\3\6\1\0\2\7\14\0\64\6\40\7\3\0" + + "\1\6\3\0\2\6\1\7\2\0\12\7\41\0\3\7\2\0\12\7" + + "\6\0\130\6\10\0\51\6\1\7\126\0\35\6\3\0\14\7\4\0" + + "\14\7\12\0\12\7\36\6\2\0\5\6\u038b\0\154\6\224\0\234\6" + + "\4\0\132\6\6\0\26\6\2\0\6\6\2\0\46\6\2\0\6\6" + + "\2\0\10\6\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6" + + "\2\0\65\6\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6" + + "\3\0\4\6\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6" + + "\17\0\4\7\32\0\5\7\20\0\2\6\23\0\1\6\13\0\4\7" + + "\6\0\6\7\1\0\1\6\15\0\1\6\40\0\22\6\36\0\15\7" + + "\4\0\1\7\3\0\6\7\27\0\1\6\4\0\1\6\2\0\12\6" + + "\1\0\1\6\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6" + + "\1\0\4\6\1\0\3\6\1\0\7\6\3\0\3\6\5\0\5\6" + + "\26\0\44\6\u0e81\0\3\6\31\0\11\6\6\7\1\0\5\6\2\0" + + "\5\6\4\0\126\6\2\0\2\7\2\0\3\6\1\0\137\6\5\0" + + "\50\6\4\0\136\6\21\0\30\6\70\0\20\6\u0200\0\u19b6\6\112\0" + + "\u51a6\6\132\0\u048d\6\u0773\0\u2ba4\6\u215c\0\u012e\6\2\0\73\6\225\0" + + "\7\6\14\0\5\6\5\0\1\6\1\7\12\6\1\0\15\6\1\0" + + "\5\6\1\0\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0" + + "\u016b\6\22\0\100\6\2\0\66\6\50\0\15\6\3\0\20\7\20\0" + + "\4\7\17\0\2\6\30\0\3\6\31\0\1\6\6\0\5\6\1\0" + + "\207\6\2\0\1\7\4\0\1\6\13\0\12\7\7\0\32\6\4\0" + + "\1\6\1\0\32\6\12\0\132\6\3\0\6\6\2\0\6\6\2\0" + + "\6\6\2\0\3\6\3\0\2\6\3\0\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int[] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\2\2\1\3\2\4\2\2\1\5\1\6" + + "\20\3\1\7\1\10\1\11\1\12\1\13\1\14\6\2" + + "\1\15\2\16\1\17\1\1\1\15\1\1\1\20\2\0" + + "\1\4\1\0\1\4\24\3\1\21\16\3\1\2\1\22" + + "\2\15\2\20\2\0\3\4\1\0\35\3\1\15\1\0" + + "\1\4\25\3\1\4\3\3\1\21\10\3\1\21\4\3" + + "\1\4\11\3\1\4\4\3\1\4\2\3\1\4\1\3"; + + private static int[] zzUnpackAction() { + int[] result = new int[194]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\73\0\166\0\261\0\354\0\u0127\0\u0162\0\u019d" + + "\0\u01d8\0\u0213\0\u024e\0\u0289\0\u02c4\0\261\0\261\0\u02ff" + + "\0\u033a\0\u0375\0\u03b0\0\u03eb\0\u0426\0\u0461\0\u049c\0\u04d7" + + "\0\u0512\0\u054d\0\u0588\0\u05c3\0\u05fe\0\u0639\0\u0674\0\261" + + "\0\261\0\261\0\261\0\261\0\261\0\261\0\u06af\0\u06ea" + + "\0\u0725\0\u0760\0\u079b\0\u07d6\0\u0811\0\261\0\261\0\u084c" + + "\0\u0887\0\u08c2\0\u08fd\0\u0938\0\u0973\0\u09ae\0\u09e9\0\261" + + "\0\u0a24\0\u0a5f\0\u0a9a\0\u0ad5\0\u0b10\0\u0b4b\0\u0b86\0\u0bc1" + + "\0\u0bfc\0\u0c37\0\u0c72\0\u0cad\0\u0ce8\0\u0d23\0\u0d5e\0\u0d99" + + "\0\u0dd4\0\u0e0f\0\u0e4a\0\u0e85\0\u01d8\0\u0ec0\0\u0efb\0\u0f36" + + "\0\u0f71\0\u0fac\0\u0fe7\0\u1022\0\u105d\0\u1098\0\u10d3\0\u110e" + + "\0\u1149\0\u1184\0\u11bf\0\u11fa\0\261\0\u1235\0\u1270\0\u12ab" + + "\0\261\0\u12e6\0\u1321\0\u0973\0\u135c\0\u1397\0\u13d2\0\u140d" + + "\0\u1448\0\u1483\0\u14be\0\u14f9\0\u1534\0\u156f\0\u15aa\0\u15e5" + + "\0\u1620\0\u165b\0\u1696\0\u16d1\0\u170c\0\u1747\0\u1782\0\u17bd" + + "\0\u17f8\0\u1833\0\u186e\0\u18a9\0\u18e4\0\u191f\0\u195a\0\u1995" + + "\0\u19d0\0\u1a0b\0\u1a46\0\u1a81\0\261\0\u1abc\0\u1af7\0\u1b32" + + "\0\u1b6d\0\u1ba8\0\u1be3\0\u1c1e\0\u1c59\0\u1c94\0\u1ccf\0\u1d0a" + + "\0\u1d45\0\u1d80\0\u1dbb\0\u1df6\0\u1e31\0\u1e6c\0\u1ea7\0\u1ee2" + + "\0\u1f1d\0\u1f58\0\u1f93\0\u1fce\0\u2009\0\u2044\0\u207f\0\u20ba" + + "\0\u15e5\0\u20f5\0\u2130\0\u216b\0\u21a6\0\u21e1\0\u221c\0\u2257" + + "\0\u2292\0\u22cd\0\u2308\0\u2343\0\u237e\0\u23b9\0\u23f4\0\u242f" + + "\0\u246a\0\u24a5\0\u24e0\0\u251b\0\u2556\0\u2591\0\u25cc\0\u2607" + + "\0\u2642\0\u267d\0\u26b8\0\u26f3\0\u272e\0\u2769\0\u27a4\0\u27df" + + "\0\u281a\0\u2855"; + + private static int[] zzUnpackRowMap() { + int[] result = new int[194]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int[] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\4\1\6\1\7\1\10\1\11\1\4" + + "\1\12\1\13\2\11\2\13\1\14\1\11\1\15\1\16" + + "\1\17\1\4\1\20\1\21\1\22\1\23\1\24\1\25" + + "\1\26\1\11\1\27\1\30\2\11\1\31\1\11\1\32" + + "\1\11\1\33\2\11\1\34\1\35\1\11\1\36\1\37" + + "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\10" + + "\1\47\1\50\1\10\1\51\1\52\1\53\1\11\1\54" + + "\1\55\1\56\16\54\1\57\1\54\1\60\47\54\1\61" + + "\1\55\1\56\17\61\1\57\1\62\47\61\75\0\1\4" + + "\73\0\1\6\73\0\1\63\1\64\55\0\1\46\72\0" + + "\1\46\15\0\10\11\1\0\1\11\4\0\30\11\16\0" + + "\1\11\10\0\2\13\1\65\1\0\2\13\1\66\1\67" + + "\14\0\1\67\5\0\1\70\1\65\26\0\1\70\10\0" + + "\2\13\2\0\2\13\1\66\1\67\14\0\1\67\5\0" + + "\1\70\27\0\1\70\10\0\2\66\2\0\2\66\75\0" + + "\1\46\42\0\1\46\15\0\10\11\1\0\1\11\4\0" + + "\1\11\1\71\26\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\4\11\1\72\1\11\1\73\21\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\3\11\1\74" + + "\11\11\1\75\6\11\1\76\3\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\4\11\1\77\6\11\1\100" + + "\14\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\10\11\1\101\17\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\1\102\5\11\1\103\1\104\3\11\1\105" + + "\14\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\26\11\1\106\1\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\1\107\6\11\1\110\7\11\1\111\10\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11" + + "\1\112\4\11\1\113\12\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\11\11\1\114\6\11\1\115\1\11" + + "\1\116\5\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\6\11\1\115\1\11\1\117\10\11\1\120\6\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\121" + + "\5\11\1\122\5\11\1\123\1\124\12\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\1\125\3\11\1\126" + + "\10\11\1\127\12\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\13\11\1\130\1\131\13\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\1\122\5\11\1\132" + + "\21\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\1\133\27\11\16\0\1\11\63\0\1\46\1\134\71\0" + + "\1\46\1\0\1\10\70\0\1\46\3\0\1\46\66\0" + + "\1\46\4\0\1\46\65\0\1\46\5\0\1\46\1\0" + + "\1\54\2\0\16\54\1\0\1\54\1\0\47\54\2\0" + + "\1\56\70\0\2\135\1\0\5\135\1\136\3\135\1\136" + + "\1\137\55\135\1\61\2\0\17\61\2\0\47\61\2\135" + + "\1\0\70\135\1\63\1\140\1\141\70\63\5\142\1\143" + + "\65\142\10\0\1\144\1\145\1\0\3\145\1\0\1\145" + + "\4\0\2\145\3\0\1\145\2\0\1\145\5\0\1\145" + + "\1\0\1\145\25\0\1\145\10\0\2\66\2\0\2\66" + + "\1\0\1\67\14\0\1\67\5\0\1\70\27\0\1\70" + + "\10\0\2\146\2\0\2\146\2\0\1\147\50\0\1\147" + + "\7\0\10\11\1\0\1\11\4\0\2\11\1\150\25\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11" + + "\1\151\17\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\6\11\1\152\21\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\1\153\27\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\23\11\1\154\4\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\155" + + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\15\11\1\156\3\11\1\115\6\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\4\11\1\157\7\11\1\160" + + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\3\11\1\161\24\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\2\11\1\156\1\107\24\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\11\11\1\162\16\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\163" + + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\1\122\27\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\10\11\1\164\17\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\5\11\1\165\22\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\2\11\1\156\25\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\3\11" + + "\1\166\24\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\24\11\1\115\3\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\7\11\1\167\20\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\2\11\1\170\1\171" + + "\24\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\23\11\1\172\4\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\20\11\1\173\7\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\11\11\1\174\16\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\7\11\1\110" + + "\20\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\4\11\1\115\23\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\11\11\1\175\16\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\11\11\1\176\16\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\5\11\1\177" + + "\22\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\6\11\1\200\5\11\1\201\13\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\1\11\1\202\26\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\203" + + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\3\11\1\165\24\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\14\11\1\204\13\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\27\11\1\115\16\0\1\11" + + "\63\0\1\46\1\10\16\0\1\137\3\0\2\137\65\0" + + "\1\205\3\0\2\205\57\0\1\141\70\0\5\142\1\206" + + "\65\142\4\0\1\141\1\143\75\0\2\207\1\0\3\207" + + "\1\0\1\207\4\0\2\207\3\0\1\207\2\0\1\207" + + "\5\0\1\207\1\0\1\207\25\0\1\207\10\0\2\146" + + "\2\0\2\146\24\0\1\70\27\0\1\70\10\0\2\146" + + "\2\0\2\146\63\0\10\11\1\0\1\11\4\0\3\11" + + "\1\210\24\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\1\211\27\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\7\11\1\212\20\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\3\11\1\213\24\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\10\11\1\122" + + "\17\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\3\11\1\107\24\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\10\11\1\115\17\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\6\11\1\214\21\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\2\11\1\115" + + "\25\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\15\11\1\215\12\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\2\11\1\216\1\217\24\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\2\11\1\160\25\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\4\11" + + "\1\220\23\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\13\11\1\115\14\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\10\11\1\221\17\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\7\11\1\115\20\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\3\11" + + "\1\222\24\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\10\11\1\223\17\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\6\11\1\224\1\225\20\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\1\226\27\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\227" + + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\1\230\27\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\5\11\1\231\22\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\12\11\1\232\15\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\3\11\1\233\24\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\26\11" + + "\1\234\1\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\7\11\1\213\20\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\7\11\1\156\20\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\16\11\1\115\11\11" + + "\16\0\1\11\4\142\1\141\1\206\65\142\10\0\2\235" + + "\1\0\3\235\1\0\1\235\4\0\2\235\3\0\1\235" + + "\2\0\1\235\5\0\1\235\1\0\1\235\25\0\1\235" + + "\6\0\10\11\1\0\1\11\4\0\4\11\1\236\23\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\12\11" + + "\1\115\15\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\10\11\1\237\17\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\14\11\1\240\13\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\24\11\1\241\3\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\4\11" + + "\1\242\23\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\3\11\1\115\24\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\14\11\1\243\13\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\4\11\1\244\23\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\11\11" + + "\1\245\16\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\1\246\27\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\4\11\1\247\23\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\4\11\1\216\23\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\10\11\1\250" + + "\17\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\15\11\1\251\12\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\22\11\1\213\5\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\7\11\1\252\20\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\3\11\1\253" + + "\24\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\1\254\27\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\10\11\1\255\17\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\1\256\27\11\16\0\1\11\10\0" + + "\2\257\1\0\3\257\1\0\1\257\4\0\2\257\3\0" + + "\1\257\2\0\1\257\5\0\1\257\1\0\1\257\25\0" + + "\1\257\6\0\10\11\1\0\1\11\4\0\1\260\27\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\242" + + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\5\11\1\115\22\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\11\11\1\115\16\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\11\11\1\261\16\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\262" + + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\16\11\1\160\11\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\11\11\1\263\16\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\20\11\1\264\7\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\22\11\1\265" + + "\5\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\7\11\1\216\20\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\7\11\1\266\20\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\14\11\1\267\13\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\25\11\1\156" + + "\2\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\5\11\1\270\22\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\3\11\1\156\24\11\16\0\1\11\10\0" + + "\2\271\1\0\3\271\1\0\1\271\4\0\2\271\3\0" + + "\1\271\2\0\1\271\5\0\1\271\1\0\1\271\25\0" + + "\1\271\6\0\10\11\1\0\1\11\4\0\5\11\1\216" + + "\22\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0" + + "\15\11\1\156\12\11\16\0\1\11\6\0\10\11\1\0" + + "\1\11\4\0\16\11\1\156\11\11\16\0\1\11\6\0" + + "\10\11\1\0\1\11\4\0\5\11\1\272\22\11\16\0" + + "\1\11\6\0\10\11\1\0\1\11\4\0\1\273\27\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11" + + "\1\274\17\11\16\0\1\11\6\0\10\11\1\0\1\11" + + "\4\0\21\11\1\115\6\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\6\11\1\242\21\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\3\11\1\275\24\11" + + "\16\0\1\11\10\0\2\276\1\0\3\276\1\0\1\276" + + "\4\0\2\276\3\0\1\276\2\0\1\276\5\0\1\276" + + "\1\0\1\276\25\0\1\276\6\0\10\11\1\0\1\11" + + "\4\0\10\11\1\277\17\11\16\0\1\11\6\0\10\11" + + "\1\0\1\11\4\0\5\11\1\156\22\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\11\11\1\300\16\11" + + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11" + + "\1\204\17\11\16\0\1\11\10\0\2\301\1\0\3\301" + + "\1\0\1\301\4\0\2\301\3\0\1\301\2\0\1\301" + + "\5\0\1\301\1\0\1\301\25\0\1\301\6\0\10\11" + + "\1\0\1\11\4\0\6\11\1\302\21\11\16\0\1\11" + + "\6\0\10\11\1\0\1\11\4\0\3\11\1\160\24\11" + + "\16\0\1\11\10\0\2\70\1\0\3\70\1\0\1\70" + + "\4\0\2\70\3\0\1\70\2\0\1\70\5\0\1\70" + + "\1\0\1\70\25\0\1\70\6\0\10\11\1\0\1\11" + + "\4\0\20\11\1\115\7\11\16\0\1\11"; + + private static int[] zzUnpackTrans() { + int[] result = new int[10384]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\11\1\2\11\20\1\7\11\7\1\2\11" + + "\4\1\2\0\1\1\1\0\1\11\44\1\1\11\3\1" + + "\1\11\2\0\3\1\1\0\35\1\1\11\1\0\74\1"; + + private static int[] zzUnpackAttribute() { + int[] result = new int[194]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** + * the input device + */ + private java.io.Reader zzReader; + + /** + * the current state of the DFA + */ + private int zzState; + + /** + * the current lexical state + */ + private int zzLexicalState = YYINITIAL; + + /** + * this buffer contains the current text to be matched and is + * the source of the yytext() string + */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** + * the textposition at the last accepting state + */ + private int zzMarkedPos; + + /** + * the current text position in the buffer + */ + private int zzCurrentPos; + + /** + * startRead marks the beginning of the yytext() string in the buffer + */ + private int zzStartRead; + + /** + * endRead marks the last character in the buffer, that has been read + * from input + */ + private int zzEndRead; + + /** + * number of newlines encountered up to the start of the matched text + */ + private int yyline; + + /** + * the number of characters up to the start of the matched text + */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** + * zzAtEOF == true <=> the scanner is at the EOF + */ + private boolean zzAtEOF; + + /** + * denotes if the user-EOF-code has already been executed + */ + private boolean zzEOFDone; + + /* user code: */ + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ActionScriptLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ActionScriptLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char[] zzUnpackCMap(String packed) { + char[] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1780) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * @throws java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos * 2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length - zzEndRead); + + if (numRead > 0) { + zzEndRead += numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + *

    + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); + } + + + /** + * Returns the character at position pos from the + * matched text. + *

    + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead + pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos - zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + *

    + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + *

    + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + *

    + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if (number > yylength()) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @throws java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char[] zzBufferL = zzBuffer; + char[] zzCMapL = ZZ_CMAP; + + int[] zzTransL = ZZ_TRANS; + int[] zzRowMapL = ZZ_ROWMAP; + int[] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar += zzMarkedPosL - zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: + { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ((zzAttributes & 1) == 1) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ((zzAttributes & 8) == 8) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: { + return token(TokenType.OPERATOR, -PARAN); + } + case 19: + break; + case 17: { + return token(TokenType.KEYWORD); + } + case 20: + break; + case 4: { + return token(TokenType.NUMBER); + } + case 21: + break; + case 2: { + return token(TokenType.OPERATOR); + } + case 22: + break; + case 9: { + return token(TokenType.OPERATOR, CURLY); + } + case 23: + break; + case 10: { + return token(TokenType.OPERATOR, -CURLY); + } + case 24: + break; + case 13: { + tokenLength += yylength(); + } + case 25: + break; + case 14: { + yybegin(YYINITIAL); + } + case 26: + break; + case 6: { + yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 27: + break; + case 15: { + yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 28: + break; + case 12: { + return token(TokenType.OPERATOR, -BRACKET); + } + case 29: + break; + case 7: { + return token(TokenType.OPERATOR, PARAN); + } + case 30: + break; + case 3: { + return token(TokenType.IDENTIFIER); + } + case 31: + break; + case 18: { + tokenLength += 2; + } + case 32: + break; + case 11: { + return token(TokenType.OPERATOR, BRACKET); + } + case 33: + break; + case 16: { + return token(TokenType.COMMENT); + } + case 34: + break; + case 5: { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 35: + break; + case 1: { + } + case 36: + break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java~ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java~ new file mode 100644 index 000000000..dedac0348 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ActionScriptLexer.java~ @@ -0,0 +1,982 @@ +/* The following code was generated by JFlex 1.4.3 on 22.7.10 20:11 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 22.7.10 20:11 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/actionscript.flex + */ +public final class ActionScriptLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\66"+ + "\1\21\1\0\1\6\1\66\1\67\1\22\1\54\1\55\1\5\1\71"+ + "\1\62\1\20\1\16\1\4\1\10\3\14\4\15\2\11\1\62\1\62"+ + "\1\65\1\63\1\64\1\62\1\0\3\13\1\72\1\17\1\13\7\6"+ + "\1\53\11\6\1\12\2\6\1\60\1\23\1\61\1\66\1\6\1\0"+ + "\1\24\1\25\1\31\1\42\1\34\1\44\1\51\1\37\1\40\1\6"+ + "\1\36\1\33\1\46\1\35\1\32\1\47\1\6\1\30\1\26\1\27"+ + "\1\41\1\52\1\50\1\43\1\45\1\6\1\56\1\70\1\57\1\62"+ + "\41\7\2\0\4\6\4\0\1\6\2\0\1\7\7\0\1\6\4\0"+ + "\1\6\5\0\27\6\1\0\37\6\1\0\u013f\6\31\0\162\6\4\0"+ + "\14\6\16\0\5\6\11\0\1\6\21\0\130\7\5\0\23\7\12\0"+ + "\1\6\13\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6\1\0"+ + "\54\6\1\0\46\6\1\0\5\6\4\0\202\6\1\0\4\7\3\0"+ + "\105\6\1\0\46\6\2\0\2\6\6\0\20\6\41\0\46\6\2\0"+ + "\1\6\7\0\47\6\11\0\21\7\1\0\27\7\1\0\3\7\1\0"+ + "\1\7\1\0\2\7\1\0\1\7\13\0\33\6\5\0\3\6\15\0"+ + "\4\7\14\0\6\7\13\0\32\6\5\0\13\6\16\7\7\0\12\7"+ + "\4\0\2\6\1\7\143\6\1\0\1\6\10\7\1\0\6\7\2\6"+ + "\2\7\1\0\4\7\2\6\12\7\3\6\2\0\1\6\17\0\1\7"+ + "\1\6\1\7\36\6\33\7\2\0\3\6\60\0\46\6\13\7\1\6"+ + "\u014f\0\3\7\66\6\2\0\1\7\1\6\20\7\2\0\1\6\4\7"+ + "\3\0\12\6\2\7\2\0\12\7\21\0\3\7\1\0\10\6\2\0"+ + "\2\6\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0"+ + "\1\7\1\6\7\7\2\0\2\7\2\0\3\7\11\0\1\7\4\0"+ + "\2\6\1\0\3\6\2\7\2\0\12\7\4\6\15\0\3\7\1\0"+ + "\6\6\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0"+ + "\2\6\1\0\2\6\2\0\1\7\1\0\5\7\4\0\2\7\2\0"+ + "\3\7\13\0\4\6\1\0\1\6\7\0\14\7\3\6\14\0\3\7"+ + "\1\0\11\6\1\0\3\6\1\0\26\6\1\0\7\6\1\0\2\6"+ + "\1\0\5\6\2\0\1\7\1\6\10\7\1\0\3\7\1\0\3\7"+ + "\2\0\1\6\17\0\2\6\2\7\2\0\12\7\1\0\1\6\17\0"+ + "\3\7\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0"+ + "\2\6\1\0\5\6\2\0\1\7\1\6\6\7\3\0\2\7\2\0"+ + "\3\7\10\0\2\7\4\0\2\6\1\0\3\6\4\0\12\7\1\0"+ + "\1\6\20\0\1\7\1\6\1\0\6\6\3\0\3\6\1\0\4\6"+ + "\3\0\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0\3\6"+ + "\3\0\10\6\1\0\3\6\4\0\5\7\3\0\3\7\1\0\4\7"+ + "\11\0\1\7\17\0\11\7\11\0\1\6\7\0\3\7\1\0\10\6"+ + "\1\0\3\6\1\0\27\6\1\0\12\6\1\0\5\6\4\0\7\7"+ + "\1\0\3\7\1\0\4\7\7\0\2\7\11\0\2\6\4\0\12\7"+ + "\22\0\2\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6"+ + "\1\0\5\6\2\0\1\7\1\6\7\7\1\0\3\7\1\0\4\7"+ + "\7\0\2\7\7\0\1\6\1\0\2\6\4\0\12\7\22\0\2\7"+ + "\1\0\10\6\1\0\3\6\1\0\27\6\1\0\20\6\4\0\6\7"+ + "\2\0\3\7\1\0\4\7\11\0\1\7\10\0\2\6\4\0\12\7"+ + "\22\0\2\7\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6"+ + "\2\0\7\6\3\0\1\7\4\0\6\7\1\0\1\7\1\0\10\7"+ + "\22\0\2\7\15\0\60\6\1\7\2\6\7\7\4\0\10\6\10\7"+ + "\1\0\12\7\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6"+ + "\2\0\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6"+ + "\1\0\1\6\2\0\2\6\1\0\4\6\1\7\2\6\6\7\1\0"+ + "\2\7\1\6\2\0\5\6\1\0\1\6\1\0\6\7\2\0\12\7"+ + "\2\0\2\6\42\0\1\6\27\0\2\7\6\0\12\7\13\0\1\7"+ + "\1\0\1\7\1\0\1\7\4\0\2\7\10\6\1\0\42\6\6\0"+ + "\24\7\1\0\2\7\4\6\4\0\10\7\1\0\44\7\11\0\1\7"+ + "\71\0\42\6\1\0\5\6\1\0\2\6\1\0\7\7\3\0\4\7"+ + "\6\0\12\7\6\0\6\6\4\7\106\0\46\6\12\0\51\6\7\0"+ + "\132\6\5\0\104\6\5\0\122\6\6\0\7\6\1\0\77\6\1\0"+ + "\1\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0"+ + "\47\6\1\0\1\6\1\0\4\6\2\0\37\6\1\0\1\6\1\0"+ + "\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\7\6\1\0"+ + "\7\6\1\0\27\6\1\0\37\6\1\0\1\6\1\0\4\6\2\0"+ + "\7\6\1\0\47\6\1\0\23\6\16\0\11\7\56\0\125\6\14\0"+ + "\u026c\6\2\0\10\6\12\0\32\6\5\0\113\6\3\0\3\6\17\0"+ + "\15\6\1\0\4\6\3\7\13\0\22\6\3\7\13\0\22\6\2\7"+ + "\14\0\15\6\1\0\3\6\1\0\2\7\14\0\64\6\40\7\3\0"+ + "\1\6\3\0\2\6\1\7\2\0\12\7\41\0\3\7\2\0\12\7"+ + "\6\0\130\6\10\0\51\6\1\7\126\0\35\6\3\0\14\7\4\0"+ + "\14\7\12\0\12\7\36\6\2\0\5\6\u038b\0\154\6\224\0\234\6"+ + "\4\0\132\6\6\0\26\6\2\0\6\6\2\0\46\6\2\0\6\6"+ + "\2\0\10\6\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6"+ + "\2\0\65\6\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6"+ + "\3\0\4\6\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6"+ + "\17\0\4\7\32\0\5\7\20\0\2\6\23\0\1\6\13\0\4\7"+ + "\6\0\6\7\1\0\1\6\15\0\1\6\40\0\22\6\36\0\15\7"+ + "\4\0\1\7\3\0\6\7\27\0\1\6\4\0\1\6\2\0\12\6"+ + "\1\0\1\6\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6"+ + "\1\0\4\6\1\0\3\6\1\0\7\6\3\0\3\6\5\0\5\6"+ + "\26\0\44\6\u0e81\0\3\6\31\0\11\6\6\7\1\0\5\6\2\0"+ + "\5\6\4\0\126\6\2\0\2\7\2\0\3\6\1\0\137\6\5\0"+ + "\50\6\4\0\136\6\21\0\30\6\70\0\20\6\u0200\0\u19b6\6\112\0"+ + "\u51a6\6\132\0\u048d\6\u0773\0\u2ba4\6\u215c\0\u012e\6\2\0\73\6\225\0"+ + "\7\6\14\0\5\6\5\0\1\6\1\7\12\6\1\0\15\6\1\0"+ + "\5\6\1\0\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0"+ + "\u016b\6\22\0\100\6\2\0\66\6\50\0\15\6\3\0\20\7\20\0"+ + "\4\7\17\0\2\6\30\0\3\6\31\0\1\6\6\0\5\6\1\0"+ + "\207\6\2\0\1\7\4\0\1\6\13\0\12\7\7\0\32\6\4\0"+ + "\1\6\1\0\32\6\12\0\132\6\3\0\6\6\2\0\6\6\2\0"+ + "\6\6\2\0\3\6\3\0\2\6\3\0\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\2\2\1\3\2\4\2\2\1\5\1\6"+ + "\20\3\1\7\1\10\1\11\1\12\1\13\1\14\6\2"+ + "\1\15\2\16\1\17\1\1\1\15\1\1\1\20\2\0"+ + "\1\4\1\0\1\4\24\3\1\21\16\3\1\2\1\22"+ + "\2\15\2\20\2\0\3\4\1\0\35\3\1\15\1\0"+ + "\1\4\25\3\1\4\3\3\1\21\10\3\1\21\4\3"+ + "\1\4\11\3\1\4\4\3\1\4\2\3\1\4\1\3"; + + private static int [] zzUnpackAction() { + int [] result = new int[194]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\73\0\166\0\261\0\354\0\u0127\0\u0162\0\u019d"+ + "\0\u01d8\0\u0213\0\u024e\0\u0289\0\u02c4\0\261\0\261\0\u02ff"+ + "\0\u033a\0\u0375\0\u03b0\0\u03eb\0\u0426\0\u0461\0\u049c\0\u04d7"+ + "\0\u0512\0\u054d\0\u0588\0\u05c3\0\u05fe\0\u0639\0\u0674\0\261"+ + "\0\261\0\261\0\261\0\261\0\261\0\261\0\u06af\0\u06ea"+ + "\0\u0725\0\u0760\0\u079b\0\u07d6\0\u0811\0\261\0\261\0\u084c"+ + "\0\u0887\0\u08c2\0\u08fd\0\u0938\0\u0973\0\u09ae\0\u09e9\0\261"+ + "\0\u0a24\0\u0a5f\0\u0a9a\0\u0ad5\0\u0b10\0\u0b4b\0\u0b86\0\u0bc1"+ + "\0\u0bfc\0\u0c37\0\u0c72\0\u0cad\0\u0ce8\0\u0d23\0\u0d5e\0\u0d99"+ + "\0\u0dd4\0\u0e0f\0\u0e4a\0\u0e85\0\u01d8\0\u0ec0\0\u0efb\0\u0f36"+ + "\0\u0f71\0\u0fac\0\u0fe7\0\u1022\0\u105d\0\u1098\0\u10d3\0\u110e"+ + "\0\u1149\0\u1184\0\u11bf\0\u11fa\0\261\0\u1235\0\u1270\0\u12ab"+ + "\0\261\0\u12e6\0\u1321\0\u0973\0\u135c\0\u1397\0\u13d2\0\u140d"+ + "\0\u1448\0\u1483\0\u14be\0\u14f9\0\u1534\0\u156f\0\u15aa\0\u15e5"+ + "\0\u1620\0\u165b\0\u1696\0\u16d1\0\u170c\0\u1747\0\u1782\0\u17bd"+ + "\0\u17f8\0\u1833\0\u186e\0\u18a9\0\u18e4\0\u191f\0\u195a\0\u1995"+ + "\0\u19d0\0\u1a0b\0\u1a46\0\u1a81\0\261\0\u1abc\0\u1af7\0\u1b32"+ + "\0\u1b6d\0\u1ba8\0\u1be3\0\u1c1e\0\u1c59\0\u1c94\0\u1ccf\0\u1d0a"+ + "\0\u1d45\0\u1d80\0\u1dbb\0\u1df6\0\u1e31\0\u1e6c\0\u1ea7\0\u1ee2"+ + "\0\u1f1d\0\u1f58\0\u1f93\0\u1fce\0\u2009\0\u2044\0\u207f\0\u20ba"+ + "\0\u15e5\0\u20f5\0\u2130\0\u216b\0\u21a6\0\u21e1\0\u221c\0\u2257"+ + "\0\u2292\0\u22cd\0\u2308\0\u2343\0\u237e\0\u23b9\0\u23f4\0\u242f"+ + "\0\u246a\0\u24a5\0\u24e0\0\u251b\0\u2556\0\u2591\0\u25cc\0\u2607"+ + "\0\u2642\0\u267d\0\u26b8\0\u26f3\0\u272e\0\u2769\0\u27a4\0\u27df"+ + "\0\u281a\0\u2855"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[194]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\4\1\6\1\7\1\10\1\11\1\4"+ + "\1\12\1\13\2\11\2\13\1\14\1\11\1\15\1\16"+ + "\1\17\1\4\1\20\1\21\1\22\1\23\1\24\1\25"+ + "\1\26\1\11\1\27\1\30\2\11\1\31\1\11\1\32"+ + "\1\11\1\33\2\11\1\34\1\35\1\11\1\36\1\37"+ + "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\10"+ + "\1\47\1\50\1\10\1\51\1\52\1\53\1\11\1\54"+ + "\1\55\1\56\16\54\1\57\1\54\1\60\47\54\1\61"+ + "\1\55\1\56\17\61\1\57\1\62\47\61\75\0\1\4"+ + "\73\0\1\6\73\0\1\63\1\64\55\0\1\46\72\0"+ + "\1\46\15\0\10\11\1\0\1\11\4\0\30\11\16\0"+ + "\1\11\10\0\2\13\1\65\1\0\2\13\1\66\1\67"+ + "\14\0\1\67\5\0\1\70\1\65\26\0\1\70\10\0"+ + "\2\13\2\0\2\13\1\66\1\67\14\0\1\67\5\0"+ + "\1\70\27\0\1\70\10\0\2\66\2\0\2\66\75\0"+ + "\1\46\42\0\1\46\15\0\10\11\1\0\1\11\4\0"+ + "\1\11\1\71\26\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\4\11\1\72\1\11\1\73\21\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\3\11\1\74"+ + "\11\11\1\75\6\11\1\76\3\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\4\11\1\77\6\11\1\100"+ + "\14\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\10\11\1\101\17\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\1\102\5\11\1\103\1\104\3\11\1\105"+ + "\14\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\26\11\1\106\1\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\1\107\6\11\1\110\7\11\1\111\10\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11"+ + "\1\112\4\11\1\113\12\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\11\11\1\114\6\11\1\115\1\11"+ + "\1\116\5\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\6\11\1\115\1\11\1\117\10\11\1\120\6\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\121"+ + "\5\11\1\122\5\11\1\123\1\124\12\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\1\125\3\11\1\126"+ + "\10\11\1\127\12\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\13\11\1\130\1\131\13\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\1\122\5\11\1\132"+ + "\21\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\1\133\27\11\16\0\1\11\63\0\1\46\1\134\71\0"+ + "\1\46\1\0\1\10\70\0\1\46\3\0\1\46\66\0"+ + "\1\46\4\0\1\46\65\0\1\46\5\0\1\46\1\0"+ + "\1\54\2\0\16\54\1\0\1\54\1\0\47\54\2\0"+ + "\1\56\70\0\2\135\1\0\5\135\1\136\3\135\1\136"+ + "\1\137\55\135\1\61\2\0\17\61\2\0\47\61\2\135"+ + "\1\0\70\135\1\63\1\140\1\141\70\63\5\142\1\143"+ + "\65\142\10\0\1\144\1\145\1\0\3\145\1\0\1\145"+ + "\4\0\2\145\3\0\1\145\2\0\1\145\5\0\1\145"+ + "\1\0\1\145\25\0\1\145\10\0\2\66\2\0\2\66"+ + "\1\0\1\67\14\0\1\67\5\0\1\70\27\0\1\70"+ + "\10\0\2\146\2\0\2\146\2\0\1\147\50\0\1\147"+ + "\7\0\10\11\1\0\1\11\4\0\2\11\1\150\25\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11"+ + "\1\151\17\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\6\11\1\152\21\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\1\153\27\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\23\11\1\154\4\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\155"+ + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\15\11\1\156\3\11\1\115\6\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\4\11\1\157\7\11\1\160"+ + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\3\11\1\161\24\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\2\11\1\156\1\107\24\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\11\11\1\162\16\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\163"+ + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\1\122\27\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\10\11\1\164\17\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\5\11\1\165\22\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\2\11\1\156\25\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\3\11"+ + "\1\166\24\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\24\11\1\115\3\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\7\11\1\167\20\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\2\11\1\170\1\171"+ + "\24\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\23\11\1\172\4\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\20\11\1\173\7\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\11\11\1\174\16\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\7\11\1\110"+ + "\20\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\4\11\1\115\23\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\11\11\1\175\16\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\11\11\1\176\16\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\5\11\1\177"+ + "\22\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\6\11\1\200\5\11\1\201\13\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\1\11\1\202\26\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\203"+ + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\3\11\1\165\24\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\14\11\1\204\13\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\27\11\1\115\16\0\1\11"+ + "\63\0\1\46\1\10\16\0\1\137\3\0\2\137\65\0"+ + "\1\205\3\0\2\205\57\0\1\141\70\0\5\142\1\206"+ + "\65\142\4\0\1\141\1\143\75\0\2\207\1\0\3\207"+ + "\1\0\1\207\4\0\2\207\3\0\1\207\2\0\1\207"+ + "\5\0\1\207\1\0\1\207\25\0\1\207\10\0\2\146"+ + "\2\0\2\146\24\0\1\70\27\0\1\70\10\0\2\146"+ + "\2\0\2\146\63\0\10\11\1\0\1\11\4\0\3\11"+ + "\1\210\24\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\1\211\27\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\7\11\1\212\20\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\3\11\1\213\24\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\10\11\1\122"+ + "\17\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\3\11\1\107\24\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\10\11\1\115\17\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\6\11\1\214\21\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\2\11\1\115"+ + "\25\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\15\11\1\215\12\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\2\11\1\216\1\217\24\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\2\11\1\160\25\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\4\11"+ + "\1\220\23\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\13\11\1\115\14\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\10\11\1\221\17\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\7\11\1\115\20\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\3\11"+ + "\1\222\24\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\10\11\1\223\17\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\6\11\1\224\1\225\20\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\1\226\27\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\227"+ + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\1\230\27\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\5\11\1\231\22\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\12\11\1\232\15\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\3\11\1\233\24\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\26\11"+ + "\1\234\1\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\7\11\1\213\20\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\7\11\1\156\20\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\16\11\1\115\11\11"+ + "\16\0\1\11\4\142\1\141\1\206\65\142\10\0\2\235"+ + "\1\0\3\235\1\0\1\235\4\0\2\235\3\0\1\235"+ + "\2\0\1\235\5\0\1\235\1\0\1\235\25\0\1\235"+ + "\6\0\10\11\1\0\1\11\4\0\4\11\1\236\23\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\12\11"+ + "\1\115\15\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\10\11\1\237\17\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\14\11\1\240\13\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\24\11\1\241\3\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\4\11"+ + "\1\242\23\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\3\11\1\115\24\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\14\11\1\243\13\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\4\11\1\244\23\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\11\11"+ + "\1\245\16\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\1\246\27\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\4\11\1\247\23\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\4\11\1\216\23\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\10\11\1\250"+ + "\17\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\15\11\1\251\12\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\22\11\1\213\5\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\7\11\1\252\20\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\3\11\1\253"+ + "\24\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\1\254\27\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\10\11\1\255\17\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\1\256\27\11\16\0\1\11\10\0"+ + "\2\257\1\0\3\257\1\0\1\257\4\0\2\257\3\0"+ + "\1\257\2\0\1\257\5\0\1\257\1\0\1\257\25\0"+ + "\1\257\6\0\10\11\1\0\1\11\4\0\1\260\27\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\1\242"+ + "\27\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\5\11\1\115\22\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\11\11\1\115\16\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\11\11\1\261\16\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\14\11\1\262"+ + "\13\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\16\11\1\160\11\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\11\11\1\263\16\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\20\11\1\264\7\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\22\11\1\265"+ + "\5\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\7\11\1\216\20\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\7\11\1\266\20\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\14\11\1\267\13\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\25\11\1\156"+ + "\2\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\5\11\1\270\22\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\3\11\1\156\24\11\16\0\1\11\10\0"+ + "\2\271\1\0\3\271\1\0\1\271\4\0\2\271\3\0"+ + "\1\271\2\0\1\271\5\0\1\271\1\0\1\271\25\0"+ + "\1\271\6\0\10\11\1\0\1\11\4\0\5\11\1\216"+ + "\22\11\16\0\1\11\6\0\10\11\1\0\1\11\4\0"+ + "\15\11\1\156\12\11\16\0\1\11\6\0\10\11\1\0"+ + "\1\11\4\0\16\11\1\156\11\11\16\0\1\11\6\0"+ + "\10\11\1\0\1\11\4\0\5\11\1\272\22\11\16\0"+ + "\1\11\6\0\10\11\1\0\1\11\4\0\1\273\27\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11"+ + "\1\274\17\11\16\0\1\11\6\0\10\11\1\0\1\11"+ + "\4\0\21\11\1\115\6\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\6\11\1\242\21\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\3\11\1\275\24\11"+ + "\16\0\1\11\10\0\2\276\1\0\3\276\1\0\1\276"+ + "\4\0\2\276\3\0\1\276\2\0\1\276\5\0\1\276"+ + "\1\0\1\276\25\0\1\276\6\0\10\11\1\0\1\11"+ + "\4\0\10\11\1\277\17\11\16\0\1\11\6\0\10\11"+ + "\1\0\1\11\4\0\5\11\1\156\22\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\11\11\1\300\16\11"+ + "\16\0\1\11\6\0\10\11\1\0\1\11\4\0\10\11"+ + "\1\204\17\11\16\0\1\11\10\0\2\301\1\0\3\301"+ + "\1\0\1\301\4\0\2\301\3\0\1\301\2\0\1\301"+ + "\5\0\1\301\1\0\1\301\25\0\1\301\6\0\10\11"+ + "\1\0\1\11\4\0\6\11\1\302\21\11\16\0\1\11"+ + "\6\0\10\11\1\0\1\11\4\0\3\11\1\160\24\11"+ + "\16\0\1\11\10\0\2\70\1\0\3\70\1\0\1\70"+ + "\4\0\2\70\3\0\1\70\2\0\1\70\5\0\1\70"+ + "\1\0\1\70\25\0\1\70\6\0\10\11\1\0\1\11"+ + "\4\0\20\11\1\115\7\11\16\0\1\11"; + + private static int [] zzUnpackTrans() { + int [] result = new int[10384]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\11\1\2\11\20\1\7\11\7\1\2\11"+ + "\4\1\2\0\1\1\1\0\1\11\44\1\1\11\3\1"+ + "\1\11\2\0\3\1\1\0\35\1\1\11\1\0\74\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[194]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ActionScriptLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ActionScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ActionScriptLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1780) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { return token(TokenType.OPERATOR, -PARAN); + } + case 19: break; + case 17: + { return token(TokenType.KEYWORD); + } + case 20: break; + case 4: + { return token(TokenType.NUMBER); + } + case 21: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 22: break; + case 9: + { return token(TokenType.OPERATOR, CURLY); + } + case 23: break; + case 10: + { return token(TokenType.OPERATOR, -CURLY); + } + case 24: break; + case 13: + { tokenLength += yylength(); + } + case 25: break; + case 14: + { yybegin(YYINITIAL); + } + case 26: break; + case 6: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 27: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 28: break; + case 12: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 29: break; + case 7: + { return token(TokenType.OPERATOR, PARAN); + } + case 30: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 31: break; + case 18: + { tokenLength += 2; + } + case 32: break; + case 11: + { return token(TokenType.OPERATOR, BRACKET); + } + case 33: break; + case 16: + { return token(TokenType.COMMENT); + } + case 34: break; + case 5: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 35: break; + case 1: + { + } + case 36: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/BashLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/BashLexer.java new file mode 100644 index 000000000..f26f9f904 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/BashLexer.java @@ -0,0 +1,1338 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/bash.flex + */ +public final class BashLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\12\0\1\2\2\0\1\1\22\0\1\54\1\6\1\7\1\5\1\24"+ + "\1\0\1\44\1\10\1\25\1\26\1\0\1\45\1\0\1\33\1\44"+ + "\1\44\2\4\1\57\1\60\6\4\1\66\1\44\1\40\1\41\1\40"+ + "\1\0\1\44\26\3\1\65\3\3\1\31\1\11\1\32\1\0\1\4"+ + "\1\12\1\22\1\52\1\21\1\15\1\20\1\14\1\37\1\46\1\13"+ + "\1\61\1\53\1\35\1\56\1\17\1\16\1\55\1\34\1\47\1\23"+ + "\1\36\1\50\1\62\1\51\1\63\1\64\1\42\1\27\1\0\1\30"+ + "\1\43\uff81\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\2\1\1\2\1\3\4\1\11\2\1\3\1\4"+ + "\1\5\1\6\1\7\1\10\1\11\1\3\4\2\3\3"+ + "\11\2\1\12\3\2\1\1\3\13\1\14\3\0\1\15"+ + "\2\12\1\2\1\16\5\2\1\12\4\2\1\12\1\17"+ + "\3\2\1\12\42\2\1\12\2\2\1\0\1\20\1\3"+ + "\2\0\3\2\1\12\10\2\1\12\14\2\1\12\20\2"+ + "\1\12\15\2\1\21\2\14\2\22\1\23\6\2\1\12"+ + "\4\2\1\12\50\2\1\24\3\2\1\12\30\2\1\12"+ + "\27\2\1\12\3\2\1\25\3\2\1\26\3\2\1\12"+ + "\1\27\1\2\1\12\11\2\1\12\5\2\1\12\10\2"+ + "\1\12\23\2\1\12\23\2\1\12\10\2"; + + private static int [] zzUnpackAction() { + int [] result = new int[373]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\67\0\156\0\245\0\334\0\u0113\0\u014a\0\u0181"+ + "\0\u01b8\0\u01ef\0\u0226\0\u025d\0\u0294\0\u02cb\0\u0302\0\u0339"+ + "\0\u0370\0\u03a7\0\u03de\0\67\0\u0415\0\67\0\67\0\67"+ + "\0\67\0\u044c\0\u0483\0\u04ba\0\u04f1\0\u0528\0\u055f\0\67"+ + "\0\u0596\0\u05cd\0\u0604\0\u063b\0\u0672\0\u06a9\0\u06e0\0\u0717"+ + "\0\u074e\0\u0785\0\u07bc\0\u07f3\0\u082a\0\u0861\0\u0898\0\u08cf"+ + "\0\u0906\0\67\0\u093d\0\u0974\0\u09ab\0\u09e2\0\u0a19\0\245"+ + "\0\u0a50\0\u0a87\0\u0abe\0\u0af5\0\u0b2c\0\u0b63\0\u0b9a\0\u0bd1"+ + "\0\u0c08\0\u0c3f\0\u0c76\0\u0cad\0\u0ce4\0\u0d1b\0\u0d52\0\u0d89"+ + "\0\u0dc0\0\u0df7\0\u0e2e\0\u0e65\0\u0e9c\0\u0ed3\0\u0f0a\0\u0f41"+ + "\0\u0f78\0\u0faf\0\u0fe6\0\u101d\0\u0c08\0\u1054\0\u108b\0\u10c2"+ + "\0\u10f9\0\u1130\0\u1167\0\u119e\0\u11d5\0\u120c\0\u1243\0\u127a"+ + "\0\u12b1\0\u12e8\0\u131f\0\u1356\0\u138d\0\u13c4\0\u13fb\0\u1432"+ + "\0\u1469\0\u14a0\0\u14d7\0\u150e\0\u1545\0\u157c\0\u15b3\0\u15ea"+ + "\0\u1621\0\67\0\u1658\0\u168f\0\u16c6\0\u16fd\0\u1734\0\u176b"+ + "\0\u17a2\0\u17d9\0\u1810\0\u1847\0\u187e\0\u18b5\0\u18ec\0\u1923"+ + "\0\u0e2e\0\u195a\0\u1991\0\u19c8\0\u19ff\0\u1a36\0\u1a6d\0\u1aa4"+ + "\0\u1adb\0\u1b12\0\u1b49\0\u1b80\0\u1bb7\0\u1bee\0\u1c25\0\u1c5c"+ + "\0\u1c93\0\u1cca\0\u1d01\0\u1d38\0\u1d6f\0\u1da6\0\u1ddd\0\u1e14"+ + "\0\u1e4b\0\u1e82\0\u1eb9\0\u1ef0\0\u1f27\0\u1f5e\0\u1f95\0\u1fcc"+ + "\0\u2003\0\u203a\0\u2071\0\u20a8\0\u20df\0\u2116\0\u214d\0\u2184"+ + "\0\u21bb\0\u21f2\0\u2229\0\u2260\0\u2297\0\u22ce\0\u2305\0\67"+ + "\0\67\0\u09ab\0\67\0\u233c\0\u2373\0\u23aa\0\u23e1\0\u2418"+ + "\0\u244f\0\u2486\0\u24bd\0\u24f4\0\u252b\0\u2562\0\u2599\0\u25d0"+ + "\0\u2607\0\u263e\0\u2675\0\u26ac\0\u26e3\0\u271a\0\u2751\0\u2788"+ + "\0\u27bf\0\u27f6\0\u282d\0\u2864\0\u289b\0\u28d2\0\u2909\0\u2940"+ + "\0\u2977\0\u29ae\0\u29e5\0\u2a1c\0\u2a53\0\u2a8a\0\u2ac1\0\u2af8"+ + "\0\u2b2f\0\u2b66\0\u2b9d\0\u2bd4\0\u2c0b\0\u2c42\0\u2c79\0\u2cb0"+ + "\0\u2ce7\0\u2d1e\0\u2d55\0\u2d8c\0\u2dc3\0\u2dfa\0\u2e31\0\67"+ + "\0\u2e68\0\u2e9f\0\u2ed6\0\u2f0d\0\u2f44\0\u2f7b\0\u2fb2\0\u2fe9"+ + "\0\u3020\0\u3057\0\u308e\0\u30c5\0\u30fc\0\u3133\0\u316a\0\u31a1"+ + "\0\u31d8\0\u320f\0\u3246\0\u327d\0\u32b4\0\u32eb\0\u3322\0\u3359"+ + "\0\u3390\0\u33c7\0\u33fe\0\u3435\0\u346c\0\u34a3\0\u34da\0\u3511"+ + "\0\u3548\0\u357f\0\u35b6\0\u35ed\0\u3624\0\u365b\0\u3692\0\u36c9"+ + "\0\u3700\0\u3737\0\u376e\0\u37a5\0\u37dc\0\u3813\0\u384a\0\u3881"+ + "\0\u38b8\0\u38ef\0\u3926\0\u395d\0\u3994\0\u39cb\0\u3a02\0\u3a39"+ + "\0\245\0\u3a70\0\u3aa7\0\u3ade\0\245\0\u3b15\0\u3b4c\0\u3b83"+ + "\0\u3bba\0\245\0\u3bf1\0\u3c28\0\u3c5f\0\u3c96\0\u3ccd\0\u3d04"+ + "\0\u3d3b\0\u3d72\0\u3da9\0\u3de0\0\u3e17\0\u2260\0\u3e4e\0\u3e85"+ + "\0\u3ebc\0\u3ef3\0\u3f2a\0\u3f61\0\u3f98\0\u3fcf\0\u4006\0\u403d"+ + "\0\u4074\0\u40ab\0\u40e2\0\u4119\0\u38b8\0\u4150\0\u4187\0\u41be"+ + "\0\u41f5\0\u422c\0\u4263\0\u429a\0\u2486\0\u42d1\0\u4308\0\u433f"+ + "\0\u4376\0\u43ad\0\u43e4\0\u441b\0\u4452\0\u4489\0\u44c0\0\u44f7"+ + "\0\u452e\0\u4565\0\u459c\0\u45d3\0\u460a\0\u4641\0\u3bba\0\u4678"+ + "\0\u46af\0\u46e6\0\u471d\0\u4754\0\u478b\0\u47c2\0\u47f9\0\u4830"+ + "\0\u4867\0\u489e\0\u48d5\0\u490c\0\u4943\0\u497a\0\u49b1\0\u49e8"+ + "\0\u4a1f\0\u4a56\0\u4a8d\0\u4ac4\0\u4afb"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[373]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\2\1\3\1\2\1\4\1\2\1\5\1\6\1\7"+ + "\1\10\1\2\1\11\1\12\1\13\1\14\1\15\1\16"+ + "\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26"+ + "\1\27\1\30\1\31\1\32\1\33\1\34\1\35\1\36"+ + "\1\6\1\37\1\4\1\2\1\40\1\41\1\42\1\43"+ + "\1\44\1\45\1\46\1\47\1\2\1\50\1\51\2\2"+ + "\1\52\1\53\1\54\1\55\1\56\1\57\71\0\1\2"+ + "\67\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\1\0\1\60\1\61\1\62"+ + "\3\60\1\63\60\60\41\0\1\40\25\0\1\64\2\0"+ + "\4\64\1\0\1\64\1\0\55\64\1\65\2\0\5\65"+ + "\2\0\55\65\1\66\2\0\6\66\2\0\54\66\3\0"+ + "\2\4\6\0\1\4\1\67\1\70\1\4\1\71\4\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\1\4"+ + "\1\72\7\4\4\0\2\4\6\0\1\73\1\4\1\74"+ + "\1\75\3\4\1\76\1\77\10\0\2\4\1\100\1\101"+ + "\2\0\1\4\3\0\1\4\1\102\1\103\3\4\1\0"+ + "\1\4\1\104\7\4\4\0\2\4\6\0\1\105\1\70"+ + "\1\106\1\107\1\4\1\110\1\70\1\111\1\4\10\0"+ + "\4\4\2\0\1\4\3\0\2\4\1\70\3\4\1\0"+ + "\1\4\1\112\7\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\1\113\10\4"+ + "\4\0\2\4\6\0\1\114\2\4\1\115\1\4\1\116"+ + "\2\4\1\117\10\0\1\4\1\70\2\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\4\4"+ + "\1\120\1\4\1\121\1\4\1\122\10\0\1\4\1\123"+ + "\1\124\1\125\2\0\1\4\3\0\6\4\1\0\4\4"+ + "\1\126\1\127\1\130\2\4\4\0\2\4\6\0\1\4"+ + "\1\131\1\70\1\132\3\4\1\133\1\134\10\0\1\4"+ + "\1\135\2\4\2\0\1\4\3\0\1\136\1\137\1\104"+ + "\2\4\1\140\1\0\1\70\1\100\7\4\4\0\2\4"+ + "\6\0\10\4\1\141\10\0\1\4\1\142\2\4\2\0"+ + "\1\4\3\0\3\4\1\143\2\4\1\0\1\144\10\4"+ + "\4\0\2\4\6\0\1\4\1\145\1\146\1\147\1\4"+ + "\1\150\1\151\1\4\1\152\10\0\1\4\1\153\1\154"+ + "\1\4\2\0\1\4\3\0\1\155\1\4\1\156\3\4"+ + "\1\0\1\157\6\4\1\160\1\4\26\0\1\161\67\0"+ + "\1\162\57\0\1\163\1\164\14\0\1\165\1\0\1\165"+ + "\2\0\1\40\27\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\2\4\1\166\3\4\1\0\11\4"+ + "\4\0\2\4\6\0\3\4\1\167\1\70\1\170\2\4"+ + "\1\171\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\1\172\10\4\4\0\2\4\6\0\1\173\2\4\1\174"+ + "\1\4\1\175\1\4\1\176\1\177\10\0\2\4\1\200"+ + "\1\4\2\0\1\4\3\0\1\201\1\202\4\4\1\0"+ + "\7\4\1\203\1\4\4\0\2\4\6\0\5\4\1\204"+ + "\1\4\1\205\1\4\10\0\4\4\2\0\1\206\3\0"+ + "\1\4\1\207\4\4\1\0\11\4\42\0\1\40\1\0"+ + "\1\40\70\0\1\40\24\0\2\4\6\0\1\210\2\4"+ + "\1\211\1\4\1\212\1\4\1\213\1\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\5\4\1\214\1\100\1\215\1\216\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\1\4\1\217\7\4"+ + "\4\0\2\4\6\0\4\4\1\220\3\4\1\221\10\0"+ + "\1\4\1\222\2\4\2\0\1\4\3\0\2\4\1\223"+ + "\3\4\1\0\1\4\1\224\7\4\4\0\2\4\6\0"+ + "\6\4\1\70\1\225\1\4\10\0\4\4\2\0\1\4"+ + "\3\0\1\226\1\227\4\4\1\0\11\4\4\0\2\4"+ + "\6\0\6\4\1\70\1\230\1\4\10\0\3\4\1\70"+ + "\2\0\1\231\3\0\1\4\1\232\1\233\3\4\1\0"+ + "\11\4\4\0\2\4\6\0\1\234\10\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\235\2\4\1\236\3\4\1\237\1\70\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\240\1\241\1\242"+ + "\2\4\1\0\11\4\4\0\2\4\6\0\3\4\1\243"+ + "\3\4\1\244\1\4\10\0\2\4\1\245\1\4\2\0"+ + "\1\4\3\0\5\4\1\246\1\0\1\4\1\247\3\4"+ + "\1\70\3\4\4\0\2\4\6\0\3\4\1\250\5\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\1\70\1\4\1\251\6\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\1\4\1\252"+ + "\7\4\4\0\2\4\6\0\7\4\1\253\1\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\5\4\1\254\3\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\3\4\1\255\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\1\256\7\0\11\256\10\0\4\256"+ + "\2\0\1\256\3\0\6\256\1\0\2\256\2\0\5\256"+ + "\1\0\1\60\1\61\1\62\64\60\2\0\1\62\64\0"+ + "\1\63\1\257\1\260\64\63\1\64\2\0\4\64\1\261"+ + "\1\64\1\0\55\64\1\65\2\0\5\65\2\0\42\65"+ + "\1\262\12\65\1\66\2\0\6\66\1\0\1\263\54\66"+ + "\3\0\2\4\6\0\2\4\1\264\3\4\1\265\2\4"+ + "\10\0\4\4\2\0\1\4\3\0\2\4\1\100\3\4"+ + "\1\0\11\4\4\0\2\4\6\0\10\4\1\266\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\1\177\10\4\4\0\2\4\6\0\4\4"+ + "\1\242\4\4\10\0\1\4\1\267\2\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\270"+ + "\1\271\7\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\1\4"+ + "\1\242\2\4\2\0\1\4\3\0\1\4\1\272\4\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\1\4"+ + "\1\273\2\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\6\4\1\143\2\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\1\70\10\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\274\4\4\1\0"+ + "\11\4\4\0\2\4\6\0\5\4\1\267\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\4\4\1\275\4\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\2\4\1\70\1\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\1\4\1\276"+ + "\7\4\10\0\3\4\1\70\2\0\1\4\3\0\1\4"+ + "\1\277\4\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\1\4\1\300\4\4"+ + "\1\0\11\4\4\0\2\4\6\0\4\4\1\301\4\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\6\4\1\302\2\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\2\4\1\267\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\5\4"+ + "\1\303\3\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\5\4\1\244\3\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\6\4\1\267\2\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\1\304"+ + "\5\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\2\4\1\252\1\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\1\4\1\305"+ + "\2\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\7\4\1\306\1\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\5\4\1\70\3\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\1\307\5\4\1\0\11\4\4\0\2\4\6\0\7\4"+ + "\1\310\1\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\311\7\4\1\267"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\1\312\5\4\1\0\11\4\4\0\2\4\6\0"+ + "\5\4\1\313\3\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\7\4\1\314"+ + "\1\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\1\104\4\4\1\315\3\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\1\316"+ + "\10\4\4\0\2\4\6\0\2\4\1\317\6\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\4\4\1\320\4\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\1\4\1\321\7\4\4\0"+ + "\2\4\6\0\10\4\1\322\10\0\1\4\2\70\1\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\1\157\10\4\4\0\2\4\6\0\5\4\1\323"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\324\5\4\10\0"+ + "\3\4\1\325\2\0\1\4\3\0\1\4\1\326\3\4"+ + "\1\327\1\0\1\4\1\330\7\4\4\0\2\4\6\0"+ + "\3\4\1\331\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\10\4\1\332"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\1\333\10\4\4\0\2\4\6\0"+ + "\1\334\10\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\5\4\1\70\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\2\4\1\70\1\4\2\0"+ + "\1\4\3\0\1\4\1\335\4\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\2\4\1\100\1\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\336\10\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\1\4\1\104\1\337\3\4\1\0"+ + "\11\4\4\0\2\4\6\0\2\4\1\70\6\4\10\0"+ + "\1\70\1\126\1\70\1\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\1\4\1\340\4\4\1\0\1\70"+ + "\10\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\1\70\5\4\1\0\11\4\4\0\2\4"+ + "\6\0\3\4\1\341\1\4\1\274\3\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\1\4"+ + "\1\342\4\4\1\0\11\4\4\0\2\4\6\0\1\343"+ + "\2\4\1\344\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\2\4\1\345\3\4\1\0\11\4\4\0\2\4\6\0"+ + "\2\4\1\307\6\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\1\4\1\70\7\4\4\0\2\4\6\0"+ + "\11\4\10\0\1\4\1\346\2\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\4\4\1\315"+ + "\4\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\1\4\1\347\7\4\26\0\1\350\61\0\1\40\102\0"+ + "\1\40\52\0\1\40\15\0\1\40\33\0\2\4\6\0"+ + "\3\4\1\351\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\3\4\1\143"+ + "\2\4\1\352\2\4\10\0\3\4\1\353\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\10\4"+ + "\1\254\10\0\2\4\1\70\1\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\3\4\1\311"+ + "\5\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\6\4\1\70\2\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\354\4\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\1\4\1\355\7\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\2\4\1\356\3\4\1\0\1\70\10\4\4\0\2\4"+ + "\6\0\5\4\1\70\2\4\1\104\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\314\10\4\10\0\4\4\2\0\1\4\3\0\1\4"+ + "\1\70\4\4\1\0\11\4\4\0\2\4\6\0\3\4"+ + "\1\357\5\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\7\4\1\70\1\4"+ + "\4\0\2\4\6\0\7\4\1\360\1\4\10\0\4\4"+ + "\2\0\1\4\3\0\2\4\1\267\3\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\1\267\10\4\4\0\2\4\6\0"+ + "\11\4\10\0\2\4\1\361\1\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\3\4\1\143\2\4\1\0"+ + "\11\4\4\0\2\4\6\0\1\100\10\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\3\4\1\362\1\4\1\100\3\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\10\4\1\363\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\10\4\1\364"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\7\4\1\242\1\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\10\4\1\152\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\4\4\1\365"+ + "\2\4\1\366\1\4\10\0\2\4\1\367\1\4\2\0"+ + "\1\4\3\0\4\4\1\326\1\4\1\0\1\4\1\370"+ + "\3\4\1\70\3\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\1\4\1\70"+ + "\7\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\7\4\1\371\1\4\4\0"+ + "\2\4\6\0\2\4\1\251\6\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\372\4\4\1\373\1\4\1\374\1\375\10\0\2\4"+ + "\1\376\1\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\5\4\1\377\3\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\u0100\10\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\2\4\1\u0101"+ + "\2\4\1\u0102\3\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\3\4\1\u0103"+ + "\3\4\1\270\1\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\2\4\1\356\1\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\1\u0104\2\4\1\u0105\1\4"+ + "\1\u0106\3\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\111\10\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\10\4\1\u0107\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\u0108"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\5\4\1\u0109\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\1\u010a\10\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\1\4\1\u010b\2\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\4\4\1\u010c\4\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\1\242\10\4\4\0\2\4\6\0"+ + "\10\4\1\u010d\10\0\2\4\1\u010e\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\u010f"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\10\4\1\u0110\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\2\4\1\70\6\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\1\4\1\267\1\u0111"+ + "\3\4\1\0\11\4\4\0\2\4\6\0\4\4\1\70"+ + "\4\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\u0112\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\1\u0113\1\u0114\1\251\1\4\1\330\4\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\5\4\1\70\3\4\4\0\2\4"+ + "\6\0\1\244\10\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\1\u0115\10\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\10\4\1\u0116\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\1\4\1\u0117"+ + "\4\4\1\0\11\4\4\0\2\4\6\0\10\4\1\70"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\5\4\1\104\3\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\256"+ + "\6\0\11\256\10\0\4\256\2\0\1\256\3\0\6\256"+ + "\1\0\11\256\3\0\1\260\67\0\2\4\6\0\3\4"+ + "\1\324\5\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\3\4\1\u0118\5\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\2\4\1\u0119\1\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\5\4\1\70\3\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\10\4"+ + "\1\143\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\u011a\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\1\4\1\u011b\7\4\4\0\2\4\6\0"+ + "\10\4\1\267\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\5\4\1\100\3\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\6\4\1\u011c\2\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\4\1\u011d\7\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\4\4"+ + "\1\u011e\1\4\1\u011f\1\4\1\70\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\5\4\1\u0120\3\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\5\4\1\u0121"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\1\4\1\u0122"+ + "\2\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\10\4\1\u010c\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\2\4\1\100\3\4"+ + "\1\0\11\4\4\0\2\4\6\0\3\4\1\u0123\5\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\4\4\1\u0124\1\4\1\0\11\4\4\0\2\4"+ + "\6\0\3\4\1\70\5\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\6\4"+ + "\1\u0125\2\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\4\1\70\7\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\2\4\1\u0126\1\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\6\4\1\104\2\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\1\4\1\70\2\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\6\4\1\70\2\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\3\4\1\357\1\4\1\313\1\4"+ + "\1\u0127\1\4\10\0\4\4\2\0\1\4\3\0\1\4"+ + "\1\70\4\4\1\0\11\4\4\0\2\4\6\0\1\270"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\2\4\1\u0128"+ + "\1\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\1\4\1\u0129\7\4\4\0\2\4\6\0"+ + "\5\4\1\u012a\3\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\7\4\1\u0115"+ + "\1\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\3\4\1\244\2\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\1\4\1\100\4\4\1\0\11\4\4\0\2\4\6\0"+ + "\3\4\1\u012b\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\6\4\1\265"+ + "\2\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\242\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\4\4\1\u012c\4\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\2\4\1\215"+ + "\3\4\1\0\11\4\4\0\2\4\6\0\5\4\1\u012d"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\7\4\1\254\1\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\3\4\1\u012e\5\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\4\1\311\7\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\114\4\4\1\0"+ + "\11\4\4\0\2\4\6\0\5\4\1\201\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\6\4\1\u012f\2\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\7\4\1\114\1\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\1\4\1\104"+ + "\7\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\1\104\10\4\4\0\2\4"+ + "\6\0\11\4\10\0\2\4\1\u0130\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\104"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\1\4\1\u0131"+ + "\2\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\2\4\1\u0132\1\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\7\4\1\u0133\1\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\3\4\1\u0134"+ + "\1\u011e\4\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\u0135\10\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\1\4\1\70"+ + "\7\4\4\0\2\4\6\0\5\4\1\u0136\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\6\4\1\152\2\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\1\4\1\104"+ + "\4\4\1\0\11\4\4\0\2\4\6\0\6\4\1\u0137"+ + "\2\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\1\70\10\4\4\0\2\4\6\0\3\4\1\u0138\5\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\2\4\1\u0139\3\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\2\4\1\u013a\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\2\4\1\u013b\1\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\114\10\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\2\4\1\u013c\6\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\2\4\1\u013d"+ + "\3\4\1\0\11\4\4\0\2\4\6\0\10\4\1\216"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\4\4\1\315\4\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\1\70\1\4\1\254\1\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\6\4\1\u013e\2\4\4\0\2\4\6\0\11\4\10\0"+ + "\1\4\1\142\2\4\2\0\1\4\3\0\6\4\1\0"+ + "\1\4\1\267\7\4\4\0\2\4\6\0\5\4\1\104"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\1\323\5\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\314\10\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\1\4\1\u013f\4\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\1\4\1\346\7\4\4\0\2\4\6\0\5\4\1\u0140"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\4\4\1\u0140\4\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\2\4\1\u0111\3\4\1\0\11\4\4\0\2\4\6\0"+ + "\6\4\1\152\2\4\10\0\1\4\1\267\2\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\7\4\1\u0141\1\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\u0142\4\4\1\0"+ + "\11\4\4\0\2\4\6\0\5\4\1\u013b\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\70\5\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\1\u0143\10\4\4\0\2\4\6\0"+ + "\7\4\1\143\1\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\1\4\1\u0144\2\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\1\4\1\u0145"+ + "\2\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\3\4\1\70\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\10\4"+ + "\1\u0146\10\0\2\4\1\267\1\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\u0147\5\4\1\0\11\4"+ + "\4\0\2\4\6\0\4\4\1\u0148\4\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\1\242"+ + "\5\4\1\0\11\4\4\0\2\4\6\0\4\4\1\104"+ + "\4\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\u0149\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\10\4\1\u014a\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\u014b"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\1\4\1\70\4\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\2\4\1\u011b\1\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\3\4\1\254\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\4\4\1\u014c\4\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\7\4\1\u012d\1\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\1\4"+ + "\1\u014d\4\4\1\0\11\4\4\0\2\4\6\0\7\4"+ + "\1\104\1\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\2\4"+ + "\1\u014e\1\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\3\4\1\70\5\4\4\0\2\4"+ + "\6\0\7\4\1\u014f\1\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\3\4"+ + "\1\u0150\5\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\10\4\1\u0151\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\7\4\1\u0152\1\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\3\4\1\u0153\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\1\4\1\267\2\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\u0154\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\4\4\1\242\4\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\u0155\10\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\7\4\1\u0127\1\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\3\4\1\104\5\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\2\4\1\u0156\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\1\4\1\314\2\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\1\u0157\10\4\4\0"+ + "\2\4\6\0\7\4\1\111\1\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\2\4\1\264\6\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\1\u0158\10\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\7\4\1\u0159\1\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\1\4\1\70\1\267\1\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\2\4\1\104"+ + "\3\4\1\0\11\4\4\0\2\4\6\0\4\4\1\u015a"+ + "\4\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\5\4\1\u015b\3\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\11\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\1\u015c\10\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\1\254"+ + "\10\4\4\0\2\4\6\0\3\4\1\u015d\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\4\4\1\u011e\4\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\3\4\1\u015e\5\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\1\4\1\244\4\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\1\u015f\10\4\4\0\2\4"+ + "\6\0\7\4\1\u0160\1\70\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\1\4\1\330\7\4\4\0\2\4"+ + "\6\0\6\4\1\u0161\2\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\1\4"+ + "\1\u0162\7\4\4\0\2\4\6\0\5\4\1\u0163\3\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\2\4\1\70\6\4\4\0\2\4"+ + "\6\0\11\4\10\0\2\4\1\250\1\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\4\4\2\0\1\4\3\0\3\4\1\242\2\4"+ + "\1\0\11\4\4\0\2\4\6\0\6\4\1\u0164\2\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\2\4\1\u0165\1\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\1\4\1\254\2\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\3\4"+ + "\1\u0166\5\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\1\4\1\307\7\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\1\4\1\u0167\7\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\u0168\10\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\1\4\1\267"+ + "\7\4\4\0\2\4\6\0\11\4\10\0\1\4\1\u0169"+ + "\2\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\6\4\1\u016a\2\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\1\4\1\267"+ + "\4\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\5\4\1\304\1\0\11\4"+ + "\4\0\2\4\6\0\3\4\1\314\5\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\4\4\1\u016a\4\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\7\4"+ + "\1\u016b\1\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\3\4\1\254\5\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\4\4\1\143\4\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\6\4\1\u016c\2\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\11\4"+ + "\10\0\2\4\1\u016d\1\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\11\4\10\0\4\4"+ + "\2\0\1\4\3\0\1\4\1\u016e\4\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\2\4\1\254\1\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\11\4\10\0\4\4\2\0\1\4\3\0\1\4"+ + "\1\200\4\4\1\0\11\4\4\0\2\4\6\0\4\4"+ + "\1\u016f\4\4\10\0\4\4\2\0\1\4\3\0\6\4"+ + "\1\0\11\4\4\0\2\4\6\0\2\4\1\242\6\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\3\4\1\u0170\5\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\70\10\4\10\0\4\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\1\254\10\4"+ + "\10\0\4\4\2\0\1\4\3\0\6\4\1\0\11\4"+ + "\4\0\2\4\6\0\11\4\10\0\4\4\2\0\1\4"+ + "\3\0\1\143\5\4\1\0\11\4\4\0\2\4\6\0"+ + "\1\4\1\70\3\4\1\u0171\1\u0172\2\4\10\0\4\4"+ + "\2\0\1\4\3\0\6\4\1\0\11\4\4\0\2\4"+ + "\6\0\1\4\1\254\7\4\10\0\4\4\2\0\1\4"+ + "\3\0\6\4\1\0\11\4\4\0\2\4\6\0\1\u010c"+ + "\10\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\3\4\1\244\5\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\3\4\1\u0173\5\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\2\4\1\267"+ + "\3\4\1\0\11\4\4\0\2\4\6\0\11\4\10\0"+ + "\4\4\2\0\1\4\3\0\4\4\1\70\1\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\2\4\1\314"+ + "\1\4\2\0\1\4\3\0\1\u0174\5\4\1\0\11\4"+ + "\4\0\2\4\6\0\2\4\1\70\6\4\10\0\1\70"+ + "\3\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\3\4\1\u0175\5\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\1\4\1\200\2\4\2\0\1\4\3\0"+ + "\6\4\1\0\11\4\4\0\2\4\6\0\2\4\1\267"+ + "\6\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\4\4\1\247\4\4\10\0"+ + "\4\4\2\0\1\4\3\0\6\4\1\0\11\4\4\0"+ + "\2\4\6\0\7\4\1\100\1\4\10\0\4\4\2\0"+ + "\1\4\3\0\6\4\1\0\11\4\4\0\2\4\6\0"+ + "\11\4\10\0\4\4\2\0\1\4\3\0\1\4\1\254"+ + "\4\4\1\0\11\4\4\0\2\4\6\0\5\4\1\77"+ + "\3\4\10\0\4\4\2\0\1\4\3\0\6\4\1\0"+ + "\11\4\4\0\2\4\6\0\11\4\10\0\4\4\2\0"+ + "\1\4\3\0\2\4\1\111\3\4\1\0\11\4\1\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[19250]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\21\1\1\11\1\1\4\11\6\1\1\11"+ + "\21\1\1\11\1\1\3\0\72\1\1\0\1\11\1\1"+ + "\2\0\72\1\2\11\1\1\1\11\64\1\1\11\215\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[373]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public BashLexer() { + super(); + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte DO = 4; + private static final byte CASE = 5; + private static final byte IF = 5; + private static final byte INT_EXPR = 6; + + @Override + public int yychar() { + return yychar; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public BashLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public BashLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 144) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 5: + { return token(TokenType.OPERATOR, -PARAN); + } + case 24: break; + case 10: + { return token(TokenType.KEYWORD); + } + case 25: break; + case 3: + { return token(TokenType.OPERATOR); + } + case 26: break; + case 6: + { return token(TokenType.OPERATOR, CURLY); + } + case 27: break; + case 7: + { return token(TokenType.OPERATOR, -CURLY); + } + case 28: break; + case 20: + { return token(TokenType.KEYWORD, INT_EXPR); + } + case 29: break; + case 18: + { return token(TokenType.STRING); + } + case 30: break; + case 17: + { return token(TokenType.TYPE); + } + case 31: break; + case 12: + { return token(TokenType.COMMENT2); + } + case 32: break; + case 1: + { /* skip */ + } + case 33: break; + case 9: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 34: break; + case 4: + { return token(TokenType.OPERATOR, PARAN); + } + case 35: break; + case 13: + { return token(TokenType.KEYWORD, IF); + } + case 36: break; + case 2: + { return token(TokenType.IDENTIFIER); + } + case 37: break; + case 14: + { return token(TokenType.KEYWORD, -IF); + } + case 38: break; + case 16: + { return token(TokenType.KEYWORD, -INT_EXPR); + } + case 39: break; + case 23: + { return token(TokenType.KEYWORD, CASE); + } + case 40: break; + case 8: + { return token(TokenType.OPERATOR, BRACKET); + } + case 41: break; + case 22: + { return token(TokenType.KEYWORD, -CASE); + } + case 42: break; + case 11: + { return token(TokenType.COMMENT); + } + case 43: break; + case 15: + { return token(TokenType.KEYWORD, DO); + } + case 44: break; + case 21: + { return token(TokenType.KEYWORD, -DO); + } + case 45: break; + case 19: + { return token(TokenType.STRING2); + } + case 46: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CLexer.java new file mode 100644 index 000000000..612f1bfad --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CLexer.java @@ -0,0 +1,973 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Copyright 2006 Arnout Engelen . + * Copyright 2000-2006 Omnicore Software, Hans Kratz & Dennis Strein GbR, + * Geert Bevin . + * Distributed under the terms of either: + * - the common development and distribution license (CDDL), v1.0; or + * - the GNU Lesser General Public License, v2.1 or later + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/c.flex + */ +public final class CLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\11\1\3\1\2\1\0\1\3\1\1\16\11\4\0\1\3\1\67"+ + "\1\56\1\6\1\7\1\67\1\67\1\60\1\61\1\62\1\5\1\34"+ + "\1\67\1\34\1\31\1\4\1\14\7\21\2\12\1\67\1\67\1\71"+ + "\1\67\1\70\1\67\1\0\3\20\1\27\1\33\1\27\5\13\1\25"+ + "\10\13\1\23\2\13\1\16\2\13\1\65\1\57\1\66\1\67\1\10"+ + "\1\0\1\37\1\35\1\17\1\30\1\32\1\26\1\47\1\43\1\46"+ + "\1\7\1\40\1\24\1\50\1\45\1\44\1\54\1\7\1\36\1\41"+ + "\1\42\1\22\1\55\1\53\1\15\1\51\1\52\1\63\1\67\1\64"+ + "\1\67\41\11\2\0\4\7\4\0\1\7\2\0\1\11\7\0\1\7"+ + "\4\0\1\7\5\0\27\7\1\0\37\7\1\0\u013f\7\31\0\162\7"+ + "\4\0\14\7\16\0\5\7\11\0\1\7\21\0\130\11\5\0\23\11"+ + "\12\0\1\7\13\0\1\7\1\0\3\7\1\0\1\7\1\0\24\7"+ + "\1\0\54\7\1\0\46\7\1\0\5\7\4\0\202\7\1\0\4\11"+ + "\3\0\105\7\1\0\46\7\2\0\2\7\6\0\20\7\41\0\46\7"+ + "\2\0\1\7\7\0\47\7\11\0\21\11\1\0\27\11\1\0\3\11"+ + "\1\0\1\11\1\0\2\11\1\0\1\11\13\0\33\7\5\0\3\7"+ + "\15\0\4\11\14\0\6\11\13\0\32\7\5\0\13\7\16\11\7\0"+ + "\12\11\4\0\2\7\1\11\143\7\1\0\1\7\10\11\1\0\6\11"+ + "\2\7\2\11\1\0\4\11\2\7\12\11\3\7\2\0\1\7\17\0"+ + "\1\11\1\7\1\11\36\7\33\11\2\0\3\7\60\0\46\7\13\11"+ + "\1\7\u014f\0\3\11\66\7\2\0\1\11\1\7\20\11\2\0\1\7"+ + "\4\11\3\0\12\7\2\11\2\0\12\11\21\0\3\11\1\0\10\7"+ + "\2\0\2\7\2\0\26\7\1\0\7\7\1\0\1\7\3\0\4\7"+ + "\2\0\1\11\1\7\7\11\2\0\2\11\2\0\3\11\11\0\1\11"+ + "\4\0\2\7\1\0\3\7\2\11\2\0\12\11\4\7\15\0\3\11"+ + "\1\0\6\7\4\0\2\7\2\0\26\7\1\0\7\7\1\0\2\7"+ + "\1\0\2\7\1\0\2\7\2\0\1\11\1\0\5\11\4\0\2\11"+ + "\2\0\3\11\13\0\4\7\1\0\1\7\7\0\14\11\3\7\14\0"+ + "\3\11\1\0\11\7\1\0\3\7\1\0\26\7\1\0\7\7\1\0"+ + "\2\7\1\0\5\7\2\0\1\11\1\7\10\11\1\0\3\11\1\0"+ + "\3\11\2\0\1\7\17\0\2\7\2\11\2\0\12\11\1\0\1\7"+ + "\17\0\3\11\1\0\10\7\2\0\2\7\2\0\26\7\1\0\7\7"+ + "\1\0\2\7\1\0\5\7\2\0\1\11\1\7\6\11\3\0\2\11"+ + "\2\0\3\11\10\0\2\11\4\0\2\7\1\0\3\7\4\0\12\11"+ + "\1\0\1\7\20\0\1\11\1\7\1\0\6\7\3\0\3\7\1\0"+ + "\4\7\3\0\2\7\1\0\1\7\1\0\2\7\3\0\2\7\3\0"+ + "\3\7\3\0\10\7\1\0\3\7\4\0\5\11\3\0\3\11\1\0"+ + "\4\11\11\0\1\11\17\0\11\11\11\0\1\7\7\0\3\11\1\0"+ + "\10\7\1\0\3\7\1\0\27\7\1\0\12\7\1\0\5\7\4\0"+ + "\7\11\1\0\3\11\1\0\4\11\7\0\2\11\11\0\2\7\4\0"+ + "\12\11\22\0\2\11\1\0\10\7\1\0\3\7\1\0\27\7\1\0"+ + "\12\7\1\0\5\7\2\0\1\11\1\7\7\11\1\0\3\11\1\0"+ + "\4\11\7\0\2\11\7\0\1\7\1\0\2\7\4\0\12\11\22\0"+ + "\2\11\1\0\10\7\1\0\3\7\1\0\27\7\1\0\20\7\4\0"+ + "\6\11\2\0\3\11\1\0\4\11\11\0\1\11\10\0\2\7\4\0"+ + "\12\11\22\0\2\11\1\0\22\7\3\0\30\7\1\0\11\7\1\0"+ + "\1\7\2\0\7\7\3\0\1\11\4\0\6\11\1\0\1\11\1\0"+ + "\10\11\22\0\2\11\15\0\60\7\1\11\2\7\7\11\4\0\10\7"+ + "\10\11\1\0\12\11\47\0\2\7\1\0\1\7\2\0\2\7\1\0"+ + "\1\7\2\0\1\7\6\0\4\7\1\0\7\7\1\0\3\7\1\0"+ + "\1\7\1\0\1\7\2\0\2\7\1\0\4\7\1\11\2\7\6\11"+ + "\1\0\2\11\1\7\2\0\5\7\1\0\1\7\1\0\6\11\2\0"+ + "\12\11\2\0\2\7\42\0\1\7\27\0\2\11\6\0\12\11\13\0"+ + "\1\11\1\0\1\11\1\0\1\11\4\0\2\11\10\7\1\0\42\7"+ + "\6\0\24\11\1\0\2\11\4\7\4\0\10\11\1\0\44\11\11\0"+ + "\1\11\71\0\42\7\1\0\5\7\1\0\2\7\1\0\7\11\3\0"+ + "\4\11\6\0\12\11\6\0\6\7\4\11\106\0\46\7\12\0\51\7"+ + "\7\0\132\7\5\0\104\7\5\0\122\7\6\0\7\7\1\0\77\7"+ + "\1\0\1\7\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7"+ + "\2\0\47\7\1\0\1\7\1\0\4\7\2\0\37\7\1\0\1\7"+ + "\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0\7\7"+ + "\1\0\7\7\1\0\27\7\1\0\37\7\1\0\1\7\1\0\4\7"+ + "\2\0\7\7\1\0\47\7\1\0\23\7\16\0\11\11\56\0\125\7"+ + "\14\0\u026c\7\2\0\10\7\12\0\32\7\5\0\113\7\3\0\3\7"+ + "\17\0\15\7\1\0\4\7\3\11\13\0\22\7\3\11\13\0\22\7"+ + "\2\11\14\0\15\7\1\0\3\7\1\0\2\11\14\0\64\7\40\11"+ + "\3\0\1\7\3\0\2\7\1\11\2\0\12\11\41\0\3\11\2\0"+ + "\12\11\6\0\130\7\10\0\51\7\1\11\126\0\35\7\3\0\14\11"+ + "\4\0\14\11\12\0\12\11\36\7\2\0\5\7\u038b\0\154\7\224\0"+ + "\234\7\4\0\132\7\6\0\26\7\2\0\6\7\2\0\46\7\2\0"+ + "\6\7\2\0\10\7\1\0\1\7\1\0\1\7\1\0\1\7\1\0"+ + "\37\7\2\0\65\7\1\0\7\7\1\0\1\7\3\0\3\7\1\0"+ + "\7\7\3\0\4\7\2\0\6\7\4\0\15\7\5\0\3\7\1\0"+ + "\7\7\17\0\4\11\32\0\5\11\20\0\2\7\23\0\1\7\13\0"+ + "\4\11\6\0\6\11\1\0\1\7\15\0\1\7\40\0\22\7\36\0"+ + "\15\11\4\0\1\11\3\0\6\11\27\0\1\7\4\0\1\7\2\0"+ + "\12\7\1\0\1\7\3\0\5\7\6\0\1\7\1\0\1\7\1\0"+ + "\1\7\1\0\4\7\1\0\3\7\1\0\7\7\3\0\3\7\5\0"+ + "\5\7\26\0\44\7\u0e81\0\3\7\31\0\11\7\6\11\1\0\5\7"+ + "\2\0\5\7\4\0\126\7\2\0\2\11\2\0\3\7\1\0\137\7"+ + "\5\0\50\7\4\0\136\7\21\0\30\7\70\0\20\7\u0200\0\u19b6\7"+ + "\112\0\u51a6\7\132\0\u048d\7\u0773\0\u2ba4\7\u215c\0\u012e\7\2\0\73\7"+ + "\225\0\7\7\14\0\5\7\5\0\1\7\1\11\12\7\1\0\15\7"+ + "\1\0\5\7\1\0\1\7\1\0\2\7\1\0\2\7\1\0\154\7"+ + "\41\0\u016b\7\22\0\100\7\2\0\66\7\50\0\15\7\3\0\20\11"+ + "\20\0\4\11\17\0\2\7\30\0\3\7\31\0\1\7\6\0\5\7"+ + "\1\0\207\7\2\0\1\11\4\0\1\7\13\0\12\11\7\0\32\7"+ + "\4\0\1\7\1\0\32\7\12\0\132\7\3\0\6\7\2\0\6\7"+ + "\2\0\6\7\2\0\3\7\3\0\2\7\3\0\2\7\22\0\3\11"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\1\1\3\2\2\3\3\2\2\4\5\2\1\3"+ + "\13\2\2\1\1\5\1\6\1\7\1\10\1\11\1\12"+ + "\2\3\1\13\1\0\1\2\6\0\7\4\1\0\1\2"+ + "\4\4\13\2\1\14\21\2\1\14\7\2\1\0\1\15"+ + "\3\0\2\13\11\0\1\16\3\0\1\4\1\0\1\4"+ + "\43\2\1\17\7\2\12\0\24\2\1\4\10\2\1\0"+ + "\1\16\4\0\16\2\3\0\4\2\1\17\5\2"; + + private static int [] zzUnpackAction() { + int [] result = new int[236]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\72\0\164\0\72\0\256\0\350\0\72\0\u0122"+ + "\0\u015c\0\u0196\0\u01d0\0\u020a\0\u0244\0\u027e\0\u02b8\0\u02f2"+ + "\0\u032c\0\u0366\0\u03a0\0\u03da\0\u0414\0\u044e\0\u0488\0\u04c2"+ + "\0\u04fc\0\u0536\0\u0570\0\u05aa\0\u05e4\0\u061e\0\u0658\0\72"+ + "\0\72\0\72\0\72\0\72\0\72\0\u0692\0\u06cc\0\u0706"+ + "\0\u0740\0\u077a\0\u07b4\0\u07ee\0\u0828\0\u0862\0\u089c\0\u08d6"+ + "\0\u0910\0\u094a\0\u0984\0\u09be\0\72\0\u077a\0\u09f8\0\u0a32"+ + "\0\u0a6c\0\u0aa6\0\u0ae0\0\u0b1a\0\u0b54\0\u0b8e\0\u0bc8\0\u0c02"+ + "\0\u0c3c\0\u0c76\0\u0cb0\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2"+ + "\0\u0e0c\0\u0e46\0\u0e80\0\u0eba\0\u0ef4\0\u0f2e\0\u0f68\0\u0fa2"+ + "\0\u0fdc\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138\0\u1172"+ + "\0\u11ac\0\u11e6\0\u015c\0\u1220\0\u125a\0\u1294\0\u12ce\0\u1308"+ + "\0\u1342\0\u137c\0\u061e\0\72\0\u13b6\0\u0658\0\u13f0\0\u142a"+ + "\0\72\0\u1464\0\u149e\0\u14d8\0\u1512\0\u154c\0\u1586\0\u15c0"+ + "\0\u15fa\0\u1634\0\u166e\0\u16a8\0\u16e2\0\u171c\0\u1756\0\u1790"+ + "\0\u17ca\0\u1804\0\u183e\0\u1878\0\u18b2\0\u18ec\0\u1926\0\u1960"+ + "\0\u199a\0\u19d4\0\u1a0e\0\u1a48\0\u1a82\0\u1abc\0\u1af6\0\u1b30"+ + "\0\u1b6a\0\u1ba4\0\u1bde\0\u1c18\0\u1c52\0\u1c8c\0\u1cc6\0\u1d00"+ + "\0\u1d3a\0\u1d74\0\u1dae\0\u1de8\0\u1e22\0\u1e5c\0\u1e96\0\u1ed0"+ + "\0\u1f0a\0\u1f44\0\u1f7e\0\u1fb8\0\u015c\0\u1ff2\0\u202c\0\u2066"+ + "\0\u20a0\0\u20da\0\u2114\0\u214e\0\u2188\0\u21c2\0\u21fc\0\u2236"+ + "\0\u2270\0\u22aa\0\u22e4\0\u231e\0\u2358\0\u2392\0\u23cc\0\u2406"+ + "\0\u2440\0\u247a\0\u24b4\0\u24ee\0\u2528\0\u2562\0\u259c\0\u25d6"+ + "\0\u2610\0\u264a\0\u2684\0\u26be\0\u26f8\0\u2732\0\u276c\0\u27a6"+ + "\0\u27e0\0\u281a\0\u015c\0\u2854\0\u288e\0\u28c8\0\u2902\0\u293c"+ + "\0\u2976\0\u29b0\0\u29ea\0\u2a24\0\72\0\u2a5e\0\u2a98\0\u2ad2"+ + "\0\u2b0c\0\u2b46\0\u2b80\0\u2bba\0\u2bf4\0\u2c2e\0\u2c68\0\u2ca2"+ + "\0\u2cdc\0\u2d16\0\u2d50\0\u2d8a\0\u2dc4\0\u2dfe\0\u2e38\0\u2e72"+ + "\0\u2eac\0\u2ee6\0\u2f20\0\u2f5a\0\u2f94\0\u2fce\0\u3008\0\u3042"+ + "\0\u307c\0\u30b6\0\u30f0\0\u312a"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[236]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11"+ + "\1\12\1\2\1\13\1\12\1\14\1\11\1\12\1\15"+ + "\1\12\1\13\1\16\1\12\1\17\1\12\1\20\1\12"+ + "\1\21\1\22\1\23\1\12\1\7\1\24\1\25\2\11"+ + "\1\26\1\27\2\11\1\30\1\31\1\32\1\33\2\11"+ + "\1\34\1\11\1\35\1\36\1\2\1\37\1\40\1\41"+ + "\1\42\1\43\1\44\1\45\1\7\1\46\1\47\74\0"+ + "\1\4\72\0\1\5\72\0\1\50\1\51\72\0\1\52"+ + "\1\0\1\52\1\0\3\52\1\0\1\52\1\0\2\52"+ + "\1\53\1\52\1\54\1\52\1\0\1\52\1\55\1\0"+ + "\1\56\1\52\12\0\1\57\5\0\1\60\24\0\22\11"+ + "\1\0\2\11\1\0\21\11\22\0\1\52\1\11\1\12"+ + "\1\11\3\12\1\11\1\12\1\11\2\12\1\11\1\12"+ + "\1\11\1\12\1\11\1\12\1\11\1\0\1\11\1\12"+ + "\1\0\21\11\22\0\1\52\1\0\1\52\1\0\1\13"+ + "\1\52\1\13\1\0\1\52\1\0\1\52\1\13\1\61"+ + "\1\62\1\63\1\64\1\65\1\66\1\65\1\67\1\70"+ + "\1\71\44\0\1\52\1\0\1\52\1\0\1\72\1\52"+ + "\1\73\1\74\1\75\1\0\1\52\1\73\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\1\65\1\67\1\70\1\71"+ + "\45\0\22\11\1\0\2\11\1\0\2\11\1\76\3\11"+ + "\1\77\1\100\11\11\23\0\13\11\1\101\6\11\1\0"+ + "\2\11\1\0\4\11\1\102\3\11\1\103\10\11\23\0"+ + "\22\11\1\0\2\11\1\0\7\11\1\104\11\11\23\0"+ + "\15\11\1\105\4\11\1\0\2\11\1\0\2\11\1\106"+ + "\4\11\1\107\11\11\23\0\22\11\1\0\1\110\1\11"+ + "\1\0\7\11\1\111\11\11\26\0\1\67\1\0\1\67"+ + "\4\0\1\67\57\0\6\11\1\112\6\11\1\113\4\11"+ + "\1\0\2\11\1\0\10\11\1\114\10\11\23\0\22\11"+ + "\1\0\2\11\1\0\1\11\1\115\5\11\1\116\11\11"+ + "\23\0\22\11\1\0\1\117\1\11\1\0\21\11\23\0"+ + "\22\11\1\0\1\120\1\11\1\0\2\11\1\121\2\11"+ + "\1\122\1\123\2\11\1\124\4\11\1\125\2\11\23\0"+ + "\22\11\1\0\1\126\1\11\1\0\1\11\1\127\4\11"+ + "\1\130\5\11\1\131\4\11\23\0\22\11\1\0\2\11"+ + "\1\0\7\11\1\132\11\11\23\0\17\11\1\133\2\11"+ + "\1\0\2\11\1\0\10\11\1\134\10\11\23\0\22\11"+ + "\1\0\2\11\1\0\7\11\1\135\11\11\23\0\13\11"+ + "\1\136\6\11\1\0\2\11\1\0\21\11\23\0\22\11"+ + "\1\0\2\11\1\0\6\11\1\137\12\11\23\0\22\11"+ + "\1\0\2\11\1\0\2\11\1\140\4\11\1\141\1\11"+ + "\1\142\7\11\14\0\2\143\1\144\53\143\1\144\1\145"+ + "\12\143\2\146\1\144\54\146\1\147\1\144\11\146\70\0"+ + "\1\7\72\0\1\7\1\50\1\150\1\151\67\50\5\152"+ + "\1\153\64\152\6\0\1\52\1\0\1\52\1\0\3\52"+ + "\1\0\1\52\1\0\2\52\1\0\1\52\1\0\1\52"+ + "\1\0\1\52\3\0\1\52\77\0\1\154\3\0\1\155"+ + "\72\0\1\156\55\0\1\157\63\0\1\160\11\0\1\161"+ + "\6\0\1\162\52\0\1\163\16\0\1\164\2\0\1\165"+ + "\57\0\1\166\55\0\2\65\2\63\52\0\1\52\1\0"+ + "\1\52\1\0\3\52\1\0\1\52\1\0\2\52\1\65"+ + "\1\66\1\63\1\64\1\0\1\52\3\0\1\52\60\0"+ + "\2\65\54\0\1\52\1\0\1\52\1\0\3\52\1\0"+ + "\1\52\1\0\2\52\1\65\1\66\1\0\1\52\1\0"+ + "\1\52\3\0\1\52\50\0\1\67\1\0\1\67\4\0"+ + "\1\67\4\0\3\65\1\0\2\70\50\0\1\167\1\0"+ + "\1\167\4\0\1\167\12\0\1\170\43\0\1\52\1\0"+ + "\1\52\1\0\1\171\1\52\1\171\1\0\1\52\1\0"+ + "\1\52\1\171\1\0\1\52\1\0\1\52\1\0\1\52"+ + "\3\0\1\52\1\170\43\0\1\52\1\0\1\52\1\0"+ + "\1\72\1\52\1\72\1\0\1\52\1\0\1\52\1\72"+ + "\1\0\1\52\1\0\1\52\1\65\1\66\1\65\1\67"+ + "\1\70\1\71\44\0\1\52\1\0\1\52\1\0\1\72"+ + "\1\52\1\73\1\0\1\52\1\0\1\52\1\73\1\61"+ + "\1\62\1\63\1\64\1\65\1\66\1\65\1\67\1\70"+ + "\1\71\50\0\1\74\1\0\1\74\2\0\3\74\2\61"+ + "\2\63\3\74\1\0\2\74\1\0\1\74\1\0\1\74"+ + "\40\0\1\52\1\0\1\52\1\0\1\75\1\52\1\75"+ + "\1\0\1\52\1\74\2\75\1\61\1\62\1\63\1\64"+ + "\1\74\1\75\1\74\1\0\1\74\1\75\1\0\1\74"+ + "\1\0\1\74\41\0\22\11\1\0\2\11\1\0\4\11"+ + "\1\172\1\173\13\11\23\0\22\11\1\0\2\11\1\0"+ + "\2\11\1\174\16\11\23\0\22\11\1\0\2\11\1\0"+ + "\10\11\1\175\10\11\23\0\22\11\1\0\2\11\1\0"+ + "\11\11\1\176\7\11\23\0\22\11\1\0\2\11\1\0"+ + "\11\11\1\177\7\11\23\0\22\11\1\0\2\11\1\0"+ + "\4\11\1\200\4\11\1\201\7\11\23\0\22\11\1\0"+ + "\2\11\1\0\10\11\1\202\10\11\23\0\22\11\1\0"+ + "\2\11\1\0\7\11\1\203\11\11\23\0\15\11\1\204"+ + "\4\11\1\0\2\11\1\0\21\11\23\0\22\11\1\0"+ + "\2\11\1\0\1\11\1\133\17\11\23\0\17\11\1\205"+ + "\2\11\1\0\2\11\1\0\21\11\23\0\13\11\1\206"+ + "\6\11\1\0\2\11\1\0\21\11\23\0\22\11\1\0"+ + "\2\11\1\0\5\11\1\207\13\11\23\0\22\11\1\0"+ + "\2\11\1\0\4\11\1\172\14\11\23\0\13\11\1\210"+ + "\6\11\1\0\2\11\1\0\21\11\23\0\22\11\1\0"+ + "\1\211\1\11\1\0\21\11\23\0\22\11\1\0\2\11"+ + "\1\0\7\11\1\212\11\11\23\0\22\11\1\0\2\11"+ + "\1\0\5\11\1\213\4\11\1\214\6\11\23\0\15\11"+ + "\1\215\4\11\1\0\2\11\1\0\2\11\1\216\16\11"+ + "\23\0\17\11\1\217\2\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\11\1\220\1\221"+ + "\16\11\23\0\22\11\1\0\2\11\1\0\7\11\1\222"+ + "\11\11\23\0\22\11\1\0\2\11\1\0\12\11\1\223"+ + "\2\11\1\224\3\11\23\0\22\11\1\0\2\11\1\0"+ + "\11\11\1\225\7\11\23\0\22\11\1\0\2\11\1\0"+ + "\13\11\1\226\5\11\23\0\13\11\1\227\6\11\1\0"+ + "\2\11\1\0\14\11\1\133\4\11\23\0\22\11\1\0"+ + "\2\11\1\0\1\11\1\230\7\11\1\231\7\11\23\0"+ + "\22\11\1\0\2\11\1\0\17\11\1\232\1\11\23\0"+ + "\22\11\1\0\2\11\1\0\11\11\1\233\7\11\23\0"+ + "\15\11\1\234\4\11\1\0\2\11\1\0\5\11\1\235"+ + "\13\11\23\0\22\11\1\0\2\11\1\0\5\11\1\236"+ + "\13\11\23\0\22\11\1\0\2\11\1\0\5\11\1\237"+ + "\13\11\23\0\22\11\1\0\2\11\1\0\11\11\1\240"+ + "\7\11\23\0\15\11\1\241\4\11\1\0\2\11\1\0"+ + "\21\11\23\0\15\11\1\242\4\11\1\0\2\11\1\0"+ + "\11\11\1\243\7\11\23\0\22\11\1\0\2\11\1\0"+ + "\1\11\1\244\17\11\14\0\2\143\1\144\67\143\2\146"+ + "\1\144\67\146\2\0\1\151\67\0\5\152\1\245\64\152"+ + "\4\0\1\151\1\153\132\0\1\246\53\0\1\247\106\0"+ + "\1\250\52\0\1\54\104\0\1\250\4\0\1\251\61\0"+ + "\1\252\63\0\1\253\71\0\1\247\14\0\1\155\43\0"+ + "\1\254\126\0\1\255\54\0\1\256\44\0\1\167\1\0"+ + "\1\167\4\0\1\167\4\0\3\65\53\0\1\167\1\0"+ + "\1\167\4\0\1\167\56\0\1\52\1\0\1\52\1\0"+ + "\1\171\1\52\1\171\1\0\1\52\1\0\1\52\1\171"+ + "\1\0\1\52\1\0\1\52\1\65\1\66\1\65\2\0"+ + "\1\52\45\0\22\11\1\0\1\133\1\11\1\0\21\11"+ + "\23\0\10\11\1\257\11\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\11\1\235\17\11"+ + "\23\0\22\11\1\0\2\11\1\0\4\11\1\260\1\261"+ + "\13\11\23\0\21\11\1\133\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\10\11\1\262\10\11"+ + "\23\0\22\11\1\0\2\11\1\0\11\11\1\263\7\11"+ + "\23\0\22\11\1\0\2\11\1\0\7\11\1\264\11\11"+ + "\23\0\22\11\1\0\2\11\1\0\12\11\1\235\6\11"+ + "\23\0\22\11\1\0\2\11\1\0\2\11\1\260\16\11"+ + "\23\0\22\11\1\0\2\11\1\0\4\11\1\227\14\11"+ + "\23\0\22\11\1\0\2\11\1\0\2\11\1\265\16\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\266\20\11\23\0"+ + "\22\11\1\0\1\267\1\11\1\0\21\11\23\0\22\11"+ + "\1\0\2\11\1\0\13\11\1\133\5\11\23\0\22\11"+ + "\1\0\2\11\1\0\2\11\1\270\16\11\23\0\15\11"+ + "\1\235\4\11\1\0\2\11\1\0\21\11\23\0\13\11"+ + "\1\271\6\11\1\0\2\11\1\0\21\11\23\0\22\11"+ + "\1\0\2\11\1\0\11\11\1\272\7\11\23\0\22\11"+ + "\1\0\1\273\1\11\1\0\21\11\23\0\15\11\1\274"+ + "\4\11\1\0\2\11\1\0\21\11\23\0\22\11\1\0"+ + "\1\275\1\11\1\0\21\11\23\0\13\11\1\276\6\11"+ + "\1\0\2\11\1\0\21\11\23\0\22\11\1\0\2\11"+ + "\1\0\5\11\1\277\13\11\23\0\22\11\1\0\2\11"+ + "\1\0\1\11\1\260\17\11\23\0\22\11\1\0\2\11"+ + "\1\0\10\11\1\300\10\11\23\0\22\11\1\0\1\301"+ + "\1\11\1\0\21\11\23\0\22\11\1\0\2\11\1\0"+ + "\5\11\1\173\13\11\23\0\22\11\1\0\2\11\1\0"+ + "\17\11\1\302\1\11\23\0\22\11\1\0\1\303\1\11"+ + "\1\0\21\11\23\0\22\11\1\0\1\304\1\11\1\0"+ + "\7\11\1\305\11\11\23\0\22\11\1\0\2\11\1\0"+ + "\4\11\1\133\14\11\23\0\22\11\1\0\1\306\1\11"+ + "\1\0\21\11\23\0\22\11\1\0\2\11\1\0\10\11"+ + "\1\307\10\11\23\0\22\11\1\0\2\11\1\0\11\11"+ + "\1\310\7\11\23\0\22\11\1\0\2\11\1\0\7\11"+ + "\1\133\11\11\23\0\22\11\1\0\2\11\1\0\2\11"+ + "\1\311\16\11\23\0\15\11\1\172\4\11\1\0\2\11"+ + "\1\0\21\11\23\0\13\11\1\172\6\11\1\0\2\11"+ + "\1\0\21\11\23\0\22\11\1\0\2\11\1\0\2\11"+ + "\1\312\16\11\23\0\21\11\1\235\1\0\2\11\1\0"+ + "\21\11\23\0\22\11\1\0\2\11\1\0\5\11\1\313"+ + "\13\11\14\0\4\152\1\151\1\245\64\152\45\0\1\314"+ + "\56\0\1\251\71\0\1\315\65\0\1\315\107\0\1\316"+ + "\73\0\1\251\47\0\1\317\111\0\1\320\74\0\1\321"+ + "\31\0\22\11\1\0\2\11\1\0\6\11\1\133\12\11"+ + "\23\0\22\11\1\0\2\11\1\0\5\11\1\235\13\11"+ + "\23\0\22\11\1\0\2\11\1\0\11\11\1\322\7\11"+ + "\23\0\22\11\1\0\2\11\1\0\12\11\1\133\6\11"+ + "\23\0\22\11\1\0\2\11\1\0\12\11\1\223\6\11"+ + "\23\0\22\11\1\0\2\11\1\0\10\11\1\235\10\11"+ + "\23\0\13\11\1\323\6\11\1\0\2\11\1\0\21\11"+ + "\23\0\15\11\1\324\4\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\11\1\264\17\11"+ + "\23\0\22\11\1\0\2\11\1\0\3\11\1\133\15\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\11\1\325\17\11"+ + "\23\0\22\11\1\0\2\11\1\0\4\11\1\326\14\11"+ + "\23\0\10\11\1\327\11\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\1\176\1\11\1\0\21\11\23\0"+ + "\10\11\1\330\11\11\1\0\2\11\1\0\21\11\23\0"+ + "\10\11\1\260\11\11\1\0\2\11\1\0\21\11\23\0"+ + "\22\11\1\0\2\11\1\0\11\11\1\331\7\11\23\0"+ + "\22\11\1\0\1\243\1\11\1\0\21\11\23\0\22\11"+ + "\1\0\2\11\1\0\7\11\1\332\11\11\23\0\15\11"+ + "\1\333\4\11\1\0\2\11\1\0\21\11\23\0\22\11"+ + "\1\0\2\11\1\0\2\11\1\176\16\11\23\0\22\11"+ + "\1\0\2\11\1\0\16\11\1\133\2\11\23\0\21\11"+ + "\1\334\1\0\2\11\1\0\10\11\1\335\1\176\7\11"+ + "\23\0\15\11\1\234\4\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\10\11\1\172\10\11"+ + "\23\0\22\11\1\0\2\11\1\0\1\240\20\11\23\0"+ + "\22\11\1\0\2\11\1\0\5\11\1\336\13\11\23\0"+ + "\13\11\1\337\6\11\1\0\2\11\1\0\21\11\63\0"+ + "\1\315\60\0\1\315\55\0\1\340\105\0\1\341\103\0"+ + "\1\342\30\0\22\11\1\0\2\11\1\0\10\11\1\241"+ + "\10\11\23\0\15\11\1\343\4\11\1\0\2\11\1\0"+ + "\21\11\23\0\22\11\1\0\1\235\1\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\10\11\1\133\10\11"+ + "\23\0\22\11\1\0\2\11\1\0\5\11\1\344\13\11"+ + "\23\0\22\11\1\0\2\11\1\0\5\11\1\345\13\11"+ + "\23\0\22\11\1\0\2\11\1\0\2\11\1\346\16\11"+ + "\23\0\10\11\1\347\11\11\1\0\2\11\1\0\21\11"+ + "\23\0\17\11\1\133\2\11\1\0\2\11\1\0\21\11"+ + "\23\0\22\11\1\0\2\11\1\0\2\11\1\350\16\11"+ + "\23\0\22\11\1\0\1\332\1\11\1\0\21\11\23\0"+ + "\22\11\1\0\2\11\1\0\2\11\1\351\16\11\23\0"+ + "\22\11\1\0\2\11\1\0\11\11\1\266\7\11\23\0"+ + "\22\11\1\0\2\11\1\0\2\11\1\352\16\11\44\0"+ + "\1\250\103\0\1\315\66\0\1\315\41\0\22\11\1\0"+ + "\2\11\1\0\5\11\1\133\13\11\23\0\22\11\1\0"+ + "\1\174\1\11\1\0\21\11\23\0\22\11\1\0\2\11"+ + "\1\0\2\11\1\353\16\11\23\0\22\11\1\0\2\11"+ + "\1\0\4\11\1\343\14\11\23\0\1\11\1\275\20\11"+ + "\1\0\2\11\1\0\21\11\23\0\22\11\1\0\2\11"+ + "\1\0\5\11\1\172\13\11\23\0\22\11\1\0\2\11"+ + "\1\0\13\11\1\172\5\11\23\0\15\11\1\133\4\11"+ + "\1\0\2\11\1\0\21\11\23\0\22\11\1\0\2\11"+ + "\1\0\10\11\1\354\10\11\23\0\22\11\1\0\2\11"+ + "\1\0\14\11\1\133\4\11\14\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[12644]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\1\1\1\11\2\1\1\11\30\1\6\11"+ + "\3\1\1\0\1\1\6\0\4\1\1\11\2\1\1\0"+ + "\52\1\1\0\1\11\3\0\1\1\1\11\11\0\1\1"+ + "\3\0\1\1\1\0\54\1\12\0\35\1\1\0\1\11"+ + "\4\0\16\1\3\0\12\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[236]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + public CLexer() { + super(); + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + @Override + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public CLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public CLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1782) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 12: + { return token(TokenType.KEYWORD); + } + case 16: break; + case 7: + { return token(TokenType.OPERATOR, CURLY); + } + case 17: break; + case 9: + { return token(TokenType.OPERATOR, BRACKET); + } + case 18: break; + case 3: + { return token(TokenType.OPERATOR); + } + case 19: break; + case 6: + { return token(TokenType.OPERATOR, -PARAN); + } + case 20: break; + case 14: + { return token(TokenType.KEYWORD2); + } + case 21: break; + case 2: + { return token(TokenType.IDENTIFIER); + } + case 22: break; + case 5: + { return token(TokenType.OPERATOR, PARAN); + } + case 23: break; + case 13: + { return token(TokenType.STRING); + } + case 24: break; + case 11: + { return token(TokenType.COMMENT); + } + case 25: break; + case 10: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 26: break; + case 8: + { return token(TokenType.OPERATOR, -CURLY); + } + case 27: break; + case 15: + { return token(TokenType.TYPE); + } + case 28: break; + case 4: + { return token(TokenType.NUMBER); + } + case 29: break; + case 1: + { + } + case 30: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ClojureLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ClojureLexer.java new file mode 100644 index 000000000..b946071f5 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ClojureLexer.java @@ -0,0 +1,2022 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/clojure.flex + */ +public final class ClojureLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\6\1\3\1\2\1\0\1\3\1\1\16\6\4\0\1\3\1\53"+ + "\1\23\1\0\1\5\2\0\1\24\1\71\1\72\1\30\1\22\1\0"+ + "\1\46\1\20\1\62\1\7\1\15\1\70\1\14\4\16\2\10\1\0"+ + "\1\4\1\63\1\64\1\61\1\51\1\0\3\13\1\17\1\21\1\17"+ + "\5\5\1\11\13\5\1\12\2\5\1\75\1\25\1\76\1\0\1\5"+ + "\1\0\1\50\1\60\1\42\1\32\1\33\1\26\1\57\1\45\1\31"+ + "\1\65\1\66\1\34\1\54\1\27\1\36\1\37\1\44\1\41\1\52"+ + "\1\35\1\43\1\47\1\40\1\55\1\56\1\67\1\73\1\0\1\74"+ + "\1\0\41\6\2\0\4\5\4\0\1\5\2\0\1\6\7\0\1\5"+ + "\4\0\1\5\5\0\27\5\1\0\37\5\1\0\u013f\5\31\0\162\5"+ + "\4\0\14\5\16\0\5\5\11\0\1\5\21\0\130\6\5\0\23\6"+ + "\12\0\1\5\13\0\1\5\1\0\3\5\1\0\1\5\1\0\24\5"+ + "\1\0\54\5\1\0\46\5\1\0\5\5\4\0\202\5\1\0\4\6"+ + "\3\0\105\5\1\0\46\5\2\0\2\5\6\0\20\5\41\0\46\5"+ + "\2\0\1\5\7\0\47\5\11\0\21\6\1\0\27\6\1\0\3\6"+ + "\1\0\1\6\1\0\2\6\1\0\1\6\13\0\33\5\5\0\3\5"+ + "\15\0\4\6\14\0\6\6\13\0\32\5\5\0\13\5\16\6\7\0"+ + "\12\6\4\0\2\5\1\6\143\5\1\0\1\5\10\6\1\0\6\6"+ + "\2\5\2\6\1\0\4\6\2\5\12\6\3\5\2\0\1\5\17\0"+ + "\1\6\1\5\1\6\36\5\33\6\2\0\3\5\60\0\46\5\13\6"+ + "\1\5\u014f\0\3\6\66\5\2\0\1\6\1\5\20\6\2\0\1\5"+ + "\4\6\3\0\12\5\2\6\2\0\12\6\21\0\3\6\1\0\10\5"+ + "\2\0\2\5\2\0\26\5\1\0\7\5\1\0\1\5\3\0\4\5"+ + "\2\0\1\6\1\5\7\6\2\0\2\6\2\0\3\6\11\0\1\6"+ + "\4\0\2\5\1\0\3\5\2\6\2\0\12\6\4\5\15\0\3\6"+ + "\1\0\6\5\4\0\2\5\2\0\26\5\1\0\7\5\1\0\2\5"+ + "\1\0\2\5\1\0\2\5\2\0\1\6\1\0\5\6\4\0\2\6"+ + "\2\0\3\6\13\0\4\5\1\0\1\5\7\0\14\6\3\5\14\0"+ + "\3\6\1\0\11\5\1\0\3\5\1\0\26\5\1\0\7\5\1\0"+ + "\2\5\1\0\5\5\2\0\1\6\1\5\10\6\1\0\3\6\1\0"+ + "\3\6\2\0\1\5\17\0\2\5\2\6\2\0\12\6\1\0\1\5"+ + "\17\0\3\6\1\0\10\5\2\0\2\5\2\0\26\5\1\0\7\5"+ + "\1\0\2\5\1\0\5\5\2\0\1\6\1\5\6\6\3\0\2\6"+ + "\2\0\3\6\10\0\2\6\4\0\2\5\1\0\3\5\4\0\12\6"+ + "\1\0\1\5\20\0\1\6\1\5\1\0\6\5\3\0\3\5\1\0"+ + "\4\5\3\0\2\5\1\0\1\5\1\0\2\5\3\0\2\5\3\0"+ + "\3\5\3\0\10\5\1\0\3\5\4\0\5\6\3\0\3\6\1\0"+ + "\4\6\11\0\1\6\17\0\11\6\11\0\1\5\7\0\3\6\1\0"+ + "\10\5\1\0\3\5\1\0\27\5\1\0\12\5\1\0\5\5\4\0"+ + "\7\6\1\0\3\6\1\0\4\6\7\0\2\6\11\0\2\5\4\0"+ + "\12\6\22\0\2\6\1\0\10\5\1\0\3\5\1\0\27\5\1\0"+ + "\12\5\1\0\5\5\2\0\1\6\1\5\7\6\1\0\3\6\1\0"+ + "\4\6\7\0\2\6\7\0\1\5\1\0\2\5\4\0\12\6\22\0"+ + "\2\6\1\0\10\5\1\0\3\5\1\0\27\5\1\0\20\5\4\0"+ + "\6\6\2\0\3\6\1\0\4\6\11\0\1\6\10\0\2\5\4\0"+ + "\12\6\22\0\2\6\1\0\22\5\3\0\30\5\1\0\11\5\1\0"+ + "\1\5\2\0\7\5\3\0\1\6\4\0\6\6\1\0\1\6\1\0"+ + "\10\6\22\0\2\6\15\0\60\5\1\6\2\5\7\6\4\0\10\5"+ + "\10\6\1\0\12\6\47\0\2\5\1\0\1\5\2\0\2\5\1\0"+ + "\1\5\2\0\1\5\6\0\4\5\1\0\7\5\1\0\3\5\1\0"+ + "\1\5\1\0\1\5\2\0\2\5\1\0\4\5\1\6\2\5\6\6"+ + "\1\0\2\6\1\5\2\0\5\5\1\0\1\5\1\0\6\6\2\0"+ + "\12\6\2\0\2\5\42\0\1\5\27\0\2\6\6\0\12\6\13\0"+ + "\1\6\1\0\1\6\1\0\1\6\4\0\2\6\10\5\1\0\42\5"+ + "\6\0\24\6\1\0\2\6\4\5\4\0\10\6\1\0\44\6\11\0"+ + "\1\6\71\0\42\5\1\0\5\5\1\0\2\5\1\0\7\6\3\0"+ + "\4\6\6\0\12\6\6\0\6\5\4\6\106\0\46\5\12\0\51\5"+ + "\7\0\132\5\5\0\104\5\5\0\122\5\6\0\7\5\1\0\77\5"+ + "\1\0\1\5\1\0\4\5\2\0\7\5\1\0\1\5\1\0\4\5"+ + "\2\0\47\5\1\0\1\5\1\0\4\5\2\0\37\5\1\0\1\5"+ + "\1\0\4\5\2\0\7\5\1\0\1\5\1\0\4\5\2\0\7\5"+ + "\1\0\7\5\1\0\27\5\1\0\37\5\1\0\1\5\1\0\4\5"+ + "\2\0\7\5\1\0\47\5\1\0\23\5\16\0\11\6\56\0\125\5"+ + "\14\0\u026c\5\2\0\10\5\12\0\32\5\5\0\113\5\3\0\3\5"+ + "\17\0\15\5\1\0\4\5\3\6\13\0\22\5\3\6\13\0\22\5"+ + "\2\6\14\0\15\5\1\0\3\5\1\0\2\6\14\0\64\5\40\6"+ + "\3\0\1\5\3\0\2\5\1\6\2\0\12\6\41\0\3\6\2\0"+ + "\12\6\6\0\130\5\10\0\51\5\1\6\126\0\35\5\3\0\14\6"+ + "\4\0\14\6\12\0\12\6\36\5\2\0\5\5\u038b\0\154\5\224\0"+ + "\234\5\4\0\132\5\6\0\26\5\2\0\6\5\2\0\46\5\2\0"+ + "\6\5\2\0\10\5\1\0\1\5\1\0\1\5\1\0\1\5\1\0"+ + "\37\5\2\0\65\5\1\0\7\5\1\0\1\5\3\0\3\5\1\0"+ + "\7\5\3\0\4\5\2\0\6\5\4\0\15\5\5\0\3\5\1\0"+ + "\7\5\17\0\4\6\32\0\5\6\20\0\2\5\23\0\1\5\13\0"+ + "\4\6\6\0\6\6\1\0\1\5\15\0\1\5\40\0\22\5\36\0"+ + "\15\6\4\0\1\6\3\0\6\6\27\0\1\5\4\0\1\5\2\0"+ + "\12\5\1\0\1\5\3\0\5\5\6\0\1\5\1\0\1\5\1\0"+ + "\1\5\1\0\4\5\1\0\3\5\1\0\7\5\3\0\3\5\5\0"+ + "\5\5\26\0\44\5\u0e81\0\3\5\31\0\11\5\6\6\1\0\5\5"+ + "\2\0\5\5\4\0\126\5\2\0\2\6\2\0\3\5\1\0\137\5"+ + "\5\0\50\5\4\0\136\5\21\0\30\5\70\0\20\5\u0200\0\u19b6\5"+ + "\112\0\u51a6\5\132\0\u048d\5\u0773\0\u2ba4\5\u215c\0\u012e\5\2\0\73\5"+ + "\225\0\7\5\14\0\5\5\5\0\1\5\1\6\12\5\1\0\15\5"+ + "\1\0\5\5\1\0\1\5\1\0\2\5\1\0\2\5\1\0\154\5"+ + "\41\0\u016b\5\22\0\100\5\2\0\66\5\50\0\15\5\3\0\20\6"+ + "\20\0\4\6\17\0\2\5\30\0\3\5\31\0\1\5\6\0\5\5"+ + "\1\0\207\5\2\0\1\6\4\0\1\5\13\0\12\6\7\0\32\5"+ + "\4\0\1\5\1\0\32\5\12\0\132\5\3\0\6\5\2\0\6\5"+ + "\2\0\6\5\2\0\3\5\3\0\2\5\3\0\2\5\22\0\3\6"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\1\2\1\3\2\4\1\1\1\5\1\6"+ + "\1\7\2\3\1\1\15\3\1\5\7\3\1\5\2\3"+ + "\1\10\1\11\1\12\1\13\1\14\1\15\1\16\2\17"+ + "\1\20\1\1\1\16\1\1\2\2\3\4\1\0\3\4"+ + "\1\0\1\3\1\21\12\3\10\0\1\21\6\3\1\21"+ + "\15\3\1\5\2\3\1\5\61\3\1\22\2\16\4\4"+ + "\1\0\1\3\1\21\5\3\2\21\1\3\2\5\1\3"+ + "\11\0\1\5\1\0\4\3\1\21\15\3\1\21\10\3"+ + "\1\0\1\3\1\21\4\3\1\5\2\3\1\0\5\3"+ + "\1\5\4\3\1\0\3\3\1\5\14\3\2\5\16\3"+ + "\1\5\1\3\1\5\1\3\1\5\10\3\1\5\4\3"+ + "\1\5\4\3\1\5\4\3\1\5\2\3\1\16\2\4"+ + "\1\5\3\3\1\0\1\5\15\0\1\3\1\5\1\0"+ + "\5\3\1\5\6\3\1\5\2\3\1\5\1\3\1\5"+ + "\1\3\2\0\1\3\1\5\2\3\1\0\2\3\1\5"+ + "\1\0\5\3\5\0\1\3\1\5\3\3\1\5\3\3"+ + "\2\5\4\3\2\5\1\3\2\0\1\3\1\0\4\3"+ + "\1\5\1\3\1\5\4\3\1\5\4\3\1\0\4\3"+ + "\2\0\1\3\2\0\3\3\2\4\1\0\2\3\2\0"+ + "\1\3\15\0\1\3\1\0\11\3\1\0\1\3\5\0"+ + "\2\5\1\0\1\3\2\0\2\3\5\0\1\3\1\0"+ + "\3\3\1\0\7\3\1\0\1\3\1\0\1\3\1\0"+ + "\1\5\2\3\1\0\1\5\1\0\4\3\1\0\3\3"+ + "\1\0\1\5\2\3\2\0\1\3\4\0\1\3\2\4"+ + "\2\0\1\3\2\0\1\3\13\0\1\3\1\0\10\3"+ + "\6\0\1\3\6\0\1\5\5\0\2\3\2\0\7\3"+ + "\2\0\1\3\10\0\1\3\1\5\1\3\1\0\1\3"+ + "\2\0\2\3\4\0\1\3\2\4\15\0\1\3\1\0"+ + "\5\3\11\0\1\3\4\0\1\3\2\0\5\3\15\0"+ + "\1\3\1\0\2\3\4\0\2\4\11\0\1\3\1\5"+ + "\10\0\1\3\2\0\1\3\15\0\1\3\3\0\2\4"+ + "\5\0\1\3\17\0\1\3\3\0\2\4\15\0\1\5"+ + "\3\0\1\3\4\0\1\4\14\0\1\5\4\0\1\4"+ + "\13\0\1\4\6\0\1\4\4\0\1\4\3\0\1\4"+ + "\3\0\1\4\2\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[814]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\77\0\176\0\275\0\374\0\u013b\0\u017a\0\u01b9"+ + "\0\u01f8\0\u0237\0\u0276\0\275\0\275\0\275\0\u02b5\0\u02f4"+ + "\0\u0333\0\u0372\0\u03b1\0\u03f0\0\u042f\0\u046e\0\u04ad\0\u04ec"+ + "\0\u052b\0\u056a\0\u05a9\0\u05e8\0\u0627\0\u0666\0\u06a5\0\u06e4"+ + "\0\u0723\0\u0762\0\u07a1\0\u07e0\0\u081f\0\u085e\0\u089d\0\u08dc"+ + "\0\u091b\0\275\0\275\0\275\0\275\0\275\0\275\0\u095a"+ + "\0\u0999\0\275\0\275\0\u09d8\0\u0a17\0\u0a56\0\u0a95\0\275"+ + "\0\u0ad4\0\u0b13\0\275\0\u0b52\0\u0b91\0\u0bd0\0\u0c0f\0\u0c4e"+ + "\0\u0c8d\0\u0ccc\0\u0d0b\0\u0d4a\0\u0d89\0\u0dc8\0\u0e07\0\u0e46"+ + "\0\u0e85\0\u0ec4\0\u0f03\0\u0f42\0\u0f81\0\u0fc0\0\u0fff\0\u103e"+ + "\0\u107d\0\u10bc\0\u10fb\0\u113a\0\u1179\0\u11b8\0\u11f7\0\u1236"+ + "\0\u1275\0\u12b4\0\u12f3\0\u1332\0\u1371\0\u13b0\0\u13ef\0\u142e"+ + "\0\u146d\0\u14ac\0\u14eb\0\u152a\0\u1569\0\u15a8\0\u15e7\0\u1626"+ + "\0\u1665\0\u01b9\0\u16a4\0\u16e3\0\u1722\0\u1761\0\u17a0\0\u17df"+ + "\0\u181e\0\u185d\0\u189c\0\u18db\0\u191a\0\u1959\0\u1998\0\u19d7"+ + "\0\u1a16\0\u1a55\0\u1a94\0\u1ad3\0\u1b12\0\u1b51\0\u1b90\0\u1bcf"+ + "\0\u1c0e\0\u1c4d\0\u1c8c\0\u1ccb\0\u1d0a\0\u1d49\0\u1d88\0\u1dc7"+ + "\0\u1e06\0\u1e45\0\u1e84\0\u1ec3\0\u1f02\0\u1f41\0\u1f80\0\u1fbf"+ + "\0\u1ffe\0\u203d\0\u207c\0\u20bb\0\u20fa\0\u2139\0\u2178\0\u21b7"+ + "\0\u21f6\0\u2235\0\u2274\0\u22b3\0\u22f2\0\u2331\0\275\0\u2370"+ + "\0\u23af\0\u23ee\0\u242d\0\u246c\0\u24ab\0\u24ea\0\u2529\0\275"+ + "\0\u2568\0\u25a7\0\u25e6\0\u2625\0\u2664\0\u26a3\0\u26e2\0\u26a3"+ + "\0\u2721\0\u2760\0\u279f\0\u27de\0\u281d\0\u285c\0\u289b\0\u28da"+ + "\0\u2919\0\u2958\0\u2997\0\u29d6\0\u2a15\0\u2a54\0\u2a93\0\u2ad2"+ + "\0\u2b11\0\u2b50\0\u2b8f\0\u2bce\0\u2c0d\0\u2c4c\0\u2c8b\0\u2cca"+ + "\0\u2d09\0\u2d48\0\u2d87\0\u2dc6\0\u2e05\0\u2e44\0\u2e83\0\u2ec2"+ + "\0\u2f01\0\u2f40\0\u2f7f\0\u2fbe\0\u2ffd\0\u303c\0\u307b\0\u30ba"+ + "\0\u30f9\0\u3138\0\u3177\0\u01b9\0\u31b6\0\u31f5\0\u3234\0\u3273"+ + "\0\u32b2\0\u32f1\0\u3330\0\u336f\0\u33ae\0\u33ed\0\u342c\0\u346b"+ + "\0\u34aa\0\u34e9\0\u3528\0\u3567\0\u35a6\0\u35e5\0\u3624\0\u3663"+ + "\0\u36a2\0\u36e1\0\u3720\0\u375f\0\u379e\0\u37dd\0\u381c\0\u385b"+ + "\0\u389a\0\u38d9\0\u3918\0\u3957\0\u3996\0\u39d5\0\u3a14\0\u3a53"+ + "\0\u3a92\0\u3ad1\0\u3b10\0\u3b4f\0\u3b8e\0\u3bcd\0\u3c0c\0\u3c4b"+ + "\0\u3c8a\0\u3cc9\0\u3d08\0\u3d47\0\u3d86\0\u3dc5\0\u3e04\0\u3e43"+ + "\0\u3e82\0\u26a3\0\u3ec1\0\u3f00\0\u3f3f\0\u3f7e\0\u3fbd\0\u3ffc"+ + "\0\u403b\0\u407a\0\u40b9\0\u40f8\0\u4137\0\u4176\0\u41b5\0\u41f4"+ + "\0\u4233\0\u4272\0\u42b1\0\u42f0\0\u432f\0\u436e\0\u43ad\0\u43ec"+ + "\0\u442b\0\u446a\0\u44a9\0\u44e8\0\u4527\0\u4566\0\275\0\u45a5"+ + "\0\u45e4\0\u4623\0\u4662\0\u46a1\0\u46e0\0\u471f\0\u475e\0\u479d"+ + "\0\u47dc\0\u481b\0\u485a\0\u4899\0\u48d8\0\u4917\0\u4956\0\u4995"+ + "\0\u49d4\0\u4a13\0\u4a52\0\u4a91\0\u4ad0\0\u4b0f\0\u4b4e\0\u4b8d"+ + "\0\u4bcc\0\u4c0b\0\u4c4a\0\u4c89\0\u4cc8\0\u4d07\0\u4d46\0\u4d85"+ + "\0\u4dc4\0\u4e03\0\u4e42\0\u4e81\0\u4ec0\0\u4eff\0\u4f3e\0\u4f7d"+ + "\0\u4fbc\0\u4ffb\0\u503a\0\u5079\0\u50b8\0\u50f7\0\u5136\0\u5175"+ + "\0\u51b4\0\u51f3\0\u5232\0\u5271\0\u52b0\0\u52ef\0\u532e\0\u536d"+ + "\0\u53ac\0\u53eb\0\u542a\0\u5469\0\u54a8\0\u54e7\0\u5526\0\u5565"+ + "\0\u55a4\0\u55e3\0\u5622\0\u5661\0\u56a0\0\u56df\0\u3a92\0\u571e"+ + "\0\u575d\0\u579c\0\u57db\0\u581a\0\u5859\0\u5898\0\u58d7\0\u5916"+ + "\0\u5955\0\u5994\0\u59d3\0\u5a12\0\u5a51\0\u5a90\0\u5acf\0\u5b0e"+ + "\0\u5b4d\0\u5b8c\0\u5bcb\0\u5c0a\0\u5c49\0\u5c88\0\u5cc7\0\u5d06"+ + "\0\u5d45\0\u5d84\0\u5dc3\0\u5e02\0\u5e41\0\u5e80\0\u5ebf\0\u5efe"+ + "\0\u5f3d\0\u4b0f\0\u5f7c\0\u5fbb\0\u5ffa\0\u6039\0\u6078\0\u60b7"+ + "\0\u60f6\0\u6135\0\u6174\0\u61b3\0\u61f2\0\u6231\0\u6270\0\u62af"+ + "\0\u62ee\0\u632d\0\u636c\0\u63ab\0\u63ea\0\u6429\0\u6468\0\u64a7"+ + "\0\u64e6\0\u6525\0\u6564\0\u65a3\0\u65e2\0\u6621\0\u6660\0\u669f"+ + "\0\u66de\0\u671d\0\u675c\0\u679b\0\u67da\0\u6819\0\u6858\0\u6897"+ + "\0\u68d6\0\u6915\0\u6954\0\u6993\0\u69d2\0\u6a11\0\u6a50\0\u6a8f"+ + "\0\u6ace\0\u6b0d\0\u6b4c\0\u6b8b\0\u6bca\0\u6c09\0\u6c48\0\u6c87"+ + "\0\u6cc6\0\u6d05\0\u6d44\0\u6d83\0\u6dc2\0\u6e01\0\u6e40\0\u6e7f"+ + "\0\u6ebe\0\u6efd\0\u6f3c\0\u6f7b\0\u6fba\0\u6ff9\0\u7038\0\u7077"+ + "\0\u70b6\0\u70f5\0\u7134\0\u7173\0\u71b2\0\u71f1\0\u7230\0\u726f"+ + "\0\u72ae\0\u72ed\0\u732c\0\u736b\0\u73aa\0\u73e9\0\u7428\0\u7467"+ + "\0\u74a6\0\u74e5\0\u7524\0\u7563\0\u75a2\0\u75e1\0\u7620\0\u765f"+ + "\0\u769e\0\u76dd\0\u771c\0\u775b\0\u779a\0\u77d9\0\u7818\0\u7857"+ + "\0\u7896\0\u78d5\0\u7914\0\u7953\0\u7992\0\u79d1\0\u7a10\0\u7a4f"+ + "\0\u7a8e\0\u7acd\0\u7b0c\0\u7b4b\0\u7b8a\0\u7bc9\0\u7c08\0\u7c47"+ + "\0\u7c86\0\u7cc5\0\u7d04\0\u7d43\0\u7d82\0\u7dc1\0\u7e00\0\u7e3f"+ + "\0\u7e7e\0\u7ebd\0\u7efc\0\u7f3b\0\u7f7a\0\u7fb9\0\u7ff8\0\u8037"+ + "\0\u8076\0\u80b5\0\u80f4\0\u8133\0\u8172\0\u81b1\0\u81f0\0\u822f"+ + "\0\u826e\0\u82ad\0\u82ec\0\u832b\0\u836a\0\u83a9\0\u83e8\0\u8427"+ + "\0\u8466\0\u84a5\0\u84e4\0\u8523\0\u8562\0\u85a1\0\u85e0\0\u861f"+ + "\0\u865e\0\u869d\0\u86dc\0\u871b\0\u875a\0\u8799\0\u87d8\0\u8817"+ + "\0\u8856\0\u8895\0\u88d4\0\u8913\0\u8952\0\u8991\0\u89d0\0\u8a0f"+ + "\0\u8a4e\0\u72ed\0\u8a8d\0\u8acc\0\u8b0b\0\u8b4a\0\u8b89\0\u8bc8"+ + "\0\u8c07\0\u8c46\0\u8c85\0\u8cc4\0\u8d03\0\u8d42\0\u8d81\0\u8dc0"+ + "\0\u8dff\0\u8e3e\0\u8e7d\0\u8ebc\0\u8efb\0\u8f3a\0\u8f79\0\u8fb8"+ + "\0\u8ff7\0\u9036\0\u9075\0\u90b4\0\u90f3\0\u9132\0\u9171\0\u91b0"+ + "\0\u91ef\0\u922e\0\u926d\0\u92ac\0\u92eb\0\u932a\0\u9369\0\u93a8"+ + "\0\u93e7\0\u9426\0\u9465\0\u94a4\0\u94e3\0\u9522\0\u9561\0\u95a0"+ + "\0\u95df\0\u961e\0\u965d\0\u969c\0\u96db\0\u971a\0\u9759\0\u9798"+ + "\0\u97d7\0\u9816\0\u9855\0\u9894\0\u98d3\0\u9912\0\u9951\0\u9990"+ + "\0\u99cf\0\u9a0e\0\u9a4d\0\u9a8c\0\u9acb\0\u9b0a\0\u9b49\0\u9b88"+ + "\0\u9bc7\0\u9c06\0\u9c45\0\u9c84\0\u9cc3\0\u9d02\0\u9d41\0\u9d80"+ + "\0\u9dbf\0\u9dfe\0\u9e3d\0\u9e7c\0\u9ebb\0\u9efa\0\u9f39\0\u9f78"+ + "\0\u9fb7\0\u9ff6\0\ua035\0\ua074\0\ua0b3\0\ua0f2\0\ua131\0\ua170"+ + "\0\ua1af\0\ua1ee\0\ua22d\0\ua26c\0\ua2ab\0\ua2ea\0\ua329\0\ua368"+ + "\0\ua3a7\0\ua3e6\0\ua425\0\ua464\0\ua4a3\0\ua4e2\0\ua521\0\ua560"+ + "\0\ua59f\0\ua5de\0\ua61d\0\ua65c\0\ua69b\0\ua6da\0\ua719\0\ua758"+ + "\0\ua797\0\ua7d6\0\ua815\0\ua854\0\ua893\0\ua8d2\0\ua911\0\ua950"+ + "\0\ua98f\0\ua9ce\0\uaa0d\0\uaa4c\0\uaa8b\0\uaaca\0\uab09\0\uab48"+ + "\0\uab87\0\uabc6\0\uac05\0\uac44\0\uac83\0\uacc2\0\uad01\0\uad40"+ + "\0\uad7f\0\uadbe\0\uadfd\0\uae3c\0\uae7b\0\uaeba\0\uaef9\0\uaf38"+ + "\0\uaf77\0\uafb6\0\uaff5\0\ub034\0\ub073\0\ub0b2\0\ub0f1\0\ub130"+ + "\0\ub16f\0\ub1ae\0\ub1ed\0\ub22c\0\ub26b\0\ub2aa\0\ub2e9\0\ub328"+ + "\0\ub367\0\ub3a6\0\ub3e5\0\ub424\0\ub463\0\ub4a2\0\ub4e1\0\ub520"+ + "\0\ub55f\0\ub59e\0\ub5dd\0\ub61c\0\ub65b\0\ub69a\0\ub6d9\0\ub718"+ + "\0\ub757\0\ub796\0\ub7d5\0\ub814\0\ub853\0\ub892\0\ub8d1\0\ub910"+ + "\0\ub94f\0\ub98e\0\ub9cd\0\uba0c\0\uba4b\0\uba8a\0\ubac9\0\ubb08"+ + "\0\ubb47\0\ubb86\0\ubbc5\0\ubc04\0\ubc43\0\ubc82\0\ubcc1\0\ubd00"+ + "\0\ubd3f\0\ubd7e\0\ubdbd\0\ubdfc\0\ube3b\0\ube7a\0\ubeb9\0\ubef8"+ + "\0\ubf37\0\ubf76\0\ubfb5\0\ubff4\0\uc033\0\uc072\0\uc0b1\0\uc0f0"+ + "\0\uc12f\0\uc16e\0\uc1ad\0\uc1ec\0\uc22b\0\uc26a"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[814]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\4\1\6\1\7\1\10\1\4\1\11"+ + "\1\12\3\10\3\12\1\10\1\13\1\10\1\14\1\15"+ + "\1\16\1\4\1\17\1\20\1\21\1\22\1\23\1\24"+ + "\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\34"+ + "\1\35\1\36\1\37\1\40\1\41\1\4\1\42\1\4"+ + "\1\43\1\44\1\10\1\45\1\46\1\47\1\14\2\47"+ + "\1\10\1\50\1\51\1\12\1\52\1\53\1\54\1\55"+ + "\1\56\1\57\1\60\1\61\1\62\20\60\1\63\1\60"+ + "\1\64\51\60\1\65\1\61\1\62\21\65\1\63\1\66"+ + "\51\65\101\0\1\4\77\0\1\6\73\0\1\7\1\67"+ + "\1\70\74\7\5\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\15\0\1\71\1\72\1\73\1\74\1\0"+ + "\1\75\1\76\1\75\1\73\1\77\1\100\4\0\1\73"+ + "\3\0\1\73\1\100\1\73\20\0\1\74\12\0\1\75"+ + "\15\0\2\12\1\73\2\0\3\12\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\12"+ + "\15\0\2\77\3\0\3\77\1\0\1\14\47\0\1\77"+ + "\13\0\13\10\1\0\1\10\4\0\1\101\1\102\1\0"+ + "\1\103\2\10\1\104\1\10\1\27\2\10\1\105\4\10"+ + "\1\0\1\10\1\106\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\107\1\10\1\110\1\10\1\111\1\112\7\10\1\0"+ + "\1\10\1\113\1\0\1\114\1\0\5\10\4\0\4\10"+ + "\35\0\1\115\1\0\1\116\4\0\1\117\1\120\1\121"+ + "\1\0\1\122\5\0\1\123\3\0\1\124\27\0\13\10"+ + "\1\0\1\10\4\0\1\125\1\126\1\0\1\10\1\127"+ + "\2\10\1\130\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\1\131\4\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\1\132\1\10\1\133\2\10\1\134"+ + "\2\10\1\135\4\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\136\1\0\15\10\1\0\1\137\1\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\1\140\1\10\1\141\2\10"+ + "\1\142\7\10\1\0\1\10\1\143\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\1\144\1\10\1\145\2\10\1\146\2\10"+ + "\1\147\3\10\1\150\1\0\1\10\1\151\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\152\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\153\2\10"+ + "\1\154\2\10\1\155\4\10\1\0\1\10\1\156\1\0"+ + "\1\10\1\0\1\157\4\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\1\160\13\10\1\161"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\1\101\1\10\1\0"+ + "\2\10\1\162\5\10\1\105\4\10\1\0\1\10\1\163"+ + "\1\0\1\164\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\3\10\1\165\1\10"+ + "\1\166\2\10\1\167\3\10\1\170\1\0\1\10\1\171"+ + "\1\0\1\10\1\0\2\10\1\172\2\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\6\10"+ + "\1\173\6\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\12\10\1\174\2\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\1\10\1\175\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\67\0\1\14\22\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\2\10\1\176"+ + "\12\10\1\0\1\10\1\177\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\1\10"+ + "\1\200\1\0\1\10\1\201\1\10\1\202\2\10\1\203"+ + "\1\204\1\205\1\206\3\10\1\0\2\10\1\0\1\207"+ + "\1\0\3\10\1\210\1\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\211\1\212"+ + "\1\213\1\214\1\215\2\10\1\216\1\217\1\10\1\220"+ + "\1\0\2\10\1\0\1\10\1\0\2\10\1\221\2\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\1\222\1\10\1\223\2\10\1\224\7\10\1\0"+ + "\1\10\1\225\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\1\226\4\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\227\12\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\1\230\1\10\1\216\2\10\1\231\4\10"+ + "\1\232\2\10\1\0\2\10\1\0\1\10\1\0\2\10"+ + "\1\233\2\10\4\0\4\10\72\0\1\14\17\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\234\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\235"+ + "\1\10\1\236\12\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\6\0\1\60\2\0\20\60\1\0"+ + "\1\60\1\0\51\60\2\0\1\62\74\0\2\237\1\0"+ + "\4\237\1\240\4\237\2\240\1\241\51\237\1\240\6\237"+ + "\1\65\2\0\21\65\2\0\51\65\2\237\1\0\74\237"+ + "\2\0\1\70\103\0\1\71\1\72\1\73\2\0\1\75"+ + "\1\76\1\75\1\73\1\77\1\100\4\0\1\73\3\0"+ + "\1\73\1\100\1\73\33\0\1\75\15\0\2\72\3\0"+ + "\3\72\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\34\0\1\72\15\0\1\242\1\243\2\0\5\243"+ + "\1\0\1\243\4\0\1\243\3\0\2\243\6\0\1\243"+ + "\5\0\1\243\7\0\1\243\7\0\1\243\15\0\1\244"+ + "\1\72\1\73\2\0\3\244\1\73\1\77\1\100\4\0"+ + "\1\73\3\0\1\73\1\100\1\73\33\0\1\244\15\0"+ + "\1\75\1\72\1\73\2\0\3\75\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\75"+ + "\15\0\2\77\3\0\3\77\1\73\1\0\1\100\4\0"+ + "\1\73\3\0\1\73\1\100\34\0\1\77\15\0\2\245"+ + "\3\0\3\245\3\0\1\246\23\0\1\246\21\0\1\245"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\247"+ + "\14\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\250"+ + "\15\10\1\0\2\10\1\0\1\164\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\1\10\1\251"+ + "\1\0\3\10\1\252\4\10\1\145\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\5\10\1\253\4\10"+ + "\1\254\2\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\145\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\3\10\1\255\11\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\3\10\1\256\11\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\7\10"+ + "\1\257\5\10\1\0\2\10\1\0\1\10\1\0\3\10"+ + "\1\260\1\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\14\10\1\261\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\4\10\1\262\10\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\1\263\4\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\264\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\60\0\1\265\53\0\1\265\112\0\1\266\74\0\1\267"+ + "\105\0\1\270\64\0\1\271\117\0\1\272\67\0\1\273"+ + "\33\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\274\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\275\4\10\1\152\3\10\1\276\2\10\1\0\1\277"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\300\12\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\301\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\6\10"+ + "\1\220\6\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\302\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\1\303"+ + "\1\10\1\0\10\10\1\304\1\152\3\10\1\0\2\10"+ + "\1\0\1\305\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\306\3\10"+ + "\1\307\1\152\1\310\2\10\1\0\1\10\1\311\1\0"+ + "\1\312\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\5\10\1\313\7\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\314\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\2\10\1\315"+ + "\12\10\1\0\1\10\1\316\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\1\10"+ + "\1\317\1\0\15\10\1\0\2\10\1\0\1\320\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\4\10\1\321\10\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\1\10\1\322\1\0\5\10\1\323\3\10"+ + "\1\324\3\10\1\0\1\10\1\325\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\2\10\1\0\1\326\1\0"+ + "\5\10\4\0\2\10\1\327\1\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\1\330\4\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\2\10"+ + "\1\0\1\326\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\12\10\1\331\2\10"+ + "\1\332\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\317\7\10\1\333\2\10\1\0\2\10\1\0\1\10"+ + "\1\0\2\10\1\334\2\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\335\5\10"+ + "\1\336\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\1\10\1\337\2\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\340\12\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\6\10\1\152\6\10"+ + "\1\0\2\10\1\0\1\260\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\1\10\1\341\1\0"+ + "\1\342\4\10\1\343\7\10\1\344\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\345\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\1\10"+ + "\1\346\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\347"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\350\1\10\1\351\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\1\352\1\10\1\0\1\10\1\353\4\10\1\354"+ + "\2\10\1\355\1\10\1\356\1\10\1\357\1\360\1\361"+ + "\1\0\1\362\1\0\1\363\4\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\1\10\1\364\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\365\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\366\12\10\1\0\1\10\1\367\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\1\10\1\370\1\0\12\10\1\371\2\10"+ + "\1\0\2\10\1\0\1\10\1\0\1\372\4\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\373\12\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\1\10\1\27\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\4\10\1\374\10\10\1\0\2\10"+ + "\1\0\1\326\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\11\10\1\350\3\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\10"+ + "\1\375\13\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\5\10\1\376\7\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\2\10\1\0\1\377"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\11\10\1\u0100\3\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\3\10\1\u0101\4\10"+ + "\1\u0102\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\1\10\1\152\13\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\1\10\1\u0103\13\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0104\1\u0105"+ + "\1\u0106\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\6\10\1\u0107\6\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\1\10\1\u0108\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\10\10\1\u0109\4\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\11\10\1\u010a"+ + "\3\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\u010b\12\10\1\0\2\10\1\0\1\u010c\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\2\10\1\u010d\12\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\1\10\1\u010e\1\0\3\10\1\u010f\1\u0110"+ + "\4\10\1\u0111\1\10\1\u0112\1\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\12\10\1\u0113\2\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\10\10\1\u0114"+ + "\4\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\10\10\1\u0115\4\10\1\0\2\10\1\0\1\10\1\0"+ + "\1\330\4\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\u0116\1\u0117\11\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\1\10\1\u0118\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\4\10\1\u0119\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\5\10\1\u011a\7\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\u011b\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\1\u011c\4\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\1\10\1\u011d\1\0\15\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\u011e\3\10"+ + "\1\u011f\4\10\1\0\2\10\1\0\1\10\1\0\1\u0120"+ + "\4\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\u0121\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\6\10\1\u0122\2\10\1\u0123\3\10"+ + "\1\0\2\10\1\0\1\10\1\0\1\10\1\u011d\3\10"+ + "\4\0\1\10\1\u0124\2\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\3\10\1\u0125\11\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\1\10\1\u0126\1\0\4\10\1\u0127"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\1\10\1\u0128"+ + "\1\0\4\10\1\u0129\10\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\5\10\1\u012a\7\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\u012b\10\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\330\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\2\10"+ + "\1\u012c\2\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\6\10\1\u012d\6\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\10\10\1\u012e\4\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\15\0\1\241\4\0\3\241\51\0\1\241\15\0\1\u012f"+ + "\4\0\3\u012f\51\0\1\u012f\15\0\1\242\1\243\1\73"+ + "\1\0\5\243\1\0\1\243\4\0\1\243\3\0\2\243"+ + "\1\73\5\0\1\243\5\0\1\243\7\0\1\243\7\0"+ + "\1\243\15\0\2\u0130\1\73\1\0\5\u0130\1\0\1\u0130"+ + "\4\0\1\u0130\3\0\2\u0130\1\73\5\0\1\u0130\5\0"+ + "\1\u0130\7\0\1\u0130\7\0\1\u0130\15\0\1\u0131\1\72"+ + "\1\73\2\0\3\u0131\1\73\1\77\1\100\4\0\1\73"+ + "\3\0\1\73\1\100\1\73\33\0\1\u0131\15\0\2\245"+ + "\3\0\3\245\1\73\6\0\1\73\3\0\1\73\35\0"+ + "\1\245\15\0\2\245\3\0\3\245\51\0\1\245\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\10\10\1\145"+ + "\4\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\10\1\u0132\13\10\1\0\1\10\1\u0133\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\u0125\1\10\1\u0106\10\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\1\10\1\326\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\u0134\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\333\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\14\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\3\10\1\u0135\11\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\10\10\1\105\4\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u0136\2\10\1\0"+ + "\1\10\1\0\5\10\3\0\1\14\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0137\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\35\0\1\u0138\1\0\1\u0139\5\0\1\u013a\1\0\1\u013b"+ + "\1\0\1\u013c\10\0\1\u013d\52\0\1\14\103\0\1\265"+ + "\72\0\1\u013e\4\0\1\u013f\101\0\1\u0140\111\0\1\u0141"+ + "\55\0\1\u0142\105\0\1\u0143\70\0\1\u0144\47\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0145\2\10"+ + "\1\u0146\7\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\35\0\1\u0147\54\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\4\10\1\u0148\10\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\1\10\1\u0149\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\10\10\1\u014a"+ + "\4\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u014b\10\10\1\0\2\10\1\0\1\u014c\1\0"+ + "\5\10\4\0\1\152\3\10\13\0\13\10\1\0\1\10"+ + "\4\0\1\10\1\u014d\1\0\15\10\1\0\2\10\1\0"+ + "\1\u014e\1\0\1\u014f\4\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0150\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\u0151\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\1\u0152\4\10\1\152\7\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\12\10\1\u0118\2\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\4\10\1\350\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\3\10"+ + "\1\316\11\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\365\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\2\10\1\u0153\2\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\6\10\1\u0154\6\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\12\10"+ + "\1\u0155\2\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\10\10\1\u0156\4\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\3\10\1\152\11\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0125\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\u0157\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\250\15\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\3\10"+ + "\1\152\1\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\6\10\1\321\6\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\1\10\1\u0158\2\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\10"+ + "\1\u0159\13\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\4\10\1\152\10\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\2\10\1\u015a\2\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\152\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\11\10"+ + "\1\u0134\3\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\56\0\1\u015b\33\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\260\12\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\u015c\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\5\10\1\u015d\7\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u015e\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\1\10\1\152\2\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\344\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\1\10\1\u015f\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\1\10\1\u0160\3\10\4\0\4\10\60\0"+ + "\1\u0161\31\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u0162\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\6\10\1\152\6\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\14\10\1\u0163\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\3\10\1\330\11\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\1\10\1\u0164\1\0"+ + "\15\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\27\12\10\1\u0165\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\12\10\1\u0166\2\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\2\10\1\u0167\1\u0168\11\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\12\10"+ + "\1\u0169\2\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\12\10\1\u016a\2\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\34\0\1\u016b\10\0\1\u016c"+ + "\12\0\1\u016d\1\0\1\u016e\2\0\1\u016f\24\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u0170\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\10"+ + "\1\u0171\13\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\4\10\1\152\1\u0172\4\10\1\u0173\2\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\5\10\1\u0174"+ + "\7\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\10\1\u0175\13\10\1\0\2\10\1\0\1\10\1\0"+ + "\3\10\1\330\1\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\13\10\1\152\1\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\1\10\1\u0176\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\u0177\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\10"+ + "\1\152\2\10\1\u0178\4\10\1\253\3\10\1\0\2\10"+ + "\1\0\1\u0179\1\0\5\10\4\0\1\152\3\10\13\0"+ + "\13\10\1\0\1\10\4\0\1\10\1\326\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\6\10"+ + "\1\u017a\6\10\1\0\2\10\1\0\1\10\1\0\1\u017b"+ + "\4\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\1\10\1\u017c\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\11\10\1\u017d\3\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\1\10"+ + "\1\u017e\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\u017f"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\14\10\1\u0180\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\4\10\1\u0181\10\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\2\10\1\0\1\152"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\u0182\2\10\1\14\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\u0183\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\1\10\1\u0184\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u0185\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\2\10\1\27\12\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\3\10\1\u0186"+ + "\11\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\u0187\14\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\1\10\1\u0188\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\2\10\1\u0189\12\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\4\10\1\u018a\10\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\2\10\1\u011a"+ + "\2\10\1\u011b\7\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\u018b\1\0\4\10\1\152\10\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\1\10\1\u018c\13\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u018d\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\250\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\5\10\1\u018e\7\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\346\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\1\u018f\11\10\1\u0190"+ + "\2\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u0191\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\11\10\1\u0192\3\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\1\u0193\14\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\1\10\1\152\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\1\u0194\1\10\1\0\1\152\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\10\10"+ + "\1\326\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\11\10\1\152\3\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\4\10\1\u0195\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u0196\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\1\10\1\152"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\2\10"+ + "\1\0\1\10\1\0\3\10\1\u0197\1\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\1\u0118\1\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\1\u0198\14\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\11\10\1\253\3\10\1\0\2\10\1\14\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\u0199\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\2\10\1\u019a\12\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u019b\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u019c\2\10\1\0\1\u019d\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u019e\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\10"+ + "\1\u0158\13\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\u019f\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\3\10\1\u01a0\11\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\3\10\1\u01a1\11\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\7\10\1\u01a2\5\10"+ + "\1\0\2\10\1\0\1\152\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\1\157\4\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\5\10\1\260\7\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\15\0\2\u01a3\1\73\1\0\5\u01a3"+ + "\1\0\1\u01a3\4\0\1\u01a3\3\0\2\u01a3\1\73\5\0"+ + "\1\u01a3\5\0\1\u01a3\7\0\1\u01a3\7\0\1\u01a3\15\0"+ + "\1\u01a4\1\72\1\73\2\0\3\u01a4\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\u01a4"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u01a5\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\3\10"+ + "\1\u01a6\11\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\14\10\1\152\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\1\u01a7\14\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\41\0\1\u01a8\14\0\1\u01a9"+ + "\33\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\u01aa\1\0\5\10\4\0\4\10"+ + "\56\0\1\u01ab\55\0\1\u01ac\24\0\1\u01ad\65\0\1\u01ae"+ + "\66\0\1\u01af\72\0\1\u01b0\117\0\1\u01b1\55\0\1\u01b2"+ + "\124\0\1\u01b3\50\0\1\u01b4\123\0\1\u01b5\51\0\1\266"+ + "\110\0\1\u01b6\70\0\1\u01b7\50\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\u01b8\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\u01b9\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\60\0\1\250"+ + "\31\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\1\10\1\u01ba\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u01bb\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\1\10\1\233\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\1\u01bc\14\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\5\10\1\u011b\7\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\14"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\u01bd"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\u01be\7\10\1\u01bf\2\10\1\0\1\10\1\u01c0"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\1\152\1\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\10\10\1\u01c1"+ + "\4\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\10\1\0\1\u01c2\4\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\1\10"+ + "\1\u011b\1\0\15\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\u01c3\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\10\10\1\330\4\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\2\10\1\260\2\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\14\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\1\u01c4\14\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u01c5\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u01c6\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\47\0\1\u01c7\104\0\1\u01c8\34\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\7\10\1\334\5\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\u01c9\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\u01ca\10\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\10\1\0\2\10\1\u01cb\2\10"+ + "\4\0\4\10\43\0\1\u01cc\46\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\1\u01cd\14\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u01ce\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u01cf\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\60\0\1\u0144\31\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\11\10\1\330"+ + "\3\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\1\10\1\u01d0\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\1\u01d1\14\10\1\0\1\10\1\u0166\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\10\10\1\334\4\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\1\u0155\14\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\37\0"+ + "\1\u01d2\115\0\1\u01d3\61\0\1\u01d4\113\0\1\u01d5\67\0"+ + "\1\u01d6\42\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\10\10\1\u01d7\4\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\u01d8\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\3\10\1\u01d9\11\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\3\10\1\u01da\11\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\1\u01db\1\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u01dc\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\10\10"+ + "\1\u01dd\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\1\10\1\u01de\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\4\10\1\u01df\10\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\3\10\1\u01e0\11\10\1\0"+ + "\1\10\1\u01e1\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\371\7\10\1\233\2\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\4\10\1\u01e2\10\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\14\10\1\334\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\u01e3"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\334\12\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\u01e4\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\5\10\1\u01e5\7\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\60\0\1\u0144\4\0"+ + "\1\u0144\61\0\1\u01e6\41\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\2\10\1\0\1\10\1\0"+ + "\3\10\1\u01e7\1\10\4\0\4\10\35\0\1\u01e8\54\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\2\10\1\152\2\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u01e9\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\0\2\10\1\0\1\10\1\0"+ + "\2\10\1\u01ea\2\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\2\10\1\0"+ + "\1\u01eb\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u01ec\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\4\10\1\u01ed\10\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\u01ee"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\11\10\1\u01ef"+ + "\3\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\1\10\1\200"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\1\10"+ + "\1\u01f0\1\0\15\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\11\10\1\u01f1\3\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\2\10\1\u01f2\12\10\1\u01f3"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\1\u01f4\14\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\u01f5\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\u011b\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\5\10\1\u01f6\7\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\74\0\1\u01f7"+ + "\15\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u01f8\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\4\10\1\u01f9\10\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\5\10\1\u01fa\7\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\60\0\1\u016d"+ + "\55\0\1\u01fb\10\0\1\u01fc\41\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\2\10\1\u01fd\2\10\4\0\4\10\45\0\1\u01fe"+ + "\66\0\1\u01ff\6\0\1\u01cc\11\0\1\u01d2\1\0\1\u0200"+ + "\2\0\1\u0201\26\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\216\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\15\10\1\0\1\10\1\145\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\5\10\1\u0202\7\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\15\0"+ + "\2\u0203\1\73\1\0\5\u0203\1\0\1\u0203\4\0\1\u0203"+ + "\3\0\2\u0203\1\73\5\0\1\u0203\5\0\1\u0203\7\0"+ + "\1\u0203\7\0\1\u0203\15\0\1\u0204\1\72\1\73\2\0"+ + "\3\u0204\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\1\73\33\0\1\u0204\35\0\1\u01e8\2\0\1\u0205"+ + "\14\0\1\u0206\34\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\3\10\1\u0207\11\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\1\10\1\330\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\55\0\1\u0208\56\0"+ + "\1\u0209\54\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\6\10\1\u020a\6\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\62\0\1\u020b\57\0\1\u020c\100\0"+ + "\1\u020d\117\0\1\u020e\44\0\1\u020f\23\0\1\u0210\100\0"+ + "\1\u013d\61\0\1\14\74\0\1\u0211\117\0\1\u0212\66\0"+ + "\1\u0213\100\0\1\u0214\64\0\1\u0215\75\0\1\14\46\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\3\10\1\u0216"+ + "\11\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\56\0\1\u0217\33\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\u0218\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\1\u0219\14\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\1\10\1\u021a\1\0\15\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\10\10\1\u021b\4\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\4\10"+ + "\1\u021c\10\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\3\10\1\u021d\11\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\11\10\1\u021e\3\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\12\10\1\u021f\2\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u0177\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\46\0\1\u0220\43\0\13\10\1\0\1\10"+ + "\4\0\1\10\1\322\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\34\0\1\u0221\112\0"+ + "\1\u0222\75\0\1\u0223\105\0\1\u0224\55\0\1\u0225\10\0"+ + "\1\u0220\43\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\3\10\1\u0226\11\10\1\u0227\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\15\10\1\u0228\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\47\0\1\14\42\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\1\10\1\316"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\42\0\1\u0229"+ + "\1\0\1\u022a\15\0\1\u022b\50\0\1\u022c\1\u01ff\4\0"+ + "\1\u0144\47\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\4\10\1\u022d\10\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\11\10\1\u014a\3\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\35\0\1\u022e\104\0"+ + "\1\u022f\105\0\1\14\67\0\1\u0230\77\0\1\u0231\45\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\330\1\0\5\10\4\0\4\10\42\0"+ + "\1\u0232\47\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\1\330\1\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\4\10\1\u0233\10\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\u0234\12\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\37\0\1\u0235"+ + "\52\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u0236\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\u0237"+ + "\14\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\10\10\1\u0238\4\10\1\0\1\10\1\u0239\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\2\10\1\u023a\12\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\10\10\1\u023b\4\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u023c\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\2\10\1\u023d\12\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\60\0\1\u0144\1\0\1\u013d"+ + "\27\0\13\10\1\0\1\10\4\0\2\10\1\0\10\10"+ + "\1\u0112\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\42\0\1\u023e\47\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\4\10\1\u0134\10\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\60\0\1\14"+ + "\31\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u023f\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\u01b0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\2\10\1\0\1\u0240\1\0\5\10\4\0\4\10"+ + "\34\0\1\u0241\2\0\1\u0235\1\u0242\1\0\1\u0243\5\0"+ + "\1\u0244\7\0\1\u0245\5\0\1\u0246\23\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u0247\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\44\0\1\u0248\45\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\u0249"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\10\1\0\3\10\1\260"+ + "\1\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\4\10\1\u024a\10\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\1\10\1\u024b\13\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\66\0"+ + "\1\u024c\23\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\1\10\1\u024d\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\u024e\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\3\10\1\u0112\11\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\41\0\1\u024c\50\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\u024f\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\5\10\1\u0250\7\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\2\10"+ + "\1\u0251\12\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\35\0\1\u0252\103\0\1\u0253\47\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\2\10"+ + "\1\0\1\10\1\0\1\152\4\10\4\0\4\10\47\0"+ + "\1\u0254\73\0\1\u01b7\105\0\1\u0255\67\0\1\u01cc\45\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\10\10\1\u0256"+ + "\4\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\15\0\2\u0257\1\73\1\0\5\u0257\1\0\1\u0257"+ + "\4\0\1\u0257\3\0\2\u0257\1\73\5\0\1\u0257\5\0"+ + "\1\u0257\7\0\1\u0257\7\0\1\u0257\15\0\1\u0258\1\72"+ + "\1\73\2\0\3\u0258\1\73\1\77\1\100\4\0\1\73"+ + "\3\0\1\73\1\100\1\73\33\0\1\u0258\44\0\1\u0259"+ + "\110\0\1\u01cc\33\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\2\10\1\0\1\10\1\0\2\10"+ + "\1\334\2\10\4\0\4\10\41\0\1\u025a\121\0\1\u025b"+ + "\25\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\1\10\1\u0166\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\41\0\1\14\76\0\1\u025c\101\0\1\u025d\74\0"+ + "\1\u025e\75\0\1\u025f\101\0\1\u0260\106\0\1\u0261\76\0"+ + "\1\u0262\66\0\1\u0263\67\0\1\u0264\115\0\1\u0265\35\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\2\10\1\u0266"+ + "\12\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\47\0\1\u0267\42\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\11\10\1\333\3\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\4\10\1\u0186\4\10\1\u0268"+ + "\3\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\11\10\1\326\3\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\12\10\1\u021a\2\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\14\10\1\u0269\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\u026a\10\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\10\10"+ + "\1\u026b\4\10\1\0\2\10\1\0\1\10\1\0\5\10"+ + "\4\0\4\10\13\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\11\10\1\u026c\3\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\53\0\1\u0221\62\0\1\u026d"+ + "\103\0\1\u0185\11\0\1\u01b7\76\0\1\u026e\67\0\1\250"+ + "\72\0\1\u026f\46\0\13\10\1\0\1\10\4\0\1\10"+ + "\1\341\1\0\15\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\40\0\1\u0205\17\0\1\u0161\100\0"+ + "\1\u0270\60\0\1\u0271\77\0\1\u0272\3\0\1\u0273\66\0"+ + "\1\u0274\74\0\1\u0275\52\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\2\10\1\u0276\12\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\40\0\1\14\101\0"+ + "\1\u0277\103\0\1\u0278\77\0\1\u0279\64\0\1\u027a\52\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\u027b\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\u027c"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\35\0"+ + "\1\u01b7\117\0\1\u027d\33\0\13\10\1\0\1\10\4\0"+ + "\1\10\1\u027e\1\0\15\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\13\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\12\10\1\u027f\2\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\1\10\1\u0280\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\0"+ + "\2\10\1\0\1\10\1\0\1\u0281\4\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\1\10\1\u0282\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\u0283\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\u0284\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\56\0\1\u0285\54\0\1\u0201\55\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\5\10\1\27\7\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\42\0"+ + "\1\u0286\100\0\1\u0287\76\0\1\u0288\105\0\1\u0206\76\0"+ + "\1\u0289\67\0\1\u028a\17\0\1\u028b\53\0\1\u028c\71\0"+ + "\1\u028d\55\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\u028e\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\u028f\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\64\0\1\14\25\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\3\10\1\u0290\11\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\46\0\1\u0291\7\0"+ + "\1\u01b7\66\0\1\u0291\43\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\10\10\1\u0292\4\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\2\10\1\0"+ + "\1\10\1\0\1\10\1\u0293\3\10\4\0\4\10\43\0"+ + "\1\u0294\111\0\1\u0295\64\0\1\u0296\71\0\1\u0297\52\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\1\10\1\u0112"+ + "\13\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\15\0\2\u0298\1\73\1\0\5\u0298\1\0\1\u0298"+ + "\4\0\1\u0298\3\0\2\u0298\1\73\5\0\1\u0298\5\0"+ + "\1\u0298\7\0\1\u0298\7\0\1\u0298\15\0\1\u0299\1\72"+ + "\1\73\2\0\3\u0299\1\73\1\77\1\100\4\0\1\73"+ + "\3\0\1\73\1\100\1\73\33\0\1\u0299\50\0\1\14"+ + "\75\0\1\u0209\106\0\1\14\66\0\1\u0185\76\0\1\u029a"+ + "\66\0\1\u029b\106\0\1\u01e8\71\0\1\u029c\103\0\1\u029d"+ + "\12\0\1\u029e\64\0\1\u029f\63\0\1\u02a0\101\0\1\u02a1"+ + "\120\0\1\u029e\27\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\15\10\1\0\1\10\1\u01d9\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\47\0\1\u02a2\42\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\0\1\10\1\u02a3"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\13\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\5\10\1\200\7\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\13\0\13\10\1\0\1\10\4\0\2\10\1\0\1\152"+ + "\14\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\5\10\1\152\7\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\4\10\1\314\10\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\42\0\1\u020b\120\0"+ + "\1\u02a4\65\0\1\14\101\0\1\u02a5\70\0\1\u02a6\67\0"+ + "\1\u02a7\100\0\1\u02a8\76\0\1\u02a9\102\0\1\u02aa\42\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\1\10\1\u0107"+ + "\13\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\41\0\1\u02ab\110\0\1\u02ac\70\0\1\u01e8\66\0"+ + "\1\u020b\54\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\2\10\1\u02ad\12\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\35\0\1\u01e8\24\0\1\u02ae\101\0"+ + "\1\u02af\24\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\0\2\10\1\0\1\260\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\11\10\1\u02b0\3\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\13\0\13\10\1\0\1\10\4\0"+ + "\2\10\1\0\4\10\1\u0107\10\10\1\0\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\13\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\2\10\1\371\12\10\1\0"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\13\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\4\10\1\u0240"+ + "\10\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\35\0\1\u01e8\22\0\1\u02b1\63\0\1\u02b2\111\0"+ + "\1\u02b3\62\0\1\u02b4\103\0\1\u02b5\62\0\1\u02b6\105\0"+ + "\1\u02b7\76\0\1\u02b8\75\0\1\u020b\102\0\1\u02b9\63\0"+ + "\1\14\136\0\1\u02ba\62\0\1\u0144\1\0\1\u02bb\27\0"+ + "\13\10\1\0\1\10\4\0\2\10\1\0\15\10\1\u02bc"+ + "\2\10\1\0\1\10\1\0\5\10\4\0\4\10\37\0"+ + "\1\u0225\52\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\15\10\1\u02bd\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\13\0\13\10\1\0\1\10\4\0\2\10\1\0"+ + "\6\10\1\u02be\6\10\1\0\2\10\1\0\1\10\1\0"+ + "\5\10\4\0\4\10\41\0\1\u02bf\115\0\1\u01e8\101\0"+ + "\1\u02c0\47\0\1\u02c1\57\0\2\u02c2\1\73\1\0\5\u02c2"+ + "\1\0\1\u02c2\4\0\1\u02c2\3\0\2\u02c2\1\73\5\0"+ + "\1\u02c2\5\0\1\u02c2\7\0\1\u02c2\7\0\1\u02c2\15\0"+ + "\1\u02c3\1\72\1\73\2\0\3\u02c3\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\u02c3"+ + "\43\0\1\u01e8\103\0\1\u01e8\103\0\1\u020b\62\0\1\u02c4"+ + "\76\0\1\u02c5\77\0\1\u02c6\110\0\1\u02c7\76\0\1\u02c8"+ + "\100\0\1\u024c\33\0\13\10\1\0\1\10\4\0\2\10"+ + "\1\0\3\10\1\u02c9\11\10\1\0\2\10\1\0\1\10"+ + "\1\0\5\10\4\0\4\10\54\0\1\u02ca\67\0\1\u02cb"+ + "\107\0\1\u02cc\55\0\1\14\115\0\1\344\100\0\1\14"+ + "\100\0\1\u01b7\65\0\1\u02a7\70\0\1\u02cd\50\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\4\10\1\u0125\10\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\41\0\1\u02ce\76\0\1\u02cf\50\0\13\10\1\0\1\10"+ + "\4\0\2\10\1\0\4\10\1\u023d\10\10\1\0\2\10"+ + "\1\0\1\10\1\0\5\10\4\0\4\10\43\0\1\u02d0"+ + "\102\0\1\u02d1\107\0\1\u02d2\74\0\1\u01b7\106\0\1\u026d"+ + "\75\0\1\14\60\0\1\u01b7\71\0\1\u02d3\103\0\1\u02d4"+ + "\70\0\1\u02d5\113\0\1\u02d6\100\0\1\u02d7\57\0\1\u02d8"+ + "\50\0\13\10\1\0\1\10\4\0\2\10\1\0\15\10"+ + "\1\0\1\10\1\u02d9\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\47\0\1\u02da\113\0\1\u02db\55\0\1\u02dc\50\0"+ + "\2\u02dd\1\73\1\0\5\u02dd\1\0\1\u02dd\4\0\1\u02dd"+ + "\3\0\2\u02dd\1\73\5\0\1\u02dd\5\0\1\u02dd\7\0"+ + "\1\u02dd\7\0\1\u02dd\15\0\1\u02de\1\72\1\73\2\0"+ + "\3\u02de\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\1\73\33\0\1\u02de\56\0\1\u02df\63\0\1\u02e0"+ + "\111\0\1\u02e1\67\0\1\u02e2\71\0\1\u02e3\47\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\15\10\1\0\2\10"+ + "\1\250\1\10\1\0\5\10\4\0\4\10\76\0\1\u022e"+ + "\45\0\1\u02e4\73\0\1\u02e5\103\0\1\14\10\0\1\14"+ + "\61\0\1\u02e6\70\0\1\u02e7\110\0\1\u02e8\73\0\1\u02e9"+ + "\77\0\1\u02ea\72\0\1\u02eb\101\0\1\u025f\116\0\1\u01e8"+ + "\57\0\1\u02ec\115\0\1\u02ed\47\0\1\u02ee\25\0\1\u02ef"+ + "\26\0\13\10\1\0\1\10\4\0\1\10\1\u02f0\1\0"+ + "\15\10\1\0\2\10\1\0\1\10\1\0\5\10\4\0"+ + "\4\10\34\0\1\u02f1\116\0\1\u02f2\76\0\1\u02f3\37\0"+ + "\2\u02f4\1\73\1\0\5\u02f4\1\0\1\u02f4\4\0\1\u02f4"+ + "\3\0\2\u02f4\1\73\5\0\1\u02f4\5\0\1\u02f4\7\0"+ + "\1\u02f4\7\0\1\u02f4\15\0\1\u02f5\1\72\1\73\2\0"+ + "\3\u02f5\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\1\73\33\0\1\u02f5\40\0\1\u02f6\114\0\1\265"+ + "\100\0\1\u02f7\57\0\1\u02f8\74\0\1\u02f9\76\0\1\u02fa"+ + "\113\0\1\u02fb\75\0\1\u02fc\66\0\1\u02fd\104\0\1\u02fe"+ + "\110\0\1\u024c\71\0\1\u0225\76\0\1\u02a7\74\0\1\u01f3"+ + "\104\0\1\u02ff\57\0\1\u0300\72\0\1\u0301\52\0\13\10"+ + "\1\0\1\10\4\0\2\10\1\0\1\10\1\u0302\13\10"+ + "\1\0\2\10\1\0\1\10\1\0\5\10\4\0\4\10"+ + "\56\0\1\u0303\70\0\1\u01fc\70\0\1\u0304\4\0\1\u0305"+ + "\44\0\2\u0306\1\73\1\0\5\u0306\1\0\1\u0306\4\0"+ + "\1\u0306\3\0\2\u0306\1\73\5\0\1\u0306\5\0\1\u0306"+ + "\7\0\1\u0306\7\0\1\u0306\15\0\1\u0307\1\72\1\73"+ + "\2\0\3\u0307\1\73\1\77\1\100\4\0\1\73\3\0"+ + "\1\73\1\100\1\73\33\0\1\u0307\56\0\1\u0308\100\0"+ + "\1\u0309\52\0\1\u030a\77\0\1\u030b\76\0\1\u030c\116\0"+ + "\1\u030d\65\0\1\u022e\106\0\1\u0247\72\0\1\u01b7\114\0"+ + "\1\u030e\51\0\1\u0224\100\0\1\250\46\0\13\10\1\0"+ + "\1\10\4\0\2\10\1\0\15\10\1\u030f\2\10\1\0"+ + "\1\10\1\0\5\10\4\0\4\10\50\0\1\u020b\67\0"+ + "\1\u0310\74\0\1\u0311\54\0\2\u0312\1\73\1\0\5\u0312"+ + "\1\0\1\u0312\4\0\1\u0312\3\0\2\u0312\1\73\5\0"+ + "\1\u0312\5\0\1\u0312\7\0\1\u0312\7\0\1\u0312\15\0"+ + "\1\u0313\1\72\1\73\2\0\3\u0313\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\u0313"+ + "\66\0\1\u0314\51\0\1\115\77\0\1\u0315\75\0\1\u0316"+ + "\122\0\1\u01e8\67\0\1\u025f\64\0\1\u0317\55\0\1\14"+ + "\107\0\1\u01b7\127\0\1\u0318\26\0\2\u0319\1\73\1\0"+ + "\5\u0319\1\0\1\u0319\4\0\1\u0319\3\0\2\u0319\1\73"+ + "\5\0\1\u0319\5\0\1\u0319\7\0\1\u0319\7\0\1\u0319"+ + "\15\0\1\u031a\1\72\1\73\2\0\3\u031a\1\73\1\77"+ + "\1\100\4\0\1\73\3\0\1\73\1\100\1\73\33\0"+ + "\1\u031a\42\0\1\u031b\75\0\1\u031c\111\0\1\u031d\64\0"+ + "\1\u025b\107\0\1\u01b7\40\0\2\u031e\1\73\1\0\5\u031e"+ + "\1\0\1\u031e\4\0\1\u031e\3\0\2\u031e\1\73\5\0"+ + "\1\u031e\5\0\1\u031e\7\0\1\u031e\7\0\1\u031e\15\0"+ + "\1\u031f\1\72\1\73\2\0\3\u031f\1\73\1\77\1\100"+ + "\4\0\1\73\3\0\1\73\1\100\1\73\33\0\1\u031f"+ + "\64\0\1\265\62\0\1\u0320\104\0\1\u0321\35\0\2\u0322"+ + "\1\73\1\0\5\u0322\1\0\1\u0322\4\0\1\u0322\3\0"+ + "\2\u0322\1\73\5\0\1\u0322\5\0\1\u0322\7\0\1\u0322"+ + "\7\0\1\u0322\15\0\1\u0323\1\72\1\73\2\0\3\u0323"+ + "\1\73\1\77\1\100\4\0\1\73\3\0\1\73\1\100"+ + "\1\73\33\0\1\u0323\43\0\1\u0324\102\0\1\u0325\44\0"+ + "\2\u0326\1\73\1\0\5\u0326\1\0\1\u0326\4\0\1\u0326"+ + "\3\0\2\u0326\1\73\5\0\1\u0326\5\0\1\u0326\7\0"+ + "\1\u0326\7\0\1\u0326\15\0\1\u0327\1\72\1\73\2\0"+ + "\3\u0327\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\1\73\33\0\1\u0327\37\0\1\u0328\124\0\1\115"+ + "\26\0\2\u0329\1\73\1\0\5\u0329\1\0\1\u0329\4\0"+ + "\1\u0329\3\0\2\u0329\1\73\5\0\1\u0329\5\0\1\u0329"+ + "\7\0\1\u0329\7\0\1\u0329\15\0\1\u032a\1\72\1\73"+ + "\2\0\3\u032a\1\73\1\77\1\100\4\0\1\73\3\0"+ + "\1\73\1\100\1\73\33\0\1\u032a\44\0\1\116\51\0"+ + "\1\73\22\0\1\73\51\0\1\u032b\1\72\1\73\2\0"+ + "\3\u032b\1\73\1\77\1\100\4\0\1\73\3\0\1\73"+ + "\1\100\1\73\33\0\1\u032b\15\0\1\u032c\1\72\1\73"+ + "\2\0\3\u032c\1\73\1\77\1\100\4\0\1\73\3\0"+ + "\1\73\1\100\1\73\33\0\1\u032c\15\0\1\u032d\1\72"+ + "\1\73\2\0\3\u032d\1\73\1\77\1\100\4\0\1\73"+ + "\3\0\1\73\1\100\1\73\33\0\1\u032d\15\0\1\u032e"+ + "\1\72\1\73\2\0\3\u032e\1\73\1\77\1\100\4\0"+ + "\1\73\3\0\1\73\1\100\1\73\33\0\1\u032e\15\0"+ + "\2\72\1\73\2\0\3\72\1\73\1\77\1\100\4\0"+ + "\1\73\3\0\1\73\1\100\1\73\33\0\1\72\6\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[49833]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\7\1\3\11\33\1\6\11\2\1\2\11"+ + "\4\1\1\11\2\1\1\11\1\0\3\1\1\0\14\1"+ + "\10\0\112\1\1\11\6\1\1\0\1\1\1\11\13\1"+ + "\11\0\1\1\1\0\33\1\1\0\11\1\1\0\12\1"+ + "\1\0\77\1\1\11\6\1\1\0\1\1\15\0\2\1"+ + "\1\0\23\1\2\0\4\1\1\0\3\1\1\0\5\1"+ + "\5\0\22\1\2\0\1\1\1\0\20\1\1\0\4\1"+ + "\2\0\1\1\2\0\5\1\1\0\2\1\2\0\1\1"+ + "\15\0\1\1\1\0\11\1\1\0\1\1\5\0\2\1"+ + "\1\0\1\1\2\0\2\1\5\0\1\1\1\0\3\1"+ + "\1\0\7\1\1\0\1\1\1\0\1\1\1\0\3\1"+ + "\1\0\1\1\1\0\4\1\1\0\3\1\1\0\3\1"+ + "\2\0\1\1\4\0\3\1\2\0\1\1\2\0\1\1"+ + "\13\0\1\1\1\0\10\1\6\0\1\1\6\0\1\1"+ + "\5\0\2\1\2\0\7\1\2\0\1\1\10\0\3\1"+ + "\1\0\1\1\2\0\2\1\4\0\3\1\15\0\1\1"+ + "\1\0\5\1\11\0\1\1\4\0\1\1\2\0\5\1"+ + "\15\0\1\1\1\0\2\1\4\0\2\1\11\0\2\1"+ + "\10\0\1\1\2\0\1\1\15\0\1\1\3\0\2\1"+ + "\5\0\1\1\17\0\1\1\3\0\2\1\15\0\1\1"+ + "\3\0\1\1\4\0\1\1\14\0\1\1\4\0\1\1"+ + "\13\0\1\1\6\0\1\1\4\0\1\1\3\0\1\1"+ + "\3\0\1\1\2\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[814]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ClojureLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ClojureLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ClojureLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1782) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 9: + { return token(TokenType.OPERATOR, -PARAN); + } + case 19: break; + case 17: + { return token(TokenType.KEYWORD); + } + case 20: break; + case 4: + { return token(TokenType.NUMBER); + } + case 21: break; + case 10: + { return token(TokenType.OPERATOR, CURLY); + } + case 22: break; + case 11: + { return token(TokenType.OPERATOR, -CURLY); + } + case 23: break; + case 14: + { tokenLength += yylength(); + } + case 24: break; + case 15: + { yybegin(YYINITIAL); + } + case 25: break; + case 7: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 26: break; + case 16: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 27: break; + case 13: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 28: break; + case 8: + { return token(TokenType.OPERATOR, PARAN); + } + case 29: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 30: break; + case 5: + { return token(TokenType.KEYWORD2); + } + case 31: break; + case 18: + { tokenLength += 2; + } + case 32: break; + case 12: + { return token(TokenType.OPERATOR, BRACKET); + } + case 33: break; + case 2: + { return token(TokenType.COMMENT); + } + case 34: break; + case 6: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 35: break; + case 1: + { + } + case 36: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CppLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CppLexer.java new file mode 100644 index 000000000..f302a9c29 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/CppLexer.java @@ -0,0 +1,1092 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Copyright 2006 Arnout Engelen . + * Copyright 2000-2006 Omnicore Software, Hans Kratz & Dennis Strein GbR, + * Geert Bevin . + * Distributed under the terms of either: + * - the common development and distribution license (CDDL), v1.0; or + * - the GNU Lesser General Public License, v2.1 or later + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/cpp.flex + */ +public final class CppLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\10\1\0\1\2\2\0\1\1\16\10\5\0\1\66\1\55\1\5"+ + "\1\6\1\66\1\66\1\57\1\60\1\61\1\4\1\32\1\66\1\32"+ + "\1\27\1\3\1\12\7\17\2\11\1\66\1\66\1\70\1\66\1\67"+ + "\1\66\1\0\3\16\1\25\1\31\1\25\5\7\1\23\10\7\1\21"+ + "\2\7\1\14\2\7\1\64\1\56\1\65\1\66\1\51\1\0\1\35"+ + "\1\33\1\15\1\26\1\30\1\24\1\45\1\41\1\44\1\6\1\36"+ + "\1\22\1\46\1\43\1\42\1\53\1\71\1\34\1\37\1\40\1\20"+ + "\1\54\1\52\1\13\1\47\1\50\1\62\1\66\1\63\1\66\41\10"+ + "\2\0\4\6\4\0\1\6\2\0\1\10\7\0\1\6\4\0\1\6"+ + "\5\0\27\6\1\0\37\6\1\0\u013f\6\31\0\162\6\4\0\14\6"+ + "\16\0\5\6\11\0\1\6\21\0\130\10\5\0\23\10\12\0\1\6"+ + "\13\0\1\6\1\0\3\6\1\0\1\6\1\0\24\6\1\0\54\6"+ + "\1\0\46\6\1\0\5\6\4\0\202\6\1\0\4\10\3\0\105\6"+ + "\1\0\46\6\2\0\2\6\6\0\20\6\41\0\46\6\2\0\1\6"+ + "\7\0\47\6\11\0\21\10\1\0\27\10\1\0\3\10\1\0\1\10"+ + "\1\0\2\10\1\0\1\10\13\0\33\6\5\0\3\6\15\0\4\10"+ + "\14\0\6\10\13\0\32\6\5\0\13\6\16\10\7\0\12\10\4\0"+ + "\2\6\1\10\143\6\1\0\1\6\10\10\1\0\6\10\2\6\2\10"+ + "\1\0\4\10\2\6\12\10\3\6\2\0\1\6\17\0\1\10\1\6"+ + "\1\10\36\6\33\10\2\0\3\6\60\0\46\6\13\10\1\6\u014f\0"+ + "\3\10\66\6\2\0\1\10\1\6\20\10\2\0\1\6\4\10\3\0"+ + "\12\6\2\10\2\0\12\10\21\0\3\10\1\0\10\6\2\0\2\6"+ + "\2\0\26\6\1\0\7\6\1\0\1\6\3\0\4\6\2\0\1\10"+ + "\1\6\7\10\2\0\2\10\2\0\3\10\11\0\1\10\4\0\2\6"+ + "\1\0\3\6\2\10\2\0\12\10\4\6\15\0\3\10\1\0\6\6"+ + "\4\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6\1\0\2\6"+ + "\1\0\2\6\2\0\1\10\1\0\5\10\4\0\2\10\2\0\3\10"+ + "\13\0\4\6\1\0\1\6\7\0\14\10\3\6\14\0\3\10\1\0"+ + "\11\6\1\0\3\6\1\0\26\6\1\0\7\6\1\0\2\6\1\0"+ + "\5\6\2\0\1\10\1\6\10\10\1\0\3\10\1\0\3\10\2\0"+ + "\1\6\17\0\2\6\2\10\2\0\12\10\1\0\1\6\17\0\3\10"+ + "\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\2\6"+ + "\1\0\5\6\2\0\1\10\1\6\6\10\3\0\2\10\2\0\3\10"+ + "\10\0\2\10\4\0\2\6\1\0\3\6\4\0\12\10\1\0\1\6"+ + "\20\0\1\10\1\6\1\0\6\6\3\0\3\6\1\0\4\6\3\0"+ + "\2\6\1\0\1\6\1\0\2\6\3\0\2\6\3\0\3\6\3\0"+ + "\10\6\1\0\3\6\4\0\5\10\3\0\3\10\1\0\4\10\11\0"+ + "\1\10\17\0\11\10\11\0\1\6\7\0\3\10\1\0\10\6\1\0"+ + "\3\6\1\0\27\6\1\0\12\6\1\0\5\6\4\0\7\10\1\0"+ + "\3\10\1\0\4\10\7\0\2\10\11\0\2\6\4\0\12\10\22\0"+ + "\2\10\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0"+ + "\5\6\2\0\1\10\1\6\7\10\1\0\3\10\1\0\4\10\7\0"+ + "\2\10\7\0\1\6\1\0\2\6\4\0\12\10\22\0\2\10\1\0"+ + "\10\6\1\0\3\6\1\0\27\6\1\0\20\6\4\0\6\10\2\0"+ + "\3\10\1\0\4\10\11\0\1\10\10\0\2\6\4\0\12\10\22\0"+ + "\2\10\1\0\22\6\3\0\30\6\1\0\11\6\1\0\1\6\2\0"+ + "\7\6\3\0\1\10\4\0\6\10\1\0\1\10\1\0\10\10\22\0"+ + "\2\10\15\0\60\6\1\10\2\6\7\10\4\0\10\6\10\10\1\0"+ + "\12\10\47\0\2\6\1\0\1\6\2\0\2\6\1\0\1\6\2\0"+ + "\1\6\6\0\4\6\1\0\7\6\1\0\3\6\1\0\1\6\1\0"+ + "\1\6\2\0\2\6\1\0\4\6\1\10\2\6\6\10\1\0\2\10"+ + "\1\6\2\0\5\6\1\0\1\6\1\0\6\10\2\0\12\10\2\0"+ + "\2\6\42\0\1\6\27\0\2\10\6\0\12\10\13\0\1\10\1\0"+ + "\1\10\1\0\1\10\4\0\2\10\10\6\1\0\42\6\6\0\24\10"+ + "\1\0\2\10\4\6\4\0\10\10\1\0\44\10\11\0\1\10\71\0"+ + "\42\6\1\0\5\6\1\0\2\6\1\0\7\10\3\0\4\10\6\0"+ + "\12\10\6\0\6\6\4\10\106\0\46\6\12\0\51\6\7\0\132\6"+ + "\5\0\104\6\5\0\122\6\6\0\7\6\1\0\77\6\1\0\1\6"+ + "\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6\2\0\47\6"+ + "\1\0\1\6\1\0\4\6\2\0\37\6\1\0\1\6\1\0\4\6"+ + "\2\0\7\6\1\0\1\6\1\0\4\6\2\0\7\6\1\0\7\6"+ + "\1\0\27\6\1\0\37\6\1\0\1\6\1\0\4\6\2\0\7\6"+ + "\1\0\47\6\1\0\23\6\16\0\11\10\56\0\125\6\14\0\u026c\6"+ + "\2\0\10\6\12\0\32\6\5\0\113\6\3\0\3\6\17\0\15\6"+ + "\1\0\4\6\3\10\13\0\22\6\3\10\13\0\22\6\2\10\14\0"+ + "\15\6\1\0\3\6\1\0\2\10\14\0\64\6\40\10\3\0\1\6"+ + "\3\0\2\6\1\10\2\0\12\10\41\0\3\10\2\0\12\10\6\0"+ + "\130\6\10\0\51\6\1\10\126\0\35\6\3\0\14\10\4\0\14\10"+ + "\12\0\12\10\36\6\2\0\5\6\u038b\0\154\6\224\0\234\6\4\0"+ + "\132\6\6\0\26\6\2\0\6\6\2\0\46\6\2\0\6\6\2\0"+ + "\10\6\1\0\1\6\1\0\1\6\1\0\1\6\1\0\37\6\2\0"+ + "\65\6\1\0\7\6\1\0\1\6\3\0\3\6\1\0\7\6\3\0"+ + "\4\6\2\0\6\6\4\0\15\6\5\0\3\6\1\0\7\6\17\0"+ + "\4\10\32\0\5\10\20\0\2\6\23\0\1\6\13\0\4\10\6\0"+ + "\6\10\1\0\1\6\15\0\1\6\40\0\22\6\36\0\15\10\4\0"+ + "\1\10\3\0\6\10\27\0\1\6\4\0\1\6\2\0\12\6\1\0"+ + "\1\6\3\0\5\6\6\0\1\6\1\0\1\6\1\0\1\6\1\0"+ + "\4\6\1\0\3\6\1\0\7\6\3\0\3\6\5\0\5\6\26\0"+ + "\44\6\u0e81\0\3\6\31\0\11\6\6\10\1\0\5\6\2\0\5\6"+ + "\4\0\126\6\2\0\2\10\2\0\3\6\1\0\137\6\5\0\50\6"+ + "\4\0\136\6\21\0\30\6\70\0\20\6\u0200\0\u19b6\6\112\0\u51a6\6"+ + "\132\0\u048d\6\u0773\0\u2ba4\6\u215c\0\u012e\6\2\0\73\6\225\0\7\6"+ + "\14\0\5\6\5\0\1\6\1\10\12\6\1\0\15\6\1\0\5\6"+ + "\1\0\1\6\1\0\2\6\1\0\2\6\1\0\154\6\41\0\u016b\6"+ + "\22\0\100\6\2\0\66\6\50\0\15\6\3\0\20\10\20\0\4\10"+ + "\17\0\2\6\30\0\3\6\31\0\1\6\6\0\5\6\1\0\207\6"+ + "\2\0\1\10\4\0\1\6\13\0\12\10\7\0\32\6\4\0\1\6"+ + "\1\0\32\6\12\0\132\6\3\0\6\6\2\0\6\6\2\0\6\6"+ + "\2\0\3\6\3\0\2\6\3\0\2\6\22\0\3\10\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\1\1\2\2\1\3\1\4\1\3\2\5\6\4"+ + "\1\2\16\4\2\1\1\6\1\7\1\10\1\11\1\12"+ + "\1\13\2\2\1\14\1\0\1\3\6\0\7\5\1\0"+ + "\1\3\4\5\17\4\1\15\22\4\1\2\4\4\1\15"+ + "\12\4\1\0\1\16\3\0\2\14\11\0\1\17\3\0"+ + "\1\5\1\0\1\5\7\4\1\20\46\4\1\3\13\4"+ + "\12\0\32\4\1\5\16\4\1\0\1\17\4\0\1\4"+ + "\1\2\25\4\3\0\5\4\1\3\10\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[290]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\72\0\164\0\72\0\256\0\350\0\u0122\0\u015c"+ + "\0\u0196\0\u01d0\0\u020a\0\u0244\0\u027e\0\u02b8\0\u02f2\0\u032c"+ + "\0\u0366\0\u03a0\0\u03da\0\u0414\0\u044e\0\u0488\0\u04c2\0\u04fc"+ + "\0\u0536\0\u0570\0\u05aa\0\u05e4\0\u061e\0\u0658\0\u0692\0\u06cc"+ + "\0\72\0\72\0\72\0\72\0\72\0\72\0\u0706\0\u0740"+ + "\0\u077a\0\u07b4\0\u07ee\0\u0828\0\u0862\0\u089c\0\u08d6\0\u0910"+ + "\0\u094a\0\u0984\0\u09be\0\u09f8\0\u0a32\0\72\0\u07ee\0\u0a6c"+ + "\0\u0aa6\0\u0ae0\0\u0b1a\0\u0b54\0\u0b8e\0\u0bc8\0\u0c02\0\u0c3c"+ + "\0\u0c76\0\u0cb0\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2\0\u0e0c"+ + "\0\u0e46\0\u0e80\0\u0eba\0\u0ef4\0\u0f2e\0\u0f68\0\u0fa2\0\u0fdc"+ + "\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138\0\u1172\0\u11ac"+ + "\0\u11e6\0\u1220\0\u125a\0\u1294\0\u12ce\0\u1308\0\u1342\0\u137c"+ + "\0\u13b6\0\u13f0\0\u142a\0\u1464\0\u149e\0\350\0\u14d8\0\u1512"+ + "\0\u154c\0\u1586\0\u15c0\0\u15fa\0\u1634\0\u166e\0\u16a8\0\u16e2"+ + "\0\u0692\0\72\0\u171c\0\u06cc\0\u1756\0\u1790\0\72\0\u17ca"+ + "\0\u1804\0\u183e\0\u1878\0\u18b2\0\u18ec\0\u1926\0\u1960\0\u199a"+ + "\0\u19d4\0\u1a0e\0\u1a48\0\u1a82\0\u1abc\0\u1af6\0\u1b30\0\u1b6a"+ + "\0\u1ba4\0\u1bde\0\u1c18\0\u1c52\0\u1c8c\0\u1cc6\0\350\0\u1d00"+ + "\0\u1d3a\0\u1d74\0\u1dae\0\u1de8\0\u1e22\0\u1e5c\0\u1e96\0\u1ed0"+ + "\0\u1f0a\0\u1f44\0\u1f7e\0\u1fb8\0\u1ff2\0\u202c\0\u2066\0\u20a0"+ + "\0\u20da\0\u2114\0\u214e\0\u2188\0\u21c2\0\u21fc\0\u2236\0\u2270"+ + "\0\u22aa\0\u22e4\0\u231e\0\u2358\0\u2392\0\u23cc\0\u2406\0\u2440"+ + "\0\u247a\0\u24b4\0\u24ee\0\u2528\0\u2562\0\350\0\u259c\0\u25d6"+ + "\0\u2610\0\u264a\0\u2684\0\u26be\0\u26f8\0\u2732\0\u276c\0\u27a6"+ + "\0\u27e0\0\u281a\0\u2854\0\u288e\0\u28c8\0\u2902\0\u293c\0\u2976"+ + "\0\u29b0\0\u29ea\0\u2a24\0\u2a5e\0\u2a98\0\u2ad2\0\u2b0c\0\u2b46"+ + "\0\u2b80\0\u2bba\0\u2bf4\0\u2c2e\0\u2c68\0\u2ca2\0\u2cdc\0\u2d16"+ + "\0\u2d50\0\u2d8a\0\u2dc4\0\u2dfe\0\u2e38\0\u2e72\0\u2eac\0\u2ee6"+ + "\0\u2f20\0\u2f5a\0\u2f94\0\u2fce\0\u3008\0\350\0\u3042\0\u307c"+ + "\0\u30b6\0\u30f0\0\u312a\0\u3164\0\u319e\0\u31d8\0\u3212\0\u324c"+ + "\0\u3286\0\u32c0\0\u32fa\0\u3334\0\u336e\0\72\0\u33a8\0\u33e2"+ + "\0\u341c\0\u3456\0\u3490\0\350\0\u34ca\0\u3504\0\u353e\0\u3578"+ + "\0\u35b2\0\u35ec\0\u3626\0\u3660\0\u369a\0\u36d4\0\u370e\0\u3748"+ + "\0\u3782\0\u37bc\0\u37f6\0\u3830\0\u386a\0\u38a4\0\u38de\0\u3918"+ + "\0\u3952\0\u398c\0\u39c6\0\u3a00\0\u3a3a\0\u3a74\0\u3aae\0\u3ae8"+ + "\0\u3b22\0\u3b5c\0\u3b96\0\u3bd0\0\u3c0a\0\u3c44\0\u3c7e\0\u3cb8"+ + "\0\u3cf2\0\u3d2c"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[290]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\2\1\3\1\4\1\5\1\6\1\7\1\2\1\10"+ + "\1\11\1\12\1\7\1\13\1\7\1\10\1\14\1\7"+ + "\1\15\1\7\1\16\1\7\1\17\1\20\1\21\1\7"+ + "\1\4\1\22\1\23\1\24\1\6\1\25\1\26\1\6"+ + "\1\27\1\30\1\31\1\32\1\33\2\6\1\7\1\34"+ + "\1\35\1\36\1\37\1\2\1\40\1\41\1\42\1\43"+ + "\1\44\1\45\1\46\1\4\1\47\1\50\1\6\75\0"+ + "\1\51\1\52\72\0\1\53\1\0\1\53\1\0\2\53"+ + "\1\0\1\53\1\0\2\53\1\54\1\53\1\55\1\53"+ + "\1\0\1\53\1\56\1\0\1\57\1\53\12\0\1\60"+ + "\4\0\1\53\1\0\1\61\24\0\21\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\5\0\1\53\1\6\1\7"+ + "\1\6\2\7\1\6\1\7\1\6\2\7\1\6\1\7"+ + "\1\6\1\7\1\6\1\7\1\6\1\0\1\6\1\7"+ + "\1\0\16\6\1\7\3\6\14\0\1\6\5\0\1\53"+ + "\1\0\1\53\1\0\2\10\1\0\1\53\1\0\1\53"+ + "\1\10\1\62\1\63\1\64\1\65\1\66\1\67\1\66"+ + "\1\70\1\71\1\72\17\0\1\53\25\0\1\53\1\0"+ + "\1\53\1\0\1\73\1\74\1\75\1\76\1\0\1\53"+ + "\1\74\1\62\1\63\1\64\1\65\1\66\1\67\1\66"+ + "\1\70\1\71\1\72\17\0\1\53\26\0\21\6\1\0"+ + "\2\6\1\0\7\6\1\77\12\6\14\0\1\6\6\0"+ + "\14\6\1\100\4\6\1\0\2\6\1\0\2\6\1\101"+ + "\3\6\1\102\1\103\1\6\1\104\10\6\14\0\1\6"+ + "\6\0\12\6\1\105\6\6\1\0\2\6\1\0\4\6"+ + "\1\106\3\6\1\107\11\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\7\6\1\110\12\6\14\0\1\6"+ + "\6\0\14\6\1\111\4\6\1\0\2\6\1\0\1\6"+ + "\1\112\1\113\4\6\1\114\12\6\14\0\1\6\6\0"+ + "\21\6\1\0\1\115\1\6\1\0\7\6\1\116\12\6"+ + "\14\0\1\6\11\0\2\70\4\0\1\70\60\0\5\6"+ + "\1\117\6\6\1\120\4\6\1\0\2\6\1\0\10\6"+ + "\1\121\11\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\1\6\1\122\5\6\1\123\1\6\1\124\10\6"+ + "\14\0\1\6\6\0\21\6\1\0\1\125\1\6\1\0"+ + "\22\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\10\6\1\126\11\6\14\0\1\6\6\0\21\6\1\0"+ + "\1\127\1\6\1\0\2\6\1\130\2\6\1\131\1\132"+ + "\2\6\1\133\5\6\1\134\2\6\14\0\1\6\6\0"+ + "\21\6\1\0\1\135\1\6\1\0\1\6\1\136\4\6"+ + "\1\137\5\6\1\140\5\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\1\6\1\141\16\6\1\142\1\6"+ + "\14\0\1\6\6\0\21\6\1\0\1\143\1\6\1\0"+ + "\2\6\1\144\4\6\1\145\12\6\14\0\1\6\6\0"+ + "\16\6\1\146\2\6\1\0\2\6\1\0\10\6\1\147"+ + "\11\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\7\6\1\150\12\6\14\0\1\6\6\0\12\6\1\151"+ + "\6\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\7\6\1\152\11\6\1\0\2\6\1\0\6\6\1\153"+ + "\13\6\14\0\1\6\6\0\12\6\1\154\6\6\1\0"+ + "\2\6\1\0\1\6\1\155\20\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\2\6\1\156\4\6\1\157"+ + "\1\6\1\160\10\6\14\0\1\6\2\161\1\162\52\161"+ + "\1\162\1\163\13\161\2\164\1\162\53\164\1\165\1\162"+ + "\12\164\67\0\1\4\72\0\1\4\1\0\1\51\1\166"+ + "\1\167\67\51\4\170\1\171\65\170\5\0\1\53\1\0"+ + "\1\53\1\0\2\53\1\0\1\53\1\0\2\53\1\0"+ + "\1\53\1\0\1\53\1\0\1\53\3\0\1\53\17\0"+ + "\1\53\57\0\1\172\3\0\1\173\72\0\1\174\55\0"+ + "\1\175\63\0\1\176\11\0\1\177\6\0\1\200\52\0"+ + "\1\201\16\0\1\202\2\0\1\203\57\0\1\204\55\0"+ + "\2\66\2\64\53\0\1\53\1\0\1\53\1\0\2\53"+ + "\1\0\1\53\1\0\2\53\1\66\1\67\1\64\1\65"+ + "\1\0\1\53\3\0\1\53\17\0\1\53\40\0\2\66"+ + "\55\0\1\53\1\0\1\53\1\0\2\53\1\0\1\53"+ + "\1\0\2\53\1\66\1\67\1\0\1\53\1\0\1\53"+ + "\3\0\1\53\17\0\1\53\31\0\2\70\4\0\1\70"+ + "\4\0\3\66\1\0\2\71\51\0\2\205\4\0\1\205"+ + "\12\0\1\206\44\0\1\53\1\0\1\53\1\0\2\207"+ + "\1\0\1\53\1\0\1\53\1\207\1\0\1\53\1\0"+ + "\1\53\1\0\1\53\3\0\1\53\1\206\16\0\1\53"+ + "\25\0\1\53\1\0\1\53\1\0\2\73\1\0\1\53"+ + "\1\0\1\53\1\73\1\0\1\53\1\0\1\53\1\66"+ + "\1\67\1\66\1\70\1\71\1\72\17\0\1\53\25\0"+ + "\1\53\1\0\1\53\1\0\1\73\1\74\1\0\1\53"+ + "\1\0\1\53\1\74\1\62\1\63\1\64\1\65\1\66"+ + "\1\67\1\66\1\70\1\71\1\72\17\0\1\53\31\0"+ + "\2\75\2\0\3\75\2\62\2\64\3\75\1\0\2\75"+ + "\1\0\1\75\1\0\1\75\41\0\1\53\1\0\1\53"+ + "\1\0\2\76\1\0\1\53\1\75\2\76\1\62\1\63"+ + "\1\64\1\65\1\75\1\76\1\75\1\0\1\75\1\76"+ + "\1\0\1\75\1\0\1\75\13\0\1\53\26\0\21\6"+ + "\1\0\2\6\1\0\1\6\1\141\20\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\2\6\1\210\17\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\4\6"+ + "\1\211\1\212\14\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\2\6\1\213\17\6\14\0\1\6\6\0"+ + "\12\6\1\214\6\6\1\0\2\6\1\0\10\6\1\215"+ + "\2\6\1\216\6\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\10\6\1\217\11\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\11\6\1\220\10\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\11\6\1\221"+ + "\10\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\4\6\1\222\4\6\1\223\10\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\10\6\1\224\11\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\7\6\1\225"+ + "\12\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\11\6\1\226\10\6\14\0\1\6\6\0\14\6\1\227"+ + "\4\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\1\6\1\146\20\6\14\0"+ + "\1\6\6\0\14\6\1\230\1\6\1\231\2\6\1\0"+ + "\2\6\1\0\22\6\14\0\1\6\6\0\12\6\1\232"+ + "\6\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\5\6\1\233\12\6\1\234"+ + "\1\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\4\6\1\211\15\6\14\0\1\6\6\0\12\6\1\235"+ + "\6\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\21\6\1\0\1\236\1\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\7\6\1\237\12\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\5\6"+ + "\1\240\14\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\5\6\1\241\4\6\1\242\7\6\14\0\1\6"+ + "\6\0\20\6\1\141\1\0\2\6\1\0\22\6\14\0"+ + "\1\6\6\0\14\6\1\243\4\6\1\0\2\6\1\0"+ + "\2\6\1\244\17\6\14\0\1\6\6\0\16\6\1\245"+ + "\2\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\1\6\1\246\1\247\17\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\7\6"+ + "\1\250\12\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\12\6\1\251\2\6\1\252\4\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\11\6\1\253\10\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\13\6"+ + "\1\254\6\6\14\0\1\6\6\0\12\6\1\255\6\6"+ + "\1\0\2\6\1\0\14\6\1\146\5\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\1\6\1\256\7\6"+ + "\1\257\10\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\20\6\1\260\1\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\16\6\1\261\3\6\14\0\1\6"+ + "\6\0\21\6\1\0\1\262\1\6\1\0\22\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\17\6\1\146"+ + "\2\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\13\6\1\263\6\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\5\6\1\141\3\6\1\264\10\6\14\0"+ + "\1\6\6\0\14\6\1\265\4\6\1\0\2\6\1\0"+ + "\5\6\1\266\14\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\5\6\1\267\14\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\5\6\1\270\14\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\6\6\1\271"+ + "\13\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\11\6\1\272\10\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\1\273\21\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\7\6\1\274\1\6\1\275\10\6"+ + "\14\0\1\6\6\0\14\6\1\276\4\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\6\0\14\6\1\277\4\6"+ + "\1\0\2\6\1\0\11\6\1\300\10\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\1\6\1\301\20\6"+ + "\14\0\1\6\2\161\1\162\67\161\2\164\1\162\67\164"+ + "\2\0\1\167\67\0\4\170\1\302\65\170\3\0\1\167"+ + "\1\171\131\0\1\303\53\0\1\304\106\0\1\305\52\0"+ + "\1\55\104\0\1\305\4\0\1\306\61\0\1\307\63\0"+ + "\1\310\71\0\1\304\14\0\1\173\43\0\1\311\127\0"+ + "\1\312\53\0\1\313\45\0\2\205\4\0\1\205\4\0"+ + "\3\66\54\0\2\205\4\0\1\205\57\0\1\53\1\0"+ + "\1\53\1\0\2\207\1\0\1\53\1\0\1\53\1\207"+ + "\1\0\1\53\1\0\1\53\1\66\1\67\1\66\2\0"+ + "\1\53\17\0\1\53\26\0\21\6\1\0\2\6\1\0"+ + "\4\6\1\257\15\6\14\0\1\6\6\0\21\6\1\0"+ + "\1\146\1\6\1\0\22\6\14\0\1\6\6\0\7\6"+ + "\1\314\11\6\1\0\2\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\1\6\1\266\20\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\5\6"+ + "\1\217\14\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\4\6\1\315\1\316\14\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\20\6\1\317\1\6\14\0"+ + "\1\6\6\0\20\6\1\146\1\0\2\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\10\6"+ + "\1\320\11\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\11\6\1\321\10\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\7\6\1\322\12\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\12\6\1\266\7\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\315\17\6\14\0\1\6\6\0\21\6\1\0\1\323"+ + "\1\6\1\0\22\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\4\6\1\255\15\6\14\0\1\6\6\0"+ + "\21\6\1\0\1\324\1\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\2\6\1\325\17\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\1\326"+ + "\21\6\14\0\1\6\6\0\21\6\1\0\1\327\1\6"+ + "\1\0\22\6\14\0\1\6\6\0\14\6\1\330\4\6"+ + "\1\0\2\6\1\0\7\6\1\250\12\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\13\6\1\146\6\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\331\17\6\14\0\1\6\6\0\14\6\1\266\4\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\2\6\1\332\4\6\1\333\12\6"+ + "\14\0\1\6\6\0\12\6\1\334\6\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\11\6\1\335\10\6\14\0\1\6\6\0\21\6"+ + "\1\0\1\336\1\6\1\0\22\6\14\0\1\6\6\0"+ + "\14\6\1\337\4\6\1\0\2\6\1\0\22\6\14\0"+ + "\1\6\6\0\21\6\1\0\1\340\1\6\1\0\22\6"+ + "\14\0\1\6\6\0\12\6\1\341\6\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\5\6\1\342\14\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\1\6\1\315\20\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\10\6\1\343\11\6"+ + "\14\0\1\6\6\0\21\6\1\0\1\344\1\6\1\0"+ + "\22\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\5\6\1\212\14\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\20\6\1\345\1\6\14\0\1\6\6\0"+ + "\21\6\1\0\1\346\1\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\1\347\1\6\1\0\7\6\1\143"+ + "\12\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\4\6\1\146\15\6\14\0\1\6\6\0\21\6\1\0"+ + "\1\350\1\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\1\351\1\6\1\0\22\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\1\6\1\352\20\6\14\0"+ + "\1\6\6\0\21\6\1\0\1\353\1\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\10\6"+ + "\1\354\11\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\11\6\1\355\10\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\7\6\1\146\12\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\2\6\1\356\17\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\357\17\6\14\0\1\6\6\0\14\6\1\211\4\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\14\6"+ + "\1\360\4\6\1\0\2\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\5\6\1\361\14\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\21\6"+ + "\1\362\14\0\1\6\6\0\12\6\1\211\6\6\1\0"+ + "\2\6\1\0\22\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\2\6\1\363\17\6\14\0\1\6\6\0"+ + "\20\6\1\266\1\0\2\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\5\6\1\364\14\6"+ + "\14\0\1\6\3\170\1\167\1\302\65\170\43\0\1\365"+ + "\56\0\1\306\71\0\1\366\65\0\1\366\107\0\1\367"+ + "\73\0\1\306\47\0\1\370\111\0\1\371\74\0\1\372"+ + "\32\0\21\6\1\0\2\6\1\0\6\6\1\146\13\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\5\6"+ + "\1\266\14\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\11\6\1\373\10\6\14\0\1\6\6\0\14\6"+ + "\1\374\4\6\1\0\2\6\1\0\22\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\12\6\1\146\7\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\12\6"+ + "\1\251\7\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\10\6\1\266\11\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\10\6\1\220\11\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\5\6\1\211\14\6"+ + "\14\0\1\6\6\0\12\6\1\375\6\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\6\0\14\6\1\376\4\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\1\6\1\322\20\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\11\6\1\377\10\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\3\6"+ + "\1\146\16\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\10\6\1\u0100\11\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\1\6\1\374\20\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\1\6\1\u0101\20\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\4\6"+ + "\1\u0102\15\6\14\0\1\6\6\0\7\6\1\u0103\11\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\1\220\1\6\1\0\22\6\14\0\1\6\6\0"+ + "\7\6\1\u0104\11\6\1\0\2\6\1\0\22\6\14\0"+ + "\1\6\6\0\7\6\1\315\11\6\1\0\2\6\1\0"+ + "\22\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\11\6\1\u0105\10\6\14\0\1\6\6\0\21\6\1\0"+ + "\1\300\1\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\7\6\1\u0106\12\6\14\0\1\6"+ + "\6\0\14\6\1\u0107\4\6\1\0\2\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\220\17\6\14\0\1\6\6\0\20\6\1\u0108\1\0"+ + "\2\6\1\0\10\6\1\u0109\1\220\10\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\22\6\14\0\1\374"+ + "\6\0\21\6\1\0\2\6\1\0\2\6\1\u010a\17\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\4\6"+ + "\1\u010b\15\6\14\0\1\6\6\0\14\6\1\265\4\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\10\6\1\211\11\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\1\272\21\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\1\6\1\u010c"+ + "\20\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\11\6\1\u010d\10\6\14\0\1\6\6\0\21\6\1\0"+ + "\1\u010e\1\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\2\6\1\u010f\17\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\5\6\1\u0110\14\6"+ + "\14\0\1\6\6\0\12\6\1\u0111\6\6\1\0\2\6"+ + "\1\0\22\6\14\0\1\6\45\0\1\366\60\0\1\366"+ + "\55\0\1\u0112\105\0\1\u0113\103\0\1\u0114\31\0\21\6"+ + "\1\0\2\6\1\0\10\6\1\276\11\6\14\0\1\6"+ + "\6\0\14\6\1\u0115\4\6\1\0\2\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\1\266\1\6\1\0"+ + "\22\6\14\0\1\6\6\0\7\6\1\u0116\11\6\1\0"+ + "\2\6\1\0\22\6\14\0\1\6\6\0\20\6\1\374"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\10\6\1\146\11\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\5\6\1\u0117\14\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\5\6"+ + "\1\u0118\14\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\2\6\1\u0119\17\6\14\0\1\6\6\0\7\6"+ + "\1\u011a\11\6\1\0\2\6\1\0\22\6\14\0\1\6"+ + "\6\0\16\6\1\146\2\6\1\0\2\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\324\17\6\14\0\1\6\6\0\21\6\1\0\1\u0106"+ + "\1\6\1\0\22\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\2\6\1\u011b\17\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\5\6\1\u011c\14\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\20\6\1\u011d"+ + "\1\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\16\6\1\315\3\6\14\0\1\6\6\0\7\6\1\266"+ + "\11\6\1\0\2\6\1\0\22\6\14\0\1\6\6\0"+ + "\7\6\1\u011e\11\6\1\0\2\6\1\0\22\6\14\0"+ + "\1\6\6\0\21\6\1\0\2\6\1\0\5\6\1\376"+ + "\14\6\14\0\1\6\6\0\21\6\1\0\2\6\1\0"+ + "\11\6\1\326\10\6\14\0\1\6\6\0\21\6\1\0"+ + "\2\6\1\0\2\6\1\u011f\17\6\14\0\1\6\26\0"+ + "\1\305\103\0\1\366\66\0\1\366\42\0\21\6\1\0"+ + "\2\6\1\0\5\6\1\146\14\6\14\0\1\6\6\0"+ + "\21\6\1\0\2\6\1\0\11\6\1\315\10\6\14\0"+ + "\1\6\6\0\21\6\1\0\1\213\1\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\2\6"+ + "\1\u0120\17\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\4\6\1\u0115\15\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\16\6\1\340\3\6\14\0\1\6"+ + "\6\0\21\6\1\0\2\6\1\0\13\6\1\211\6\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\7\6"+ + "\1\333\12\6\14\0\1\6\6\0\21\6\1\0\2\6"+ + "\1\0\2\6\1\u0121\17\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\5\6\1\343\14\6\14\0\1\6"+ + "\6\0\14\6\1\146\4\6\1\0\2\6\1\0\22\6"+ + "\14\0\1\6\6\0\21\6\1\0\2\6\1\0\10\6"+ + "\1\u0122\11\6\14\0\1\6\6\0\7\6\1\211\11\6"+ + "\1\0\2\6\1\0\22\6\14\0\1\6\6\0\21\6"+ + "\1\0\2\6\1\0\14\6\1\146\5\6\14\0\1\6"; + + private static int [] zzUnpackTrans() { + int [] result = new int[15718]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\1\1\1\11\34\1\6\11\3\1\1\0"+ + "\1\1\6\0\4\1\1\11\2\1\1\0\67\1\1\0"+ + "\1\11\3\0\1\1\1\11\11\0\1\1\3\0\1\1"+ + "\1\0\73\1\12\0\51\1\1\0\1\11\4\0\27\1"+ + "\3\0\16\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[290]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + public CppLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public CppLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public CppLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1778) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 16: + { return token(TokenType.TYPE2); + } + case 17: break; + case 13: + { return token(TokenType.KEYWORD); + } + case 18: break; + case 8: + { return token(TokenType.OPERATOR, CURLY); + } + case 19: break; + case 10: + { return token(TokenType.OPERATOR, BRACKET); + } + case 20: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 21: break; + case 7: + { return token(TokenType.OPERATOR, -PARAN); + } + case 22: break; + case 15: + { return token(TokenType.KEYWORD2); + } + case 23: break; + case 4: + { return token(TokenType.IDENTIFIER); + } + case 24: break; + case 6: + { return token(TokenType.OPERATOR, PARAN); + } + case 25: break; + case 14: + { return token(TokenType.STRING); + } + case 26: break; + case 12: + { return token(TokenType.COMMENT); + } + case 27: break; + case 11: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 28: break; + case 9: + { return token(TokenType.OPERATOR, -CURLY); + } + case 29: break; + case 5: + { return token(TokenType.NUMBER); + } + case 30: break; + case 3: + { return token(TokenType.TYPE); + } + case 31: break; + case 1: + { + } + case 32: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/DOSBatchLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/DOSBatchLexer.java new file mode 100644 index 000000000..9f089216a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/DOSBatchLexer.java @@ -0,0 +1,914 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/dosbatch.flex + */ +public final class DOSBatchLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int ECHO_TEXT = 2; + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\27\1\0\1\5\2\0\1\4\16\27\10\0\1\26\1\25\12\0"+ + "\12\41\1\36\5\0\1\6\1\13\1\33\1\12\1\23\1\2\1\17"+ + "\1\7\1\31\1\16\1\37\1\34\1\14\1\3\1\32\1\10\1\21"+ + "\1\37\1\1\1\20\1\11\1\35\1\24\1\37\1\15\1\22\1\37"+ + "\4\0\1\40\1\0\1\13\1\33\1\12\1\23\1\2\1\17\1\7"+ + "\1\31\1\16\1\37\1\34\1\14\1\3\1\32\1\10\1\21\1\37"+ + "\1\1\1\20\1\11\1\35\1\24\1\37\1\15\1\22\1\37\4\0"+ + "\41\27\2\0\4\26\4\0\1\26\2\0\1\27\7\0\1\26\4\0"+ + "\1\26\5\0\27\26\1\0\37\26\1\0\u013f\26\31\0\162\26\4\0"+ + "\14\26\16\0\5\26\11\0\1\26\21\0\130\27\5\0\23\27\12\0"+ + "\1\26\13\0\1\26\1\0\3\26\1\0\1\26\1\0\24\26\1\0"+ + "\54\26\1\0\46\26\1\0\5\26\4\0\202\26\1\0\4\27\3\0"+ + "\105\26\1\0\46\26\2\0\2\26\6\0\20\26\41\0\46\26\2\0"+ + "\1\26\7\0\47\26\11\0\21\27\1\0\27\27\1\0\3\27\1\0"+ + "\1\27\1\0\2\27\1\0\1\27\13\0\33\26\5\0\3\26\15\0"+ + "\4\27\14\0\6\27\13\0\32\26\5\0\13\26\16\27\7\0\12\30"+ + "\4\0\2\26\1\27\143\26\1\0\1\26\10\27\1\0\6\27\2\26"+ + "\2\27\1\0\4\27\2\26\12\30\3\26\2\0\1\26\17\0\1\27"+ + "\1\26\1\27\36\26\33\27\2\0\3\26\60\0\46\26\13\27\1\26"+ + "\u014f\0\3\27\66\26\2\0\1\27\1\26\20\27\2\0\1\26\4\27"+ + "\3\0\12\26\2\27\2\0\12\30\21\0\3\27\1\0\10\26\2\0"+ + "\2\26\2\0\26\26\1\0\7\26\1\0\1\26\3\0\4\26\2\0"+ + "\1\27\1\26\7\27\2\0\2\27\2\0\3\27\11\0\1\27\4\0"+ + "\2\26\1\0\3\26\2\27\2\0\12\30\4\26\15\0\3\27\1\0"+ + "\6\26\4\0\2\26\2\0\26\26\1\0\7\26\1\0\2\26\1\0"+ + "\2\26\1\0\2\26\2\0\1\27\1\0\5\27\4\0\2\27\2\0"+ + "\3\27\13\0\4\26\1\0\1\26\7\0\12\30\2\27\3\26\14\0"+ + "\3\27\1\0\11\26\1\0\3\26\1\0\26\26\1\0\7\26\1\0"+ + "\2\26\1\0\5\26\2\0\1\27\1\26\10\27\1\0\3\27\1\0"+ + "\3\27\2\0\1\26\17\0\2\26\2\27\2\0\12\30\1\0\1\26"+ + "\17\0\3\27\1\0\10\26\2\0\2\26\2\0\26\26\1\0\7\26"+ + "\1\0\2\26\1\0\5\26\2\0\1\27\1\26\6\27\3\0\2\27"+ + "\2\0\3\27\10\0\2\27\4\0\2\26\1\0\3\26\4\0\12\30"+ + "\1\0\1\26\20\0\1\27\1\26\1\0\6\26\3\0\3\26\1\0"+ + "\4\26\3\0\2\26\1\0\1\26\1\0\2\26\3\0\2\26\3\0"+ + "\3\26\3\0\10\26\1\0\3\26\4\0\5\27\3\0\3\27\1\0"+ + "\4\27\11\0\1\27\17\0\11\30\11\0\1\26\7\0\3\27\1\0"+ + "\10\26\1\0\3\26\1\0\27\26\1\0\12\26\1\0\5\26\4\0"+ + "\7\27\1\0\3\27\1\0\4\27\7\0\2\27\11\0\2\26\4\0"+ + "\12\30\22\0\2\27\1\0\10\26\1\0\3\26\1\0\27\26\1\0"+ + "\12\26\1\0\5\26\2\0\1\27\1\26\7\27\1\0\3\27\1\0"+ + "\4\27\7\0\2\27\7\0\1\26\1\0\2\26\4\0\12\30\22\0"+ + "\2\27\1\0\10\26\1\0\3\26\1\0\27\26\1\0\20\26\4\0"+ + "\6\27\2\0\3\27\1\0\4\27\11\0\1\27\10\0\2\26\4\0"+ + "\12\30\22\0\2\27\1\0\22\26\3\0\30\26\1\0\11\26\1\0"+ + "\1\26\2\0\7\26\3\0\1\27\4\0\6\27\1\0\1\27\1\0"+ + "\10\27\22\0\2\27\15\0\60\26\1\27\2\26\7\27\4\0\10\26"+ + "\10\27\1\0\12\30\47\0\2\26\1\0\1\26\2\0\2\26\1\0"+ + "\1\26\2\0\1\26\6\0\4\26\1\0\7\26\1\0\3\26\1\0"+ + "\1\26\1\0\1\26\2\0\2\26\1\0\4\26\1\27\2\26\6\27"+ + "\1\0\2\27\1\26\2\0\5\26\1\0\1\26\1\0\6\27\2\0"+ + "\12\30\2\0\2\26\42\0\1\26\27\0\2\27\6\0\12\30\13\0"+ + "\1\27\1\0\1\27\1\0\1\27\4\0\2\27\10\26\1\0\42\26"+ + "\6\0\24\27\1\0\2\27\4\26\4\0\10\27\1\0\44\27\11\0"+ + "\1\27\71\0\42\26\1\0\5\26\1\0\2\26\1\0\7\27\3\0"+ + "\4\27\6\0\12\30\6\0\6\26\4\27\106\0\46\26\12\0\51\26"+ + "\7\0\132\26\5\0\104\26\5\0\122\26\6\0\7\26\1\0\77\26"+ + "\1\0\1\26\1\0\4\26\2\0\7\26\1\0\1\26\1\0\4\26"+ + "\2\0\47\26\1\0\1\26\1\0\4\26\2\0\37\26\1\0\1\26"+ + "\1\0\4\26\2\0\7\26\1\0\1\26\1\0\4\26\2\0\7\26"+ + "\1\0\7\26\1\0\27\26\1\0\37\26\1\0\1\26\1\0\4\26"+ + "\2\0\7\26\1\0\47\26\1\0\23\26\16\0\11\30\56\0\125\26"+ + "\14\0\u026c\26\2\0\10\26\12\0\32\26\5\0\113\26\3\0\3\26"+ + "\17\0\15\26\1\0\4\26\3\27\13\0\22\26\3\27\13\0\22\26"+ + "\2\27\14\0\15\26\1\0\3\26\1\0\2\27\14\0\64\26\40\27"+ + "\3\0\1\26\3\0\2\26\1\27\2\0\12\30\41\0\3\27\2\0"+ + "\12\30\6\0\130\26\10\0\51\26\1\27\126\0\35\26\3\0\14\27"+ + "\4\0\14\27\12\0\12\30\36\26\2\0\5\26\u038b\0\154\26\224\0"+ + "\234\26\4\0\132\26\6\0\26\26\2\0\6\26\2\0\46\26\2\0"+ + "\6\26\2\0\10\26\1\0\1\26\1\0\1\26\1\0\1\26\1\0"+ + "\37\26\2\0\65\26\1\0\7\26\1\0\1\26\3\0\3\26\1\0"+ + "\7\26\3\0\4\26\2\0\6\26\4\0\15\26\5\0\3\26\1\0"+ + "\7\26\17\0\4\27\32\0\5\27\20\0\2\26\23\0\1\26\13\0"+ + "\4\27\6\0\6\27\1\0\1\26\15\0\1\26\40\0\22\26\36\0"+ + "\15\27\4\0\1\27\3\0\6\27\27\0\1\26\4\0\1\26\2\0"+ + "\12\26\1\0\1\26\3\0\5\26\6\0\1\26\1\0\1\26\1\0"+ + "\1\26\1\0\4\26\1\0\3\26\1\0\7\26\3\0\3\26\5\0"+ + "\5\26\26\0\44\26\u0e81\0\3\26\31\0\11\26\6\27\1\0\5\26"+ + "\2\0\5\26\4\0\126\26\2\0\2\27\2\0\3\26\1\0\137\26"+ + "\5\0\50\26\4\0\136\26\21\0\30\26\70\0\20\26\u0200\0\u19b6\26"+ + "\112\0\u51a6\26\132\0\u048d\26\u0773\0\u2ba4\26\u215c\0\u012e\26\2\0\73\26"+ + "\225\0\7\26\14\0\5\26\5\0\1\26\1\27\12\26\1\0\15\26"+ + "\1\0\5\26\1\0\1\26\1\0\2\26\1\0\2\26\1\0\154\26"+ + "\41\0\u016b\26\22\0\100\26\2\0\66\26\50\0\15\26\3\0\20\27"+ + "\20\0\4\27\17\0\2\26\30\0\3\26\31\0\1\26\6\0\5\26"+ + "\1\0\207\26\2\0\1\27\4\0\1\26\13\0\12\30\7\0\32\26"+ + "\4\0\1\26\1\0\32\26\12\0\132\26\3\0\6\26\2\0\6\26"+ + "\2\0\6\26\2\0\3\26\3\0\2\26\3\0\2\26\22\0\3\27"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\1\1\1\2\3\3\1\2\1\4\15\3\1\2"+ + "\3\3\1\2\2\1\1\5\1\1\2\3\1\4\20\3"+ + "\1\4\25\3\1\0\1\6\3\3\1\7\1\1\1\6"+ + "\1\4\3\3\1\4\25\3\1\4\1\3\1\4\11\3"+ + "\1\4\1\10\2\3\1\10\1\11\1\3\2\11\6\3"+ + "\1\12\2\3\1\4\7\3\1\4\24\3"; + + private static int [] zzUnpackAction() { + int [] result = new int[164]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\42\0\104\0\146\0\210\0\252\0\314\0\104"+ + "\0\356\0\u0110\0\u0132\0\u0154\0\u0176\0\u0198\0\u01ba\0\u01dc"+ + "\0\u01fe\0\u0220\0\u0242\0\u0264\0\u0286\0\u02a8\0\u02ca\0\u02ec"+ + "\0\u030e\0\u0330\0\u0352\0\u0374\0\104\0\u0396\0\u03b8\0\u03da"+ + "\0\u0110\0\u03fc\0\u041e\0\u0440\0\u0462\0\u0484\0\u04a6\0\u04c8"+ + "\0\u04ea\0\u050c\0\u052e\0\u0550\0\u0572\0\u0594\0\u05b6\0\u05d8"+ + "\0\u05fa\0\u061c\0\u063e\0\u0660\0\u0682\0\u06a4\0\u06c6\0\u06e8"+ + "\0\u070a\0\u072c\0\u074e\0\u0770\0\u0792\0\u07b4\0\u07d6\0\u07f8"+ + "\0\u081a\0\u083c\0\u085e\0\u0880\0\u08a2\0\u08c4\0\u08e6\0\u0908"+ + "\0\u092a\0\u094c\0\u096e\0\u0990\0\u09b2\0\u09d4\0\u09f6\0\u0a18"+ + "\0\u0a3a\0\u0a5c\0\u0a7e\0\u0aa0\0\u0ac2\0\u0ae4\0\u0b06\0\u0b28"+ + "\0\u0b4a\0\u0b6c\0\u0b8e\0\u0bb0\0\u0bd2\0\u0bf4\0\u0c16\0\u0c38"+ + "\0\u0c5a\0\u0c7c\0\u0c9e\0\u0cc0\0\u0ce2\0\u0d04\0\u0d26\0\u0d48"+ + "\0\u0d6a\0\u0d8c\0\u0dae\0\u0b6c\0\u0dd0\0\u0df2\0\u0e14\0\u0e36"+ + "\0\u0e58\0\u0e7a\0\u0e9c\0\u0ebe\0\u0ee0\0\u0f02\0\104\0\u0f24"+ + "\0\u0f46\0\u0352\0\u0f68\0\u0a18\0\u0f8a\0\104\0\u0fac\0\u0fce"+ + "\0\u0ff0\0\u1012\0\u1034\0\u1056\0\u0110\0\u1078\0\u109a\0\u10bc"+ + "\0\u10de\0\u1100\0\u1122\0\u1144\0\u1166\0\u1188\0\u11aa\0\u11cc"+ + "\0\u11ee\0\u1210\0\u1232\0\u1254\0\u1276\0\u1298\0\u12ba\0\u12dc"+ + "\0\u12fe\0\u1320\0\u1342\0\u1364\0\u1386\0\u13a8\0\u13ca\0\u13ec"+ + "\0\u140e\0\u1430\0\u1452\0\u1474"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[164]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\3\1\4\1\5\1\6\1\7\1\3\1\10\1\11"+ + "\1\12\1\13\1\14\1\15\1\16\1\17\1\20\1\21"+ + "\1\22\1\23\1\12\1\24\1\25\1\26\3\12\1\27"+ + "\1\12\1\30\1\31\1\12\1\32\3\12\4\33\1\34"+ + "\1\35\17\33\1\36\14\33\43\0\1\12\1\37\1\40"+ + "\3\0\14\12\1\41\1\12\1\0\10\12\1\0\3\12"+ + "\1\0\1\42\2\12\3\0\3\12\1\43\1\12\1\44"+ + "\1\45\7\12\1\0\4\12\1\46\3\12\1\0\3\12"+ + "\1\0\3\12\3\0\1\12\1\47\12\12\1\41\1\12"+ + "\1\0\6\12\1\40\1\12\1\0\3\12\5\0\1\3"+ + "\35\0\1\50\2\12\3\0\1\12\1\51\14\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\16\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\52\2\12\3\0\7\12"+ + "\1\53\3\12\1\54\2\12\1\0\10\12\1\0\3\12"+ + "\1\0\2\12\1\55\3\0\1\12\1\56\2\12\1\57"+ + "\1\60\6\12\1\41\1\12\1\0\3\12\1\61\4\12"+ + "\1\0\3\12\1\0\3\12\3\0\2\12\1\62\6\12"+ + "\1\63\1\64\3\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\4\12\1\65\11\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\3\12\1\66\12\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\10\12\1\41"+ + "\5\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\1\12\1\67\1\70\1\41\3\12\1\71\6\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\12\1\72\1\12\3\0"+ + "\1\12\1\73\1\74\13\12\1\0\3\12\1\75\3\12"+ + "\1\76\1\0\3\12\1\0\1\77\2\12\3\0\1\12"+ + "\1\100\2\12\1\101\11\12\1\0\7\12\1\102\1\0"+ + "\3\12\1\0\1\12\1\103\1\12\3\0\1\12\1\104"+ + "\2\12\1\105\2\12\1\106\6\12\1\0\10\12\1\0"+ + "\3\12\1\0\1\12\1\107\1\12\3\0\1\12\1\103"+ + "\14\12\1\0\10\12\1\0\3\12\1\0\3\110\3\0"+ + "\16\110\1\0\1\110\1\0\1\111\5\110\1\0\2\110"+ + "\1\111\1\0\1\12\1\112\1\12\3\0\16\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\113\2\12\3\0\16\12"+ + "\1\0\10\12\1\0\3\12\1\0\1\12\1\114\1\12"+ + "\3\0\16\12\1\0\10\12\1\0\3\12\1\0\3\115"+ + "\3\0\16\115\4\0\5\115\1\0\1\115\2\0\5\33"+ + "\1\0\41\33\1\35\35\33\3\116\1\33\1\0\1\33"+ + "\16\116\1\33\1\116\1\33\1\117\5\116\1\33\2\116"+ + "\1\117\1\0\2\12\1\120\3\0\3\12\1\121\5\12"+ + "\1\122\1\123\3\12\1\0\4\12\1\124\3\12\1\0"+ + "\3\12\1\0\3\12\3\0\14\12\1\125\1\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\126\2\12\3\0\4\12"+ + "\1\44\11\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\16\12\1\0\3\12\1\127\4\12\1\0\3\12"+ + "\1\0\3\12\3\0\11\12\1\130\4\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\7\12\1\131\6\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\14\12"+ + "\1\132\1\12\1\0\10\12\1\0\3\12\1\0\1\130"+ + "\2\12\3\0\14\12\2\130\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\4\12\1\133\11\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\2\12\1\134\13\12"+ + "\1\0\10\12\1\0\3\12\1\0\1\12\1\130\1\12"+ + "\3\0\16\12\1\0\10\12\1\0\3\12\1\0\2\12"+ + "\1\130\3\0\2\12\1\135\13\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\12\12\1\130\3\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\14\12\1\41"+ + "\1\12\1\0\10\12\1\0\3\12\1\0\2\12\1\136"+ + "\3\0\5\12\1\137\4\12\1\140\3\12\1\0\4\12"+ + "\1\141\3\12\1\0\3\12\1\0\3\12\3\0\3\12"+ + "\1\142\1\12\1\103\10\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\11\12\1\41\4\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\3\12\1\143\10\12"+ + "\1\125\1\12\1\0\6\12\1\144\1\12\1\0\3\12"+ + "\1\0\3\12\3\0\2\12\1\145\13\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\11\12\1\146\4\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\12\12"+ + "\1\147\3\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\16\12\1\0\5\12\1\150\2\12\1\0\3\12"+ + "\1\0\3\12\3\0\1\12\1\151\14\12\1\0\10\12"+ + "\1\0\3\12\1\0\1\152\2\12\3\0\16\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\13\12\1\54"+ + "\2\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\16\12\1\0\4\12\1\153\3\12\1\0\3\12\1\0"+ + "\3\12\3\0\2\12\1\154\13\12\1\0\10\12\1\0"+ + "\3\12\1\0\1\155\2\12\3\0\16\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\4\12\1\73\11\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\7\12"+ + "\1\156\6\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\16\12\1\0\5\12\1\157\2\12\1\0\3\12"+ + "\1\0\3\12\3\0\1\12\1\160\5\12\1\161\6\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\12\12"+ + "\1\55\3\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\2\12\1\162\13\12\1\0\7\12\1\44\1\0"+ + "\3\12\1\0\3\12\3\0\11\12\1\163\4\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\5\12\1\41"+ + "\10\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\11\12\1\164\4\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\2\12\1\130\13\12\1\0\10\12\1\0"+ + "\3\12\1\0\1\41\2\12\3\0\11\12\1\165\4\12"+ + "\1\0\10\12\1\0\3\12\1\0\1\166\2\12\3\0"+ + "\16\12\1\0\10\12\1\0\3\12\1\0\3\110\3\0"+ + "\16\110\1\167\10\110\1\0\3\110\30\0\1\111\10\0"+ + "\1\111\1\0\3\12\3\0\5\12\1\143\10\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\12\1\170\1\12\3\0"+ + "\16\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\13\12\1\171\2\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\115\3\0\16\115\4\0\5\115\1\0\3\115\1\33"+ + "\3\116\1\33\1\0\1\33\16\116\1\172\10\116\1\33"+ + "\3\116\5\33\1\0\22\33\1\117\10\33\1\117\1\173"+ + "\3\174\1\175\1\176\1\173\16\174\1\173\10\174\1\173"+ + "\3\174\1\0\3\12\3\0\1\12\1\177\14\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\2\12\1\200"+ + "\13\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\5\12\1\201\10\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\4\12\1\202\11\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\7\12\1\203\6\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\1\12\1\204"+ + "\14\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\1\12\1\205\14\12\1\0\10\12\1\0\3\12\1\0"+ + "\1\12\1\41\1\12\3\0\16\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\2\12\1\41\6\12\1\155"+ + "\4\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\5\12\1\206\10\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\10\12\1\207\5\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\1\12\1\41\14\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\5\12\1\130"+ + "\10\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\12\12\1\210\3\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\1\12\1\203\14\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\13\12\1\41\2\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\15\12\1\211"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\5\12"+ + "\1\60\10\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\12\12\1\41\3\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\14\12\1\212\1\12\1\0\4\12"+ + "\1\213\3\12\1\0\3\12\1\0\1\214\2\12\3\0"+ + "\16\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\1\12\1\215\14\12\1\0\10\12\1\0\3\12\1\0"+ + "\1\12\1\216\1\12\3\0\16\12\1\0\10\12\1\0"+ + "\3\12\1\0\1\12\1\103\1\12\3\0\16\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\12\12\1\140"+ + "\3\12\1\0\10\12\1\0\3\12\1\0\2\12\1\217"+ + "\3\0\16\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\14\12\1\220\1\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\2\12\1\41\13\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\10\12\1\155\5\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\11\12"+ + "\1\155\4\12\1\0\10\12\1\0\3\12\1\0\2\12"+ + "\1\221\3\0\16\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\16\12\1\0\4\12\1\155\3\12\1\0"+ + "\3\12\1\0\3\12\3\0\16\12\1\0\3\12\1\41"+ + "\4\12\1\0\3\12\1\0\3\12\3\0\16\12\1\0"+ + "\3\12\1\55\4\12\1\0\3\12\1\0\3\12\3\0"+ + "\16\12\1\0\6\12\1\222\1\12\1\0\3\12\1\0"+ + "\3\12\3\0\16\12\1\0\6\12\1\223\1\12\1\0"+ + "\3\12\1\0\3\12\3\0\7\12\1\224\6\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\4\12\1\225"+ + "\11\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\16\12\1\0\5\12\1\41\2\12\1\0\3\12\4\173"+ + "\1\175\1\176\34\173\5\0\1\176\35\0\3\12\3\0"+ + "\15\12\1\226\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\1\12\1\227\14\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\4\12\1\230\11\12\1\0\10\12"+ + "\1\0\3\12\1\0\2\12\1\130\3\0\16\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\41\2\12\3\0\16\12"+ + "\1\0\10\12\1\0\3\12\1\0\1\231\2\12\3\0"+ + "\16\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\1\12\1\232\14\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\2\12\1\233\13\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\4\12\1\234\11\12\1\0"+ + "\10\12\1\0\3\12\1\0\1\12\1\73\1\12\3\0"+ + "\16\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\11\12\1\225\4\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\2\12\1\235\13\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\7\12\1\171\6\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\3\12\1\41"+ + "\12\12\1\0\10\12\1\0\3\12\1\0\3\12\3\0"+ + "\16\12\1\0\4\12\1\55\3\12\1\0\3\12\1\0"+ + "\3\12\3\0\4\12\1\155\11\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\11\12\1\236\4\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\12\12\1\155"+ + "\3\12\1\0\10\12\1\0\3\12\1\0\1\12\1\140"+ + "\1\12\3\0\16\12\1\0\10\12\1\0\3\12\1\0"+ + "\3\12\3\0\3\12\1\237\12\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\10\12\1\140\5\12\1\0"+ + "\10\12\1\0\3\12\1\0\3\12\3\0\16\12\1\0"+ + "\6\12\1\41\1\12\1\0\3\12\1\0\1\12\1\203"+ + "\1\12\3\0\16\12\1\0\10\12\1\0\3\12\1\0"+ + "\1\130\2\12\3\0\16\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\3\12\1\130\12\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\5\12\1\240\10\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\3\12"+ + "\1\241\12\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\4\12\1\242\11\12\1\0\10\12\1\0\3\12"+ + "\1\0\3\12\3\0\3\12\1\155\12\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\10\12\1\60\5\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\2\12"+ + "\1\203\13\12\1\0\10\12\1\0\3\12\1\0\3\12"+ + "\3\0\1\12\1\243\14\12\1\0\10\12\1\0\3\12"+ + "\1\0\1\12\1\244\1\12\3\0\16\12\1\0\10\12"+ + "\1\0\3\12\1\0\3\12\3\0\4\12\1\103\11\12"+ + "\1\0\10\12\1\0\3\12\1\0\3\12\3\0\16\12"+ + "\1\0\5\12\1\103\2\12\1\0\3\12\1\0\2\12"+ + "\1\143\3\0\12\12\1\140\3\12\1\0\10\12\1\0"+ + "\3\12\1\0\3\12\3\0\15\12\1\150\1\0\10\12"+ + "\1\0\3\12"; + + private static int [] zzUnpackTrans() { + int [] result = new int[5270]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\1\1\11\4\1\1\11\24\1\1\11\52\1"+ + "\1\0\56\1\1\11\6\1\1\11\46\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[164]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public DOSBatchLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public DOSBatchLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public DOSBatchLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1762) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 5: + { yybegin(YYINITIAL) ; + } + case 11: break; + case 8: + { return token(TokenType.STRING2); + } + case 12: break; + case 10: + { yybegin(ECHO_TEXT); + return token(TokenType.KEYWORD); + } + case 13: break; + case 4: + { return token(TokenType.KEYWORD); + } + case 14: break; + case 7: + { return token(TokenType.TYPE3); + } + case 15: break; + case 6: + { return token(TokenType.KEYWORD2); + } + case 16: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 17: break; + case 1: + { return token(TokenType.STRING); + } + case 18: break; + case 9: + { return token(TokenType.COMMENT); + } + case 19: break; + case 2: + { /* skip */ + } + case 20: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java new file mode 100644 index 000000000..c85450b06 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java @@ -0,0 +1,740 @@ +/* The following code was generated by JFlex 1.4.3 on 18.8.10 12:21 */ + +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 18.8.10 12:21 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm3.flex + */ +public final class Flasm3Lexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int PARAMETERS = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\11\1\3\1\2\1\0\1\3\1\1\16\11\4\0\1\3\1\0"+ + "\1\26\1\0\1\10\6\0\1\22\1\0\1\16\1\17\1\0\1\15"+ + "\3\15\4\23\2\6\1\14\1\24\5\0\4\10\1\20\25\10\1\5"+ + "\1\25\1\7\1\0\1\13\1\0\4\12\1\21\7\12\1\4\15\12"+ + "\4\0\41\11\2\0\4\10\4\0\1\10\2\0\1\11\7\0\1\10"+ + "\4\0\1\10\5\0\27\10\1\0\37\10\1\0\u013f\10\31\0\162\10"+ + "\4\0\14\10\16\0\5\10\11\0\1\10\21\0\130\11\5\0\23\11"+ + "\12\0\1\10\13\0\1\10\1\0\3\10\1\0\1\10\1\0\24\10"+ + "\1\0\54\10\1\0\46\10\1\0\5\10\4\0\202\10\1\0\4\11"+ + "\3\0\105\10\1\0\46\10\2\0\2\10\6\0\20\10\41\0\46\10"+ + "\2\0\1\10\7\0\47\10\11\0\21\11\1\0\27\11\1\0\3\11"+ + "\1\0\1\11\1\0\2\11\1\0\1\11\13\0\33\10\5\0\3\10"+ + "\15\0\4\11\14\0\6\11\13\0\32\10\5\0\13\10\16\11\7\0"+ + "\12\11\4\0\2\10\1\11\143\10\1\0\1\10\10\11\1\0\6\11"+ + "\2\10\2\11\1\0\4\11\2\10\12\11\3\10\2\0\1\10\17\0"+ + "\1\11\1\10\1\11\36\10\33\11\2\0\3\10\60\0\46\10\13\11"+ + "\1\10\u014f\0\3\11\66\10\2\0\1\11\1\10\20\11\2\0\1\10"+ + "\4\11\3\0\12\10\2\11\2\0\12\11\21\0\3\11\1\0\10\10"+ + "\2\0\2\10\2\0\26\10\1\0\7\10\1\0\1\10\3\0\4\10"+ + "\2\0\1\11\1\10\7\11\2\0\2\11\2\0\3\11\11\0\1\11"+ + "\4\0\2\10\1\0\3\10\2\11\2\0\12\11\4\10\15\0\3\11"+ + "\1\0\6\10\4\0\2\10\2\0\26\10\1\0\7\10\1\0\2\10"+ + "\1\0\2\10\1\0\2\10\2\0\1\11\1\0\5\11\4\0\2\11"+ + "\2\0\3\11\13\0\4\10\1\0\1\10\7\0\14\11\3\10\14\0"+ + "\3\11\1\0\11\10\1\0\3\10\1\0\26\10\1\0\7\10\1\0"+ + "\2\10\1\0\5\10\2\0\1\11\1\10\10\11\1\0\3\11\1\0"+ + "\3\11\2\0\1\10\17\0\2\10\2\11\2\0\12\11\1\0\1\10"+ + "\17\0\3\11\1\0\10\10\2\0\2\10\2\0\26\10\1\0\7\10"+ + "\1\0\2\10\1\0\5\10\2\0\1\11\1\10\6\11\3\0\2\11"+ + "\2\0\3\11\10\0\2\11\4\0\2\10\1\0\3\10\4\0\12\11"+ + "\1\0\1\10\20\0\1\11\1\10\1\0\6\10\3\0\3\10\1\0"+ + "\4\10\3\0\2\10\1\0\1\10\1\0\2\10\3\0\2\10\3\0"+ + "\3\10\3\0\10\10\1\0\3\10\4\0\5\11\3\0\3\11\1\0"+ + "\4\11\11\0\1\11\17\0\11\11\11\0\1\10\7\0\3\11\1\0"+ + "\10\10\1\0\3\10\1\0\27\10\1\0\12\10\1\0\5\10\4\0"+ + "\7\11\1\0\3\11\1\0\4\11\7\0\2\11\11\0\2\10\4\0"+ + "\12\11\22\0\2\11\1\0\10\10\1\0\3\10\1\0\27\10\1\0"+ + "\12\10\1\0\5\10\2\0\1\11\1\10\7\11\1\0\3\11\1\0"+ + "\4\11\7\0\2\11\7\0\1\10\1\0\2\10\4\0\12\11\22\0"+ + "\2\11\1\0\10\10\1\0\3\10\1\0\27\10\1\0\20\10\4\0"+ + "\6\11\2\0\3\11\1\0\4\11\11\0\1\11\10\0\2\10\4\0"+ + "\12\11\22\0\2\11\1\0\22\10\3\0\30\10\1\0\11\10\1\0"+ + "\1\10\2\0\7\10\3\0\1\11\4\0\6\11\1\0\1\11\1\0"+ + "\10\11\22\0\2\11\15\0\60\10\1\11\2\10\7\11\4\0\10\10"+ + "\10\11\1\0\12\11\47\0\2\10\1\0\1\10\2\0\2\10\1\0"+ + "\1\10\2\0\1\10\6\0\4\10\1\0\7\10\1\0\3\10\1\0"+ + "\1\10\1\0\1\10\2\0\2\10\1\0\4\10\1\11\2\10\6\11"+ + "\1\0\2\11\1\10\2\0\5\10\1\0\1\10\1\0\6\11\2\0"+ + "\12\11\2\0\2\10\42\0\1\10\27\0\2\11\6\0\12\11\13\0"+ + "\1\11\1\0\1\11\1\0\1\11\4\0\2\11\10\10\1\0\42\10"+ + "\6\0\24\11\1\0\2\11\4\10\4\0\10\11\1\0\44\11\11\0"+ + "\1\11\71\0\42\10\1\0\5\10\1\0\2\10\1\0\7\11\3\0"+ + "\4\11\6\0\12\11\6\0\6\10\4\11\106\0\46\10\12\0\51\10"+ + "\7\0\132\10\5\0\104\10\5\0\122\10\6\0\7\10\1\0\77\10"+ + "\1\0\1\10\1\0\4\10\2\0\7\10\1\0\1\10\1\0\4\10"+ + "\2\0\47\10\1\0\1\10\1\0\4\10\2\0\37\10\1\0\1\10"+ + "\1\0\4\10\2\0\7\10\1\0\1\10\1\0\4\10\2\0\7\10"+ + "\1\0\7\10\1\0\27\10\1\0\37\10\1\0\1\10\1\0\4\10"+ + "\2\0\7\10\1\0\47\10\1\0\23\10\16\0\11\11\56\0\125\10"+ + "\14\0\u026c\10\2\0\10\10\12\0\32\10\5\0\113\10\3\0\3\10"+ + "\17\0\15\10\1\0\4\10\3\11\13\0\22\10\3\11\13\0\22\10"+ + "\2\11\14\0\15\10\1\0\3\10\1\0\2\11\14\0\64\10\40\11"+ + "\3\0\1\10\3\0\2\10\1\11\2\0\12\11\41\0\3\11\2\0"+ + "\12\11\6\0\130\10\10\0\51\10\1\11\126\0\35\10\3\0\14\11"+ + "\4\0\14\11\12\0\12\11\36\10\2\0\5\10\u038b\0\154\10\224\0"+ + "\234\10\4\0\132\10\6\0\26\10\2\0\6\10\2\0\46\10\2\0"+ + "\6\10\2\0\10\10\1\0\1\10\1\0\1\10\1\0\1\10\1\0"+ + "\37\10\2\0\65\10\1\0\7\10\1\0\1\10\3\0\3\10\1\0"+ + "\7\10\3\0\4\10\2\0\6\10\4\0\15\10\5\0\3\10\1\0"+ + "\7\10\17\0\4\11\32\0\5\11\20\0\2\10\23\0\1\10\13\0"+ + "\4\11\6\0\6\11\1\0\1\10\15\0\1\10\40\0\22\10\36\0"+ + "\15\11\4\0\1\11\3\0\6\11\27\0\1\10\4\0\1\10\2\0"+ + "\12\10\1\0\1\10\3\0\5\10\6\0\1\10\1\0\1\10\1\0"+ + "\1\10\1\0\4\10\1\0\3\10\1\0\7\10\3\0\3\10\5\0"+ + "\5\10\26\0\44\10\u0e81\0\3\10\31\0\11\10\6\11\1\0\5\10"+ + "\2\0\5\10\4\0\126\10\2\0\2\11\2\0\3\10\1\0\137\10"+ + "\5\0\50\10\4\0\136\10\21\0\30\10\70\0\20\10\u0200\0\u19b6\10"+ + "\112\0\u51a6\10\132\0\u048d\10\u0773\0\u2ba4\10\u215c\0\u012e\10\2\0\73\10"+ + "\225\0\7\10\14\0\5\10\5\0\1\10\1\11\12\10\1\0\15\10"+ + "\1\0\5\10\1\0\1\10\1\0\2\10\1\0\2\10\1\0\154\10"+ + "\41\0\u016b\10\22\0\100\10\2\0\66\10\50\0\15\10\3\0\20\11"+ + "\20\0\4\11\17\0\2\10\30\0\3\10\31\0\1\10\6\0\5\10"+ + "\1\0\207\10\2\0\1\11\4\0\1\10\13\0\12\11\7\0\32\10"+ + "\4\0\1\10\1\0\32\10\12\0\132\10\3\0\6\10\2\0\6\10"+ + "\2\0\6\10\2\0\3\10\3\0\2\10\3\0\2\10\22\0\3\11"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\2\1\1\2\1\1\1\3\2\4\1\1\1\5"+ + "\2\6\1\7\1\10\1\7\2\1\1\11\1\12\1\0"+ + "\1\13\1\14\2\3\1\0\1\10\2\0\2\11\1\3"+ + "\1\0\1\10\2\0\1\15"; + + private static int [] zzUnpackAction() { + int [] result = new int[38]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\27\0\56\0\105\0\134\0\163\0\212\0\241"+ + "\0\270\0\105\0\317\0\105\0\346\0\105\0\375\0\u0114"+ + "\0\u012b\0\u0142\0\u0159\0\u0170\0\105\0\212\0\105\0\105"+ + "\0\u0187\0\u019e\0\u01b5\0\u01cc\0\u01e3\0\u0159\0\u01fa\0\105"+ + "\0\105\0\u0211\0\u0228\0\u0228\0\u023f\0\105"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[38]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\4\1\5\1\6\3\4\1\7\1\4\1\6\1\7"+ + "\4\4\1\7\1\6\5\4\1\10\1\11\1\12\22\10"+ + "\1\13\1\14\1\4\1\15\1\16\1\4\1\17\1\4"+ + "\1\20\1\4\1\21\1\4\2\21\1\4\1\20\1\22"+ + "\1\23\2\21\1\4\1\20\1\24\1\4\1\25\32\0"+ + "\1\5\27\0\1\6\1\0\1\6\1\0\2\26\2\6"+ + "\1\27\1\6\2\0\1\26\1\6\1\0\1\6\7\0"+ + "\1\26\1\0\1\26\1\0\4\26\1\27\1\26\2\0"+ + "\2\26\1\0\1\26\3\0\1\10\2\0\22\10\4\0"+ + "\1\12\24\0\2\30\1\0\12\30\1\31\5\30\1\32"+ + "\3\30\2\0\1\16\30\0\1\21\1\33\1\21\1\0"+ + "\4\21\1\0\1\21\2\0\2\21\1\0\1\21\11\0"+ + "\1\20\6\0\1\20\1\0\1\34\2\35\1\0\1\20"+ + "\7\0\1\21\1\0\1\21\1\0\4\21\1\0\1\21"+ + "\2\0\2\21\1\0\1\21\11\0\1\20\6\0\1\20"+ + "\1\0\1\36\3\0\1\20\11\0\1\34\6\0\1\34"+ + "\5\0\1\34\3\0\1\24\1\37\1\40\24\24\15\0"+ + "\1\32\5\0\1\32\20\0\1\41\5\0\1\41\11\0"+ + "\1\42\6\0\1\42\5\0\1\42\11\0\1\34\6\0"+ + "\1\34\2\0\2\35\1\0\1\34\11\0\1\43\6\0"+ + "\1\43\1\44\3\0\1\44\1\43\5\0\1\40\32\0"+ + "\1\42\1\45\5\0\1\42\5\0\1\42\11\0\1\43"+ + "\6\0\1\43\5\0\1\43\31\0\1\46"; + + private static int [] zzUnpackTrans() { + int [] result = new int[598]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\5\1\1\11\1\1\1\11\1\1\1\11"+ + "\6\1\1\11\1\0\2\11\2\1\1\0\1\1\2\0"+ + "\1\1\2\11\1\0\1\1\2\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[38]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + boolean isMultiname=false; + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public Flasm3Lexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public Flasm3Lexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public Flasm3Lexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1702) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 5: + { yybegin(PARAMETERS); + // length also includes the trailing quote + if(isMultiname){ + return token(TokenType.IDENTIFIER, tokenStart, tokenLength + 1);//multiname + }else{ + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + } + case 14: break; + case 9: + { yybegin(YYINITIAL); return token(TokenType.COMMENT); + } + case 15: break; + case 4: + { yybegin(YYINITIAL); + return token(TokenType.ERROR,tokenStart, tokenLength); + } + case 16: break; + case 11: + { return token(TokenType.IDENTIFIER,yychar,yylength()-1); + } + case 17: break; + case 10: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + isMultiname=false; + } + case 18: break; + case 13: + { isMultiname=true; + yybegin(STRING); + tokenStart = yychar; + tokenLength = yylength(); + } + case 19: break; + case 12: + { tokenLength += 2; + } + case 20: break; + case 7: + { return token(TokenType.IDENTIFIER); + } + case 21: break; + case 2: + { yybegin(PARAMETERS); + return token(TokenType.KEYWORD); + } + case 22: break; + case 8: + { return token(TokenType.NUMBER); + } + case 23: break; + case 6: + { yybegin(YYINITIAL); + } + case 24: break; + case 1: + { + } + case 25: break; + case 3: + { tokenLength += yylength(); + } + case 26: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java~ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java~ new file mode 100644 index 000000000..cb20fbfe5 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/Flasm3Lexer.java~ @@ -0,0 +1,739 @@ +/* The following code was generated by JFlex 1.4.3 on 28.7.10 15:00 */ + +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 28.7.10 15:00 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm3.flex + */ +public final class Flasm3Lexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int PARAMETERS = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\11\1\3\1\2\1\0\1\3\1\1\16\11\4\0\1\3\1\0"+ + "\1\25\1\0\1\10\6\0\1\21\1\0\1\21\1\16\1\0\1\15"+ + "\3\15\4\22\2\6\1\14\1\23\5\0\4\10\1\17\25\10\1\5"+ + "\1\24\1\7\1\0\1\13\1\0\4\12\1\20\7\12\1\4\15\12"+ + "\4\0\41\11\2\0\4\10\4\0\1\10\2\0\1\11\7\0\1\10"+ + "\4\0\1\10\5\0\27\10\1\0\37\10\1\0\u013f\10\31\0\162\10"+ + "\4\0\14\10\16\0\5\10\11\0\1\10\21\0\130\11\5\0\23\11"+ + "\12\0\1\10\13\0\1\10\1\0\3\10\1\0\1\10\1\0\24\10"+ + "\1\0\54\10\1\0\46\10\1\0\5\10\4\0\202\10\1\0\4\11"+ + "\3\0\105\10\1\0\46\10\2\0\2\10\6\0\20\10\41\0\46\10"+ + "\2\0\1\10\7\0\47\10\11\0\21\11\1\0\27\11\1\0\3\11"+ + "\1\0\1\11\1\0\2\11\1\0\1\11\13\0\33\10\5\0\3\10"+ + "\15\0\4\11\14\0\6\11\13\0\32\10\5\0\13\10\16\11\7\0"+ + "\12\11\4\0\2\10\1\11\143\10\1\0\1\10\10\11\1\0\6\11"+ + "\2\10\2\11\1\0\4\11\2\10\12\11\3\10\2\0\1\10\17\0"+ + "\1\11\1\10\1\11\36\10\33\11\2\0\3\10\60\0\46\10\13\11"+ + "\1\10\u014f\0\3\11\66\10\2\0\1\11\1\10\20\11\2\0\1\10"+ + "\4\11\3\0\12\10\2\11\2\0\12\11\21\0\3\11\1\0\10\10"+ + "\2\0\2\10\2\0\26\10\1\0\7\10\1\0\1\10\3\0\4\10"+ + "\2\0\1\11\1\10\7\11\2\0\2\11\2\0\3\11\11\0\1\11"+ + "\4\0\2\10\1\0\3\10\2\11\2\0\12\11\4\10\15\0\3\11"+ + "\1\0\6\10\4\0\2\10\2\0\26\10\1\0\7\10\1\0\2\10"+ + "\1\0\2\10\1\0\2\10\2\0\1\11\1\0\5\11\4\0\2\11"+ + "\2\0\3\11\13\0\4\10\1\0\1\10\7\0\14\11\3\10\14\0"+ + "\3\11\1\0\11\10\1\0\3\10\1\0\26\10\1\0\7\10\1\0"+ + "\2\10\1\0\5\10\2\0\1\11\1\10\10\11\1\0\3\11\1\0"+ + "\3\11\2\0\1\10\17\0\2\10\2\11\2\0\12\11\1\0\1\10"+ + "\17\0\3\11\1\0\10\10\2\0\2\10\2\0\26\10\1\0\7\10"+ + "\1\0\2\10\1\0\5\10\2\0\1\11\1\10\6\11\3\0\2\11"+ + "\2\0\3\11\10\0\2\11\4\0\2\10\1\0\3\10\4\0\12\11"+ + "\1\0\1\10\20\0\1\11\1\10\1\0\6\10\3\0\3\10\1\0"+ + "\4\10\3\0\2\10\1\0\1\10\1\0\2\10\3\0\2\10\3\0"+ + "\3\10\3\0\10\10\1\0\3\10\4\0\5\11\3\0\3\11\1\0"+ + "\4\11\11\0\1\11\17\0\11\11\11\0\1\10\7\0\3\11\1\0"+ + "\10\10\1\0\3\10\1\0\27\10\1\0\12\10\1\0\5\10\4\0"+ + "\7\11\1\0\3\11\1\0\4\11\7\0\2\11\11\0\2\10\4\0"+ + "\12\11\22\0\2\11\1\0\10\10\1\0\3\10\1\0\27\10\1\0"+ + "\12\10\1\0\5\10\2\0\1\11\1\10\7\11\1\0\3\11\1\0"+ + "\4\11\7\0\2\11\7\0\1\10\1\0\2\10\4\0\12\11\22\0"+ + "\2\11\1\0\10\10\1\0\3\10\1\0\27\10\1\0\20\10\4\0"+ + "\6\11\2\0\3\11\1\0\4\11\11\0\1\11\10\0\2\10\4\0"+ + "\12\11\22\0\2\11\1\0\22\10\3\0\30\10\1\0\11\10\1\0"+ + "\1\10\2\0\7\10\3\0\1\11\4\0\6\11\1\0\1\11\1\0"+ + "\10\11\22\0\2\11\15\0\60\10\1\11\2\10\7\11\4\0\10\10"+ + "\10\11\1\0\12\11\47\0\2\10\1\0\1\10\2\0\2\10\1\0"+ + "\1\10\2\0\1\10\6\0\4\10\1\0\7\10\1\0\3\10\1\0"+ + "\1\10\1\0\1\10\2\0\2\10\1\0\4\10\1\11\2\10\6\11"+ + "\1\0\2\11\1\10\2\0\5\10\1\0\1\10\1\0\6\11\2\0"+ + "\12\11\2\0\2\10\42\0\1\10\27\0\2\11\6\0\12\11\13\0"+ + "\1\11\1\0\1\11\1\0\1\11\4\0\2\11\10\10\1\0\42\10"+ + "\6\0\24\11\1\0\2\11\4\10\4\0\10\11\1\0\44\11\11\0"+ + "\1\11\71\0\42\10\1\0\5\10\1\0\2\10\1\0\7\11\3\0"+ + "\4\11\6\0\12\11\6\0\6\10\4\11\106\0\46\10\12\0\51\10"+ + "\7\0\132\10\5\0\104\10\5\0\122\10\6\0\7\10\1\0\77\10"+ + "\1\0\1\10\1\0\4\10\2\0\7\10\1\0\1\10\1\0\4\10"+ + "\2\0\47\10\1\0\1\10\1\0\4\10\2\0\37\10\1\0\1\10"+ + "\1\0\4\10\2\0\7\10\1\0\1\10\1\0\4\10\2\0\7\10"+ + "\1\0\7\10\1\0\27\10\1\0\37\10\1\0\1\10\1\0\4\10"+ + "\2\0\7\10\1\0\47\10\1\0\23\10\16\0\11\11\56\0\125\10"+ + "\14\0\u026c\10\2\0\10\10\12\0\32\10\5\0\113\10\3\0\3\10"+ + "\17\0\15\10\1\0\4\10\3\11\13\0\22\10\3\11\13\0\22\10"+ + "\2\11\14\0\15\10\1\0\3\10\1\0\2\11\14\0\64\10\40\11"+ + "\3\0\1\10\3\0\2\10\1\11\2\0\12\11\41\0\3\11\2\0"+ + "\12\11\6\0\130\10\10\0\51\10\1\11\126\0\35\10\3\0\14\11"+ + "\4\0\14\11\12\0\12\11\36\10\2\0\5\10\u038b\0\154\10\224\0"+ + "\234\10\4\0\132\10\6\0\26\10\2\0\6\10\2\0\46\10\2\0"+ + "\6\10\2\0\10\10\1\0\1\10\1\0\1\10\1\0\1\10\1\0"+ + "\37\10\2\0\65\10\1\0\7\10\1\0\1\10\3\0\3\10\1\0"+ + "\7\10\3\0\4\10\2\0\6\10\4\0\15\10\5\0\3\10\1\0"+ + "\7\10\17\0\4\11\32\0\5\11\20\0\2\10\23\0\1\10\13\0"+ + "\4\11\6\0\6\11\1\0\1\10\15\0\1\10\40\0\22\10\36\0"+ + "\15\11\4\0\1\11\3\0\6\11\27\0\1\10\4\0\1\10\2\0"+ + "\12\10\1\0\1\10\3\0\5\10\6\0\1\10\1\0\1\10\1\0"+ + "\1\10\1\0\4\10\1\0\3\10\1\0\7\10\3\0\3\10\5\0"+ + "\5\10\26\0\44\10\u0e81\0\3\10\31\0\11\10\6\11\1\0\5\10"+ + "\2\0\5\10\4\0\126\10\2\0\2\11\2\0\3\10\1\0\137\10"+ + "\5\0\50\10\4\0\136\10\21\0\30\10\70\0\20\10\u0200\0\u19b6\10"+ + "\112\0\u51a6\10\132\0\u048d\10\u0773\0\u2ba4\10\u215c\0\u012e\10\2\0\73\10"+ + "\225\0\7\10\14\0\5\10\5\0\1\10\1\11\12\10\1\0\15\10"+ + "\1\0\5\10\1\0\1\10\1\0\2\10\1\0\2\10\1\0\154\10"+ + "\41\0\u016b\10\22\0\100\10\2\0\66\10\50\0\15\10\3\0\20\11"+ + "\20\0\4\11\17\0\2\10\30\0\3\10\31\0\1\10\6\0\5\10"+ + "\1\0\207\10\2\0\1\11\4\0\1\10\13\0\12\11\7\0\32\10"+ + "\4\0\1\10\1\0\32\10\12\0\132\10\3\0\6\10\2\0\6\10"+ + "\2\0\6\10\2\0\3\10\3\0\2\10\3\0\2\10\22\0\3\11"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\2\1\1\2\1\1\1\3\2\4\1\1\1\5"+ + "\2\6\1\7\1\10\1\7\1\1\1\11\1\12\1\0"+ + "\1\13\1\14\2\3\1\0\1\10\1\0\2\11\1\3"+ + "\1\0\1\10\2\0\1\15"; + + private static int [] zzUnpackAction() { + int [] result = new int[36]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\26\0\54\0\102\0\130\0\156\0\204\0\232"+ + "\0\260\0\102\0\306\0\102\0\334\0\102\0\362\0\u0108"+ + "\0\u011e\0\u0134\0\u014a\0\102\0\204\0\102\0\102\0\u0160"+ + "\0\u0176\0\u018c\0\u01a2\0\u01b8\0\u01ce\0\102\0\102\0\u01e4"+ + "\0\u01fa\0\u01fa\0\u0210\0\102"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[36]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\4\1\5\1\6\3\4\1\7\1\4\1\6\1\7"+ + "\3\4\1\7\1\6\5\4\1\10\1\11\1\12\21\10"+ + "\1\13\1\14\1\4\1\15\1\16\1\4\1\17\1\4"+ + "\1\20\1\4\1\21\1\4\2\21\1\4\1\20\1\22"+ + "\2\21\1\4\1\20\1\23\1\4\1\24\31\0\1\5"+ + "\26\0\1\6\1\0\1\6\1\0\2\25\2\6\1\26"+ + "\1\6\1\0\1\25\1\6\1\0\1\6\7\0\1\25"+ + "\1\0\1\25\1\0\4\25\1\26\1\25\1\0\2\25"+ + "\1\0\1\25\3\0\1\10\2\0\21\10\4\0\1\12"+ + "\23\0\2\27\1\0\12\27\1\30\4\27\1\31\3\27"+ + "\2\0\1\16\27\0\1\21\1\32\1\21\1\0\4\21"+ + "\1\0\1\21\1\0\2\21\1\0\1\21\11\0\1\20"+ + "\6\0\1\20\1\33\2\34\1\0\1\20\7\0\1\21"+ + "\1\0\1\21\1\0\4\21\1\0\1\21\1\0\2\21"+ + "\1\0\1\21\11\0\1\33\6\0\1\33\4\0\1\33"+ + "\3\0\1\23\1\35\1\36\23\23\15\0\1\31\4\0"+ + "\1\31\20\0\1\37\4\0\1\37\11\0\1\40\6\0"+ + "\1\40\4\0\1\40\11\0\1\33\6\0\1\33\1\0"+ + "\2\34\1\0\1\33\11\0\1\41\6\0\1\41\3\0"+ + "\1\42\1\41\5\0\1\36\31\0\1\40\1\43\5\0"+ + "\1\40\4\0\1\40\11\0\1\41\6\0\1\41\4\0"+ + "\1\41\30\0\1\44"; + + private static int [] zzUnpackTrans() { + int [] result = new int[550]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\5\1\1\11\1\1\1\11\1\1\1\11"+ + "\5\1\1\11\1\0\2\11\2\1\1\0\1\1\1\0"+ + "\1\1\2\11\1\0\1\1\2\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[36]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + boolean isMultiname=false; + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public Flasm3Lexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public Flasm3Lexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public Flasm3Lexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1702) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 5: + { yybegin(PARAMETERS); + // length also includes the trailing quote + if(isMultiname){ + return token(TokenType.IDENTIFIER, tokenStart, tokenLength + 1);//multiname + }else{ + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + } + case 14: break; + case 9: + { yybegin(YYINITIAL); return token(TokenType.COMMENT); + } + case 15: break; + case 4: + { yybegin(YYINITIAL); + return token(TokenType.ERROR,tokenStart, tokenLength); + } + case 16: break; + case 11: + { return token(TokenType.IDENTIFIER,yychar,yylength()-1); + } + case 17: break; + case 10: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + isMultiname=false; + } + case 18: break; + case 13: + { isMultiname=true; + yybegin(STRING); + tokenStart = yychar; + tokenLength = yylength(); + } + case 19: break; + case 12: + { tokenLength += 2; + } + case 20: break; + case 7: + { return token(TokenType.IDENTIFIER); + } + case 21: break; + case 2: + { yybegin(PARAMETERS); + return token(TokenType.KEYWORD); + } + case 22: break; + case 8: + { return token(TokenType.NUMBER); + } + case 23: break; + case 6: + { yybegin(YYINITIAL); + } + case 24: break; + case 1: + { + } + case 25: break; + case 3: + { tokenLength += yylength(); + } + case 26: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java new file mode 100644 index 000000000..794a7559a --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java @@ -0,0 +1,838 @@ +/* The following code was generated by JFlex 1.4.3 on 18.8.10 12:21 */ + +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 18.8.10 12:21 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm.flex + */ +public final class FlasmLexer extends DefaultJFlexLexer { + + /** + * This character denotes the end of file + */ + public static final int YYEOF = -1; + + /** + * initial size of the lookahead buffer + */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** + * lexical states + */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int PARAMETERS = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\6\1\4\1\2\1\0\1\4\1\1\16\6\4\0\1\4\1\0" + + "\1\40\1\0\1\5\6\0\1\32\1\0\1\27\1\30\1\0\1\26" + + "\3\41\4\33\2\11\1\12\1\3\5\0\4\7\1\31\25\7\1\0" + + "\1\34\2\0\1\10\1\0\1\20\1\7\1\36\1\24\1\16\1\17" + + "\1\35\1\7\1\25\2\7\1\21\1\7\1\23\1\37\2\7\1\14" + + "\1\22\1\13\1\15\5\7\1\0\1\0\1\0\1\0\41\6\2\0" + + "\4\5\4\0\1\5\2\0\1\6\7\0\1\5\4\0\1\5\5\0" + + "\27\5\1\0\37\5\1\0\u013f\5\31\0\162\5\4\0\14\5\16\0" + + "\5\5\11\0\1\5\21\0\130\6\5\0\23\6\12\0\1\5\13\0" + + "\1\5\1\0\3\5\1\0\1\5\1\0\24\5\1\0\54\5\1\0" + + "\46\5\1\0\5\5\4\0\202\5\1\0\4\6\3\0\105\5\1\0" + + "\46\5\2\0\2\5\6\0\20\5\41\0\46\5\2\0\1\5\7\0" + + "\47\5\11\0\21\6\1\0\27\6\1\0\3\6\1\0\1\6\1\0" + + "\2\6\1\0\1\6\13\0\33\5\5\0\3\5\15\0\4\6\14\0" + + "\6\6\13\0\32\5\5\0\13\5\16\6\7\0\12\6\4\0\2\5" + + "\1\6\143\5\1\0\1\5\10\6\1\0\6\6\2\5\2\6\1\0" + + "\4\6\2\5\12\6\3\5\2\0\1\5\17\0\1\6\1\5\1\6" + + "\36\5\33\6\2\0\3\5\60\0\46\5\13\6\1\5\u014f\0\3\6" + + "\66\5\2\0\1\6\1\5\20\6\2\0\1\5\4\6\3\0\12\5" + + "\2\6\2\0\12\6\21\0\3\6\1\0\10\5\2\0\2\5\2\0" + + "\26\5\1\0\7\5\1\0\1\5\3\0\4\5\2\0\1\6\1\5" + + "\7\6\2\0\2\6\2\0\3\6\11\0\1\6\4\0\2\5\1\0" + + "\3\5\2\6\2\0\12\6\4\5\15\0\3\6\1\0\6\5\4\0" + + "\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0\2\5\1\0" + + "\2\5\2\0\1\6\1\0\5\6\4\0\2\6\2\0\3\6\13\0" + + "\4\5\1\0\1\5\7\0\14\6\3\5\14\0\3\6\1\0\11\5" + + "\1\0\3\5\1\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5" + + "\2\0\1\6\1\5\10\6\1\0\3\6\1\0\3\6\2\0\1\5" + + "\17\0\2\5\2\6\2\0\12\6\1\0\1\5\17\0\3\6\1\0" + + "\10\5\2\0\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0" + + "\5\5\2\0\1\6\1\5\6\6\3\0\2\6\2\0\3\6\10\0" + + "\2\6\4\0\2\5\1\0\3\5\4\0\12\6\1\0\1\5\20\0" + + "\1\6\1\5\1\0\6\5\3\0\3\5\1\0\4\5\3\0\2\5" + + "\1\0\1\5\1\0\2\5\3\0\2\5\3\0\3\5\3\0\10\5" + + "\1\0\3\5\4\0\5\6\3\0\3\6\1\0\4\6\11\0\1\6" + + "\17\0\11\6\11\0\1\5\7\0\3\6\1\0\10\5\1\0\3\5" + + "\1\0\27\5\1\0\12\5\1\0\5\5\4\0\7\6\1\0\3\6" + + "\1\0\4\6\7\0\2\6\11\0\2\5\4\0\12\6\22\0\2\6" + + "\1\0\10\5\1\0\3\5\1\0\27\5\1\0\12\5\1\0\5\5" + + "\2\0\1\6\1\5\7\6\1\0\3\6\1\0\4\6\7\0\2\6" + + "\7\0\1\5\1\0\2\5\4\0\12\6\22\0\2\6\1\0\10\5" + + "\1\0\3\5\1\0\27\5\1\0\20\5\4\0\6\6\2\0\3\6" + + "\1\0\4\6\11\0\1\6\10\0\2\5\4\0\12\6\22\0\2\6" + + "\1\0\22\5\3\0\30\5\1\0\11\5\1\0\1\5\2\0\7\5" + + "\3\0\1\6\4\0\6\6\1\0\1\6\1\0\10\6\22\0\2\6" + + "\15\0\60\5\1\6\2\5\7\6\4\0\10\5\10\6\1\0\12\6" + + "\47\0\2\5\1\0\1\5\2\0\2\5\1\0\1\5\2\0\1\5" + + "\6\0\4\5\1\0\7\5\1\0\3\5\1\0\1\5\1\0\1\5" + + "\2\0\2\5\1\0\4\5\1\6\2\5\6\6\1\0\2\6\1\5" + + "\2\0\5\5\1\0\1\5\1\0\6\6\2\0\12\6\2\0\2\5" + + "\42\0\1\5\27\0\2\6\6\0\12\6\13\0\1\6\1\0\1\6" + + "\1\0\1\6\4\0\2\6\10\5\1\0\42\5\6\0\24\6\1\0" + + "\2\6\4\5\4\0\10\6\1\0\44\6\11\0\1\6\71\0\42\5" + + "\1\0\5\5\1\0\2\5\1\0\7\6\3\0\4\6\6\0\12\6" + + "\6\0\6\5\4\6\106\0\46\5\12\0\51\5\7\0\132\5\5\0" + + "\104\5\5\0\122\5\6\0\7\5\1\0\77\5\1\0\1\5\1\0" + + "\4\5\2\0\7\5\1\0\1\5\1\0\4\5\2\0\47\5\1\0" + + "\1\5\1\0\4\5\2\0\37\5\1\0\1\5\1\0\4\5\2\0" + + "\7\5\1\0\1\5\1\0\4\5\2\0\7\5\1\0\7\5\1\0" + + "\27\5\1\0\37\5\1\0\1\5\1\0\4\5\2\0\7\5\1\0" + + "\47\5\1\0\23\5\16\0\11\6\56\0\125\5\14\0\u026c\5\2\0" + + "\10\5\12\0\32\5\5\0\113\5\3\0\3\5\17\0\15\5\1\0" + + "\4\5\3\6\13\0\22\5\3\6\13\0\22\5\2\6\14\0\15\5" + + "\1\0\3\5\1\0\2\6\14\0\64\5\40\6\3\0\1\5\3\0" + + "\2\5\1\6\2\0\12\6\41\0\3\6\2\0\12\6\6\0\130\5" + + "\10\0\51\5\1\6\126\0\35\5\3\0\14\6\4\0\14\6\12\0" + + "\12\6\36\5\2\0\5\5\u038b\0\154\5\224\0\234\5\4\0\132\5" + + "\6\0\26\5\2\0\6\5\2\0\46\5\2\0\6\5\2\0\10\5" + + "\1\0\1\5\1\0\1\5\1\0\1\5\1\0\37\5\2\0\65\5" + + "\1\0\7\5\1\0\1\5\3\0\3\5\1\0\7\5\3\0\4\5" + + "\2\0\6\5\4\0\15\5\5\0\3\5\1\0\7\5\17\0\4\6" + + "\32\0\5\6\20\0\2\5\23\0\1\5\13\0\4\6\6\0\6\6" + + "\1\0\1\5\15\0\1\5\40\0\22\5\36\0\15\6\4\0\1\6" + + "\3\0\6\6\27\0\1\5\4\0\1\5\2\0\12\5\1\0\1\5" + + "\3\0\5\5\6\0\1\5\1\0\1\5\1\0\1\5\1\0\4\5" + + "\1\0\3\5\1\0\7\5\3\0\3\5\5\0\5\5\26\0\44\5" + + "\u0e81\0\3\5\31\0\11\5\6\6\1\0\5\5\2\0\5\5\4\0" + + "\126\5\2\0\2\6\2\0\3\5\1\0\137\5\5\0\50\5\4\0" + + "\136\5\21\0\30\5\70\0\20\5\u0200\0\u19b6\5\112\0\u51a6\5\132\0" + + "\u048d\5\u0773\0\u2ba4\5\u215c\0\u012e\5\2\0\73\5\225\0\7\5\14\0" + + "\5\5\5\0\1\5\1\6\12\5\1\0\15\5\1\0\5\5\1\0" + + "\1\5\1\0\2\5\1\0\2\5\1\0\154\5\41\0\u016b\5\22\0" + + "\100\5\2\0\66\5\50\0\15\5\3\0\20\6\20\0\4\6\17\0" + + "\2\5\30\0\3\5\31\0\1\5\6\0\5\5\1\0\207\5\2\0" + + "\1\6\4\0\1\5\13\0\12\6\7\0\32\5\4\0\1\5\1\0" + + "\32\5\12\0\132\5\3\0\6\5\2\0\6\5\2\0\6\5\2\0" + + "\3\5\3\0\2\5\3\0\2\5\22\0\3\6\4\0"; + + /** + * Translates characters to character classes + */ + private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int[] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\1\2\1\3\2\4\1\1\1\5\2\6" + + "\1\7\1\10\1\11\5\10\2\1\1\10\1\12\1\0" + + "\1\13\1\14\2\3\1\0\1\11\5\10\1\0\1\10" + + "\1\3\1\11\1\0\6\10\1\15\16\10\2\16\1\0" + + "\1\16"; + + private static int[] zzUnpackAction() { + int[] result = new int[68]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\42\0\104\0\146\0\210\0\252\0\314\0\356" + + "\0\u0110\0\146\0\u0132\0\146\0\u0154\0\146\0\u0176\0\u0198" + + "\0\u01ba\0\u01dc\0\u01fe\0\u0220\0\u0242\0\u0264\0\u0286\0\u02a8" + + "\0\u02ca\0\146\0\252\0\146\0\146\0\u02ec\0\u030e\0\u0330" + + "\0\u0352\0\u0374\0\u0396\0\u03b8\0\u03da\0\u03fc\0\u02a8\0\u041e" + + "\0\146\0\u0440\0\u0440\0\u0462\0\u0484\0\u04a6\0\u04c8\0\u04ea" + + "\0\u050c\0\u0198\0\u052e\0\u0550\0\u0572\0\u0594\0\u05b6\0\u05d8" + + "\0\u05fa\0\u061c\0\u063e\0\u0660\0\u0682\0\u06a4\0\u06c6\0\u06e8" + + "\0\u070a\0\u0198\0\u072c\0\u074e"; + + private static int[] zzUnpackRowMap() { + int[] result = new int[68]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int[] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\4\4\1\5\1\6\1\4\1\7\1\6\2\4\13\7" + + "\3\4\1\7\3\4\3\7\2\4\1\10\1\11\1\12" + + "\31\10\1\13\3\10\1\14\1\10\1\4\1\15\1\16" + + "\1\17\1\4\1\20\1\4\2\20\1\21\1\4\1\22" + + "\1\23\1\24\1\20\1\25\3\20\1\26\2\20\1\21" + + "\1\27\1\30\1\20\1\4\1\21\1\4\1\20\1\31" + + "\1\20\1\32\1\21\46\0\1\5\42\0\5\33\1\34" + + "\14\33\2\0\1\33\1\0\1\33\1\0\3\33\1\0" + + "\1\33\5\0\2\33\3\7\1\34\14\7\2\0\1\7" + + "\1\0\1\7\1\0\3\7\1\0\1\7\1\10\2\0" + + "\31\10\1\0\3\10\1\0\1\10\2\0\1\12\37\0" + + "\2\35\1\0\23\35\1\36\4\35\1\37\5\35\1\36" + + "\2\0\1\16\37\0\1\17\2\0\37\17\5\0\5\20" + + "\1\0\14\20\2\0\1\20\1\0\1\20\1\0\3\20" + + "\1\0\1\20\11\0\1\21\4\0\1\40\7\0\1\21" + + "\1\0\1\41\1\40\1\0\1\21\5\0\1\21\5\0" + + "\5\20\1\0\1\20\1\42\12\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\3\20\1\43\10\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\10\20\1\44" + + "\3\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\5\0\5\20\1\0\5\20\1\45\6\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\2\20\1\46\11\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\11\0\1\21\14\0" + + "\1\21\1\0\1\47\2\0\1\21\5\0\1\21\11\0" + + "\1\41\14\0\1\41\4\0\1\41\5\0\1\41\5\0" + + "\5\20\1\0\14\20\2\0\1\20\1\0\1\20\1\0" + + "\2\20\1\50\1\0\1\20\26\0\1\37\4\0\1\37" + + "\5\0\1\37\26\0\1\51\4\0\1\51\5\0\1\51" + + "\11\0\1\52\14\0\1\52\1\53\2\0\1\53\1\52" + + "\5\0\1\52\11\0\1\41\4\0\1\40\7\0\1\41" + + "\2\0\1\40\1\0\1\41\5\0\1\41\5\0\5\20" + + "\1\0\2\20\1\54\11\20\2\0\1\20\1\0\1\20" + + "\1\0\3\20\1\0\1\20\5\0\5\20\1\0\14\20" + + "\2\0\1\20\1\0\1\20\1\0\1\55\2\20\1\0" + + "\1\20\5\0\5\20\1\0\11\20\1\56\2\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\6\20\1\57\5\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\6\20\1\60\5\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\10\20\1\61" + + "\3\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\11\0\1\52\14\0\1\52\4\0\1\52\5\0" + + "\1\52\5\0\5\20\1\0\3\20\1\62\10\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\12\20\1\63\1\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\3\20\1\64\10\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\7\20\1\54" + + "\4\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\5\0\5\20\1\0\6\20\1\62\5\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\7\20\1\65\4\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\7\20\1\66\4\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\4\20\1\67" + + "\7\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\5\0\5\20\1\0\1\70\13\20\2\0\1\20" + + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20" + + "\1\0\1\71\13\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\12\20\1\72" + + "\1\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\5\0\5\20\1\0\5\20\1\73\6\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\3\20\1\74\10\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\10\20\1\75\3\20\2\0\1\20\1\0\1\20\1\0" + + "\3\20\1\0\1\20\5\0\5\20\1\0\10\20\1\76" + + "\3\20\2\0\1\20\1\0\1\20\1\0\3\20\1\0" + + "\1\20\5\0\5\20\1\0\1\20\1\77\12\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\5\20\1\0\3\20\1\100\10\20\2\0\1\20\1\0" + + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0" + + "\1\77\13\20\2\0\1\20\1\0\1\20\1\0\3\20" + + "\1\0\1\20\5\0\4\20\1\101\1\0\13\20\1\102" + + "\1\103\1\0\1\20\1\0\1\101\1\0\3\20\1\0" + + "\1\101\5\0\5\20\1\0\11\20\1\62\2\20\2\0" + + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0" + + "\4\20\1\101\1\0\13\20\1\101\2\0\1\20\1\0" + + "\1\101\1\0\3\20\1\0\1\101\11\0\1\104\21\0" + + "\1\104\5\0\1\104\11\0\1\104\14\0\1\104\4\0" + + "\1\104\5\0\1\104"; + + private static int[] zzUnpackTrans() { + int[] result = new int[1904]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\5\1\1\11\1\1\1\11\1\1\1\11" + + "\13\1\1\11\1\0\2\11\2\1\1\0\6\1\1\0" + + "\1\1\1\11\1\1\1\0\27\1\1\0\1\1"; + + private static int[] zzUnpackAttribute() { + int[] result = new int[68]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** + * the input device + */ + private java.io.Reader zzReader; + + /** + * the current state of the DFA + */ + private int zzState; + + /** + * the current lexical state + */ + private int zzLexicalState = YYINITIAL; + + /** + * this buffer contains the current text to be matched and is + * the source of the yytext() string + */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** + * the textposition at the last accepting state + */ + private int zzMarkedPos; + + /** + * the current text position in the buffer + */ + private int zzCurrentPos; + + /** + * startRead marks the beginning of the yytext() string in the buffer + */ + private int zzStartRead; + + /** + * endRead marks the last character in the buffer, that has been read + * from input + */ + private int zzEndRead; + + /** + * number of newlines encountered up to the start of the matched text + */ + private int yyline; + + /** + * the number of characters up to the start of the matched text + */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** + * zzAtEOF == true <=> the scanner is at the EOF + */ + private boolean zzAtEOF; + + /** + * denotes if the user-EOF-code has already been executed + */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public FlasmLexer() { + + } + + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public FlasmLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public FlasmLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char[] zzUnpackCMap(String packed) { + char[] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1736) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * @throws java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos * 2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length - zzEndRead); + + if (numRead > 0) { + zzEndRead += numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + *

    + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); + } + + + /** + * Returns the character at position pos from the + * matched text. + *

    + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead + pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos - zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + *

    + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + *

    + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + *

    + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if (number > yylength()) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @throws java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char[] zzBufferL = zzBuffer; + char[] zzCMapL = ZZ_CMAP; + + int[] zzTransL = ZZ_TRANS; + int[] zzRowMapL = ZZ_ROWMAP; + int[] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar += zzMarkedPosL - zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: + { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ((zzAttributes & 1) == 1) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ((zzAttributes & 8) == 8) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 4: { + yybegin(YYINITIAL); + return token(TokenType.ERROR, tokenStart, tokenLength); + } + case 15: + break; + case 13: { + return token(TokenType.KEYWORD); + } + case 16: + break; + case 11: { + return token(TokenType.IDENTIFIER, yychar, yylength() - 1); + } + case 17: + break; + case 10: { + yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 18: + break; + case 14: { + return token(TokenType.KEYWORD2); + } + case 19: + break; + case 12: { + tokenLength += 2; + } + case 20: + break; + case 5: { + yybegin(PARAMETERS); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 21: + break; + case 8: { + return token(TokenType.IDENTIFIER); + } + case 22: + break; + case 2: { + yybegin(PARAMETERS); + return token(TokenType.KEYWORD); + } + case 23: + break; + case 7: { + return token(TokenType.COMMENT); + } + case 24: + break; + case 9: { + return token(TokenType.NUMBER); + } + case 25: + break; + case 6: { + yybegin(YYINITIAL); + } + case 26: + break; + case 1: { + } + case 27: + break; + case 3: { + tokenLength += yylength(); + } + case 28: + break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java~ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java~ new file mode 100644 index 000000000..23f57eaf8 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/FlasmLexer.java~ @@ -0,0 +1,794 @@ +/* The following code was generated by JFlex 1.4.3 on 10.8.10 18:04 */ + +/* Flash assembler language lexer specification */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 10.8.10 18:04 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/flasm.flex + */ +public final class FlasmLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int PARAMETERS = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\6\1\4\1\2\1\0\1\4\1\1\16\6\4\0\1\4\1\0"+ + "\1\37\1\0\1\5\6\0\1\31\1\0\1\31\1\27\1\0\1\26"+ + "\3\40\4\32\2\11\1\12\1\3\5\0\4\7\1\30\25\7\1\0"+ + "\1\33\2\0\1\10\1\0\1\20\1\7\1\35\1\24\1\16\1\17"+ + "\1\34\1\7\1\25\2\7\1\21\1\7\1\23\1\36\2\7\1\14"+ + "\1\22\1\13\1\15\5\7\1\0\1\0\1\0\1\0\41\6\2\0"+ + "\4\5\4\0\1\5\2\0\1\6\7\0\1\5\4\0\1\5\5\0"+ + "\27\5\1\0\37\5\1\0\u013f\5\31\0\162\5\4\0\14\5\16\0"+ + "\5\5\11\0\1\5\21\0\130\6\5\0\23\6\12\0\1\5\13\0"+ + "\1\5\1\0\3\5\1\0\1\5\1\0\24\5\1\0\54\5\1\0"+ + "\46\5\1\0\5\5\4\0\202\5\1\0\4\6\3\0\105\5\1\0"+ + "\46\5\2\0\2\5\6\0\20\5\41\0\46\5\2\0\1\5\7\0"+ + "\47\5\11\0\21\6\1\0\27\6\1\0\3\6\1\0\1\6\1\0"+ + "\2\6\1\0\1\6\13\0\33\5\5\0\3\5\15\0\4\6\14\0"+ + "\6\6\13\0\32\5\5\0\13\5\16\6\7\0\12\6\4\0\2\5"+ + "\1\6\143\5\1\0\1\5\10\6\1\0\6\6\2\5\2\6\1\0"+ + "\4\6\2\5\12\6\3\5\2\0\1\5\17\0\1\6\1\5\1\6"+ + "\36\5\33\6\2\0\3\5\60\0\46\5\13\6\1\5\u014f\0\3\6"+ + "\66\5\2\0\1\6\1\5\20\6\2\0\1\5\4\6\3\0\12\5"+ + "\2\6\2\0\12\6\21\0\3\6\1\0\10\5\2\0\2\5\2\0"+ + "\26\5\1\0\7\5\1\0\1\5\3\0\4\5\2\0\1\6\1\5"+ + "\7\6\2\0\2\6\2\0\3\6\11\0\1\6\4\0\2\5\1\0"+ + "\3\5\2\6\2\0\12\6\4\5\15\0\3\6\1\0\6\5\4\0"+ + "\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0\2\5\1\0"+ + "\2\5\2\0\1\6\1\0\5\6\4\0\2\6\2\0\3\6\13\0"+ + "\4\5\1\0\1\5\7\0\14\6\3\5\14\0\3\6\1\0\11\5"+ + "\1\0\3\5\1\0\26\5\1\0\7\5\1\0\2\5\1\0\5\5"+ + "\2\0\1\6\1\5\10\6\1\0\3\6\1\0\3\6\2\0\1\5"+ + "\17\0\2\5\2\6\2\0\12\6\1\0\1\5\17\0\3\6\1\0"+ + "\10\5\2\0\2\5\2\0\26\5\1\0\7\5\1\0\2\5\1\0"+ + "\5\5\2\0\1\6\1\5\6\6\3\0\2\6\2\0\3\6\10\0"+ + "\2\6\4\0\2\5\1\0\3\5\4\0\12\6\1\0\1\5\20\0"+ + "\1\6\1\5\1\0\6\5\3\0\3\5\1\0\4\5\3\0\2\5"+ + "\1\0\1\5\1\0\2\5\3\0\2\5\3\0\3\5\3\0\10\5"+ + "\1\0\3\5\4\0\5\6\3\0\3\6\1\0\4\6\11\0\1\6"+ + "\17\0\11\6\11\0\1\5\7\0\3\6\1\0\10\5\1\0\3\5"+ + "\1\0\27\5\1\0\12\5\1\0\5\5\4\0\7\6\1\0\3\6"+ + "\1\0\4\6\7\0\2\6\11\0\2\5\4\0\12\6\22\0\2\6"+ + "\1\0\10\5\1\0\3\5\1\0\27\5\1\0\12\5\1\0\5\5"+ + "\2\0\1\6\1\5\7\6\1\0\3\6\1\0\4\6\7\0\2\6"+ + "\7\0\1\5\1\0\2\5\4\0\12\6\22\0\2\6\1\0\10\5"+ + "\1\0\3\5\1\0\27\5\1\0\20\5\4\0\6\6\2\0\3\6"+ + "\1\0\4\6\11\0\1\6\10\0\2\5\4\0\12\6\22\0\2\6"+ + "\1\0\22\5\3\0\30\5\1\0\11\5\1\0\1\5\2\0\7\5"+ + "\3\0\1\6\4\0\6\6\1\0\1\6\1\0\10\6\22\0\2\6"+ + "\15\0\60\5\1\6\2\5\7\6\4\0\10\5\10\6\1\0\12\6"+ + "\47\0\2\5\1\0\1\5\2\0\2\5\1\0\1\5\2\0\1\5"+ + "\6\0\4\5\1\0\7\5\1\0\3\5\1\0\1\5\1\0\1\5"+ + "\2\0\2\5\1\0\4\5\1\6\2\5\6\6\1\0\2\6\1\5"+ + "\2\0\5\5\1\0\1\5\1\0\6\6\2\0\12\6\2\0\2\5"+ + "\42\0\1\5\27\0\2\6\6\0\12\6\13\0\1\6\1\0\1\6"+ + "\1\0\1\6\4\0\2\6\10\5\1\0\42\5\6\0\24\6\1\0"+ + "\2\6\4\5\4\0\10\6\1\0\44\6\11\0\1\6\71\0\42\5"+ + "\1\0\5\5\1\0\2\5\1\0\7\6\3\0\4\6\6\0\12\6"+ + "\6\0\6\5\4\6\106\0\46\5\12\0\51\5\7\0\132\5\5\0"+ + "\104\5\5\0\122\5\6\0\7\5\1\0\77\5\1\0\1\5\1\0"+ + "\4\5\2\0\7\5\1\0\1\5\1\0\4\5\2\0\47\5\1\0"+ + "\1\5\1\0\4\5\2\0\37\5\1\0\1\5\1\0\4\5\2\0"+ + "\7\5\1\0\1\5\1\0\4\5\2\0\7\5\1\0\7\5\1\0"+ + "\27\5\1\0\37\5\1\0\1\5\1\0\4\5\2\0\7\5\1\0"+ + "\47\5\1\0\23\5\16\0\11\6\56\0\125\5\14\0\u026c\5\2\0"+ + "\10\5\12\0\32\5\5\0\113\5\3\0\3\5\17\0\15\5\1\0"+ + "\4\5\3\6\13\0\22\5\3\6\13\0\22\5\2\6\14\0\15\5"+ + "\1\0\3\5\1\0\2\6\14\0\64\5\40\6\3\0\1\5\3\0"+ + "\2\5\1\6\2\0\12\6\41\0\3\6\2\0\12\6\6\0\130\5"+ + "\10\0\51\5\1\6\126\0\35\5\3\0\14\6\4\0\14\6\12\0"+ + "\12\6\36\5\2\0\5\5\u038b\0\154\5\224\0\234\5\4\0\132\5"+ + "\6\0\26\5\2\0\6\5\2\0\46\5\2\0\6\5\2\0\10\5"+ + "\1\0\1\5\1\0\1\5\1\0\1\5\1\0\37\5\2\0\65\5"+ + "\1\0\7\5\1\0\1\5\3\0\3\5\1\0\7\5\3\0\4\5"+ + "\2\0\6\5\4\0\15\5\5\0\3\5\1\0\7\5\17\0\4\6"+ + "\32\0\5\6\20\0\2\5\23\0\1\5\13\0\4\6\6\0\6\6"+ + "\1\0\1\5\15\0\1\5\40\0\22\5\36\0\15\6\4\0\1\6"+ + "\3\0\6\6\27\0\1\5\4\0\1\5\2\0\12\5\1\0\1\5"+ + "\3\0\5\5\6\0\1\5\1\0\1\5\1\0\1\5\1\0\4\5"+ + "\1\0\3\5\1\0\7\5\3\0\3\5\5\0\5\5\26\0\44\5"+ + "\u0e81\0\3\5\31\0\11\5\6\6\1\0\5\5\2\0\5\5\4\0"+ + "\126\5\2\0\2\6\2\0\3\5\1\0\137\5\5\0\50\5\4\0"+ + "\136\5\21\0\30\5\70\0\20\5\u0200\0\u19b6\5\112\0\u51a6\5\132\0"+ + "\u048d\5\u0773\0\u2ba4\5\u215c\0\u012e\5\2\0\73\5\225\0\7\5\14\0"+ + "\5\5\5\0\1\5\1\6\12\5\1\0\15\5\1\0\5\5\1\0"+ + "\1\5\1\0\2\5\1\0\2\5\1\0\154\5\41\0\u016b\5\22\0"+ + "\100\5\2\0\66\5\50\0\15\5\3\0\20\6\20\0\4\6\17\0"+ + "\2\5\30\0\3\5\31\0\1\5\6\0\5\5\1\0\207\5\2\0"+ + "\1\6\4\0\1\5\13\0\12\6\7\0\32\5\4\0\1\5\1\0"+ + "\32\5\12\0\132\5\3\0\6\5\2\0\6\5\2\0\6\5\2\0"+ + "\3\5\3\0\2\5\3\0\2\5\22\0\3\6\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\1\2\1\3\2\4\1\1\1\5\2\6"+ + "\1\7\1\10\1\11\5\10\1\1\1\10\1\12\1\0"+ + "\1\13\1\14\2\3\1\0\1\11\6\10\1\3\1\11"+ + "\1\0\6\10\1\15\16\10\2\16"; + + private static int [] zzUnpackAction() { + int [] result = new int[64]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\41\0\102\0\143\0\204\0\245\0\306\0\347"+ + "\0\u0108\0\143\0\u0129\0\143\0\u014a\0\143\0\u016b\0\u018c"+ + "\0\u01ad\0\u01ce\0\u01ef\0\u0210\0\u0231\0\u0252\0\u0273\0\u0294"+ + "\0\143\0\245\0\143\0\143\0\u02b5\0\u02d6\0\u02f7\0\u0318"+ + "\0\u0339\0\u035a\0\u037b\0\u039c\0\u03bd\0\u03de\0\143\0\u03ff"+ + "\0\u03ff\0\u0420\0\u0441\0\u0462\0\u0483\0\u04a4\0\u04c5\0\u018c"+ + "\0\u04e6\0\u0507\0\u0528\0\u0549\0\u056a\0\u058b\0\u05ac\0\u05cd"+ + "\0\u05ee\0\u060f\0\u0630\0\u0651\0\u0672\0\u0693\0\u06b4\0\u018c"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[64]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\4\4\1\5\1\6\1\4\1\7\1\6\2\4\13\7"+ + "\2\4\1\7\3\4\3\7\2\4\1\10\1\11\1\12"+ + "\30\10\1\13\3\10\1\14\1\10\1\4\1\15\1\16"+ + "\1\17\1\4\1\20\1\4\2\20\1\21\1\4\1\22"+ + "\1\23\1\24\1\20\1\25\3\20\1\26\2\20\1\21"+ + "\1\27\1\20\1\4\1\21\1\4\1\20\1\30\1\20"+ + "\1\31\1\21\45\0\1\5\41\0\5\32\1\33\14\32"+ + "\1\0\1\32\1\0\1\32\1\0\3\32\1\0\1\32"+ + "\5\0\2\32\3\7\1\33\14\7\1\0\1\7\1\0"+ + "\1\7\1\0\3\7\1\0\1\7\1\10\2\0\30\10"+ + "\1\0\3\10\1\0\1\10\2\0\1\12\36\0\2\34"+ + "\1\0\23\34\1\35\3\34\1\36\5\34\1\35\2\0"+ + "\1\16\36\0\1\17\2\0\36\17\5\0\5\20\1\0"+ + "\14\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0"+ + "\1\20\11\0\1\21\4\0\1\37\7\0\1\21\1\40"+ + "\1\37\1\0\1\21\5\0\1\21\5\0\5\20\1\0"+ + "\1\20\1\41\12\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\1\0\1\20\5\0\5\20\1\0\3\20\1\42"+ + "\10\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0"+ + "\1\20\5\0\5\20\1\0\10\20\1\43\3\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0"+ + "\5\20\1\0\5\20\1\44\6\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\1\0\1\20\5\0\5\20\1\0"+ + "\2\20\1\45\11\20\1\0\1\20\1\0\1\20\1\0"+ + "\3\20\1\0\1\20\11\0\1\40\14\0\1\40\3\0"+ + "\1\40\5\0\1\40\5\0\5\20\1\0\14\20\1\0"+ + "\1\20\1\0\1\20\1\0\2\20\1\46\1\0\1\20"+ + "\26\0\1\36\3\0\1\36\5\0\1\36\26\0\1\47"+ + "\3\0\1\47\5\0\1\47\11\0\1\50\14\0\1\50"+ + "\2\0\1\51\1\50\5\0\1\50\11\0\1\40\4\0"+ + "\1\37\7\0\1\40\1\0\1\37\1\0\1\40\5\0"+ + "\1\40\5\0\5\20\1\0\2\20\1\52\11\20\1\0"+ + "\1\20\1\0\1\20\1\0\3\20\1\0\1\20\5\0"+ + "\5\20\1\0\14\20\1\0\1\20\1\0\1\20\1\0"+ + "\1\53\2\20\1\0\1\20\5\0\5\20\1\0\11\20"+ + "\1\54\2\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\1\0\1\20\5\0\5\20\1\0\6\20\1\55\5\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20"+ + "\5\0\5\20\1\0\6\20\1\56\5\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20"+ + "\1\0\10\20\1\57\3\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\1\0\1\20\11\0\1\50\14\0\1\50"+ + "\3\0\1\50\5\0\1\50\5\0\5\20\1\0\3\20"+ + "\1\60\10\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\1\0\1\20\5\0\5\20\1\0\12\20\1\61\1\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20"+ + "\5\0\5\20\1\0\3\20\1\62\10\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20"+ + "\1\0\7\20\1\52\4\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\1\0\1\20\5\0\5\20\1\0\6\20"+ + "\1\60\5\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\1\0\1\20\5\0\5\20\1\0\7\20\1\63\4\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20"+ + "\5\0\5\20\1\0\7\20\1\64\4\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20"+ + "\1\0\4\20\1\65\7\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\1\0\1\20\5\0\5\20\1\0\1\66"+ + "\13\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0"+ + "\1\20\5\0\5\20\1\0\1\67\13\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20"+ + "\1\0\12\20\1\70\1\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\1\0\1\20\5\0\5\20\1\0\5\20"+ + "\1\71\6\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\1\0\1\20\5\0\5\20\1\0\3\20\1\72\10\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20"+ + "\5\0\5\20\1\0\10\20\1\73\3\20\1\0\1\20"+ + "\1\0\1\20\1\0\3\20\1\0\1\20\5\0\5\20"+ + "\1\0\10\20\1\74\3\20\1\0\1\20\1\0\1\20"+ + "\1\0\3\20\1\0\1\20\5\0\5\20\1\0\1\20"+ + "\1\75\12\20\1\0\1\20\1\0\1\20\1\0\3\20"+ + "\1\0\1\20\5\0\5\20\1\0\3\20\1\76\10\20"+ + "\1\0\1\20\1\0\1\20\1\0\3\20\1\0\1\20"+ + "\5\0\5\20\1\0\1\75\13\20\1\0\1\20\1\0"+ + "\1\20\1\0\3\20\1\0\1\20\5\0\4\20\1\77"+ + "\1\0\13\20\1\100\1\0\1\20\1\0\1\77\1\0"+ + "\3\20\1\0\1\77\5\0\5\20\1\0\11\20\1\60"+ + "\2\20\1\0\1\20\1\0\1\20\1\0\3\20\1\0"+ + "\1\20\5\0\4\20\1\77\1\0\13\20\1\77\1\0"+ + "\1\20\1\0\1\77\1\0\3\20\1\0\1\77"; + + private static int [] zzUnpackTrans() { + int [] result = new int[1749]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\5\1\1\11\1\1\1\11\1\1\1\11"+ + "\12\1\1\11\1\0\2\11\2\1\1\0\7\1\1\11"+ + "\1\1\1\0\27\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[64]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public FlasmLexer() { + + } + + public int yychar() { + return yychar; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public FlasmLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public FlasmLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1736) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 4: + { yybegin(YYINITIAL); + return token(TokenType.ERROR,tokenStart, tokenLength); + } + case 15: break; + case 13: + { return token(TokenType.KEYWORD); + } + case 16: break; + case 11: + { return token(TokenType.IDENTIFIER,yychar,yylength()-1); + } + case 17: break; + case 10: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 18: break; + case 14: + { return token(TokenType.KEYWORD2); + } + case 19: break; + case 12: + { tokenLength += 2; + } + case 20: break; + case 5: + { yybegin(PARAMETERS); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 21: break; + case 8: + { return token(TokenType.IDENTIFIER); + } + case 22: break; + case 2: + { yybegin(PARAMETERS); + return token(TokenType.KEYWORD); + } + case 23: break; + case 7: + { return token(TokenType.COMMENT); + } + case 24: break; + case 9: + { return token(TokenType.NUMBER); + } + case 25: break; + case 6: + { yybegin(YYINITIAL); + } + case 26: break; + case 1: + { + } + case 27: break; + case 3: + { tokenLength += yylength(); + } + case 28: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/GroovyLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/GroovyLexer.java new file mode 100644 index 000000000..a9e7bdd5e --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/GroovyLexer.java @@ -0,0 +1,1708 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/groovy.flex + */ +public final class GroovyLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int JDOC = 10; + public static final int REGEX = 6; + public static final int STRING = 2; + public static final int GSTRING_EXPR = 8; + public static final int CHARLITERAL = 4; + public static final int ML_STRING = 14; + public static final int YYINITIAL = 0; + public static final int JDOC_TAG = 12; + public static final int ML_STRING_EXPR = 16; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, + 8, 8 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\112"+ + "\1\24\1\0\1\25\1\112\1\115\1\26\1\77\1\100\1\5\1\117"+ + "\1\105\1\23\1\21\1\4\1\10\1\16\2\15\4\17\2\11\1\114"+ + "\1\105\1\111\1\107\1\110\1\113\1\106\1\14\1\60\1\61\1\62"+ + "\1\22\1\20\2\120\1\63\2\120\1\12\1\75\1\70\1\64\1\71"+ + "\1\120\1\74\1\66\1\73\1\76\1\67\1\120\1\13\2\120\1\103"+ + "\1\27\1\104\1\112\1\6\1\0\1\30\1\31\1\35\1\47\1\40"+ + "\1\52\1\54\1\44\1\45\1\65\1\42\1\37\1\50\1\41\1\36"+ + "\1\53\1\72\1\34\1\32\1\33\1\46\1\55\1\56\1\51\1\43"+ + "\1\57\1\101\1\116\1\102\1\112\41\7\2\0\4\6\4\0\1\120"+ + "\2\0\1\7\7\0\1\120\4\0\1\120\5\0\27\120\1\0\37\120"+ + "\1\0\u013f\120\31\0\162\120\4\0\14\120\16\0\5\120\11\0\1\120"+ + "\21\0\130\7\5\0\23\7\12\0\1\120\13\0\1\120\1\0\3\120"+ + "\1\0\1\120\1\0\24\120\1\0\54\120\1\0\46\120\1\0\5\120"+ + "\4\0\202\120\1\0\4\7\3\0\105\120\1\0\46\120\2\0\2\120"+ + "\6\0\20\120\41\0\46\120\2\0\1\120\7\0\47\120\11\0\21\7"+ + "\1\0\27\7\1\0\3\7\1\0\1\7\1\0\2\7\1\0\1\7"+ + "\13\0\33\120\5\0\3\120\15\0\4\7\14\0\6\7\13\0\32\120"+ + "\5\0\13\120\16\7\7\0\12\7\4\0\2\120\1\7\143\120\1\0"+ + "\1\120\10\7\1\0\6\7\2\120\2\7\1\0\4\7\2\120\12\7"+ + "\3\120\2\0\1\120\17\0\1\7\1\120\1\7\36\120\33\7\2\0"+ + "\3\120\60\0\46\120\13\7\1\120\u014f\0\3\7\66\120\2\0\1\7"+ + "\1\120\20\7\2\0\1\120\4\7\3\0\12\120\2\7\2\0\12\7"+ + "\21\0\3\7\1\0\10\120\2\0\2\120\2\0\26\120\1\0\7\120"+ + "\1\0\1\120\3\0\4\120\2\0\1\7\1\120\7\7\2\0\2\7"+ + "\2\0\3\7\11\0\1\7\4\0\2\120\1\0\3\120\2\7\2\0"+ + "\12\7\2\120\2\6\15\0\3\7\1\0\6\120\4\0\2\120\2\0"+ + "\26\120\1\0\7\120\1\0\2\120\1\0\2\120\1\0\2\120\2\0"+ + "\1\7\1\0\5\7\4\0\2\7\2\0\3\7\13\0\4\120\1\0"+ + "\1\120\7\0\14\7\3\120\14\0\3\7\1\0\11\120\1\0\3\120"+ + "\1\0\26\120\1\0\7\120\1\0\2\120\1\0\5\120\2\0\1\7"+ + "\1\120\10\7\1\0\3\7\1\0\3\7\2\0\1\120\17\0\2\120"+ + "\2\7\2\0\12\7\1\0\1\6\17\0\3\7\1\0\10\120\2\0"+ + "\2\120\2\0\26\120\1\0\7\120\1\0\2\120\1\0\5\120\2\0"+ + "\1\7\1\120\6\7\3\0\2\7\2\0\3\7\10\0\2\7\4\0"+ + "\2\120\1\0\3\120\4\0\12\7\1\0\1\120\20\0\1\7\1\120"+ + "\1\0\6\120\3\0\3\120\1\0\4\120\3\0\2\120\1\0\1\120"+ + "\1\0\2\120\3\0\2\120\3\0\3\120\3\0\10\120\1\0\3\120"+ + "\4\0\5\7\3\0\3\7\1\0\4\7\11\0\1\7\17\0\11\7"+ + "\11\0\1\6\7\0\3\7\1\0\10\120\1\0\3\120\1\0\27\120"+ + "\1\0\12\120\1\0\5\120\4\0\7\7\1\0\3\7\1\0\4\7"+ + "\7\0\2\7\11\0\2\120\4\0\12\7\22\0\2\7\1\0\10\120"+ + "\1\0\3\120\1\0\27\120\1\0\12\120\1\0\5\120\2\0\1\7"+ + "\1\120\7\7\1\0\3\7\1\0\4\7\7\0\2\7\7\0\1\120"+ + "\1\0\2\120\4\0\12\7\22\0\2\7\1\0\10\120\1\0\3\120"+ + "\1\0\27\120\1\0\20\120\4\0\6\7\2\0\3\7\1\0\4\7"+ + "\11\0\1\7\10\0\2\120\4\0\12\7\22\0\2\7\1\0\22\120"+ + "\3\0\30\120\1\0\11\120\1\0\1\120\2\0\7\120\3\0\1\7"+ + "\4\0\6\7\1\0\1\7\1\0\10\7\22\0\2\7\15\0\60\120"+ + "\1\7\2\120\7\7\4\0\1\6\7\120\10\7\1\0\12\7\47\0"+ + "\2\120\1\0\1\120\2\0\2\120\1\0\1\120\2\0\1\120\6\0"+ + "\4\120\1\0\7\120\1\0\3\120\1\0\1\120\1\0\1\120\2\0"+ + "\2\120\1\0\4\120\1\7\2\120\6\7\1\0\2\7\1\120\2\0"+ + "\5\120\1\0\1\120\1\0\6\7\2\0\12\7\2\0\2\120\42\0"+ + "\1\120\27\0\2\7\6\0\12\7\13\0\1\7\1\0\1\7\1\0"+ + "\1\7\4\0\2\7\10\120\1\0\42\120\6\0\24\7\1\0\2\7"+ + "\4\120\4\0\10\7\1\0\44\7\11\0\1\7\71\0\42\120\1\0"+ + "\5\120\1\0\2\120\1\0\7\7\3\0\4\7\6\0\12\7\6\0"+ + "\6\120\4\7\106\0\46\120\12\0\51\120\7\0\132\120\5\0\104\120"+ + "\5\0\122\120\6\0\7\120\1\0\77\120\1\0\1\120\1\0\4\120"+ + "\2\0\7\120\1\0\1\120\1\0\4\120\2\0\47\120\1\0\1\120"+ + "\1\0\4\120\2\0\37\120\1\0\1\120\1\0\4\120\2\0\7\120"+ + "\1\0\1\120\1\0\4\120\2\0\7\120\1\0\7\120\1\0\27\120"+ + "\1\0\37\120\1\0\1\120\1\0\4\120\2\0\7\120\1\0\47\120"+ + "\1\0\23\120\16\0\11\7\56\0\125\120\14\0\u026c\120\2\0\10\120"+ + "\12\0\32\120\5\0\113\120\3\0\3\6\17\0\15\120\1\0\4\120"+ + "\3\7\13\0\22\120\3\7\13\0\22\120\2\7\14\0\15\120\1\0"+ + "\3\120\1\0\2\7\14\0\64\120\40\7\3\0\1\120\3\0\1\6"+ + "\1\120\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0\130\120"+ + "\10\0\51\120\1\7\126\0\35\120\3\0\14\7\4\0\14\7\12\0"+ + "\12\7\36\120\2\0\5\120\u038b\0\154\120\224\0\234\120\4\0\132\120"+ + "\6\0\26\120\2\0\6\120\2\0\46\120\2\0\6\120\2\0\10\120"+ + "\1\0\1\120\1\0\1\120\1\0\1\120\1\0\37\120\2\0\65\120"+ + "\1\0\7\120\1\0\1\120\3\0\3\120\1\0\7\120\3\0\4\120"+ + "\2\0\6\120\4\0\15\120\5\0\3\120\1\0\7\120\17\0\4\7"+ + "\32\0\5\7\20\0\2\6\23\0\1\6\13\0\4\7\6\0\6\7"+ + "\1\0\1\120\15\0\1\120\40\0\22\6\36\0\15\7\4\0\1\7"+ + "\3\0\6\7\27\0\1\120\4\0\1\120\2\0\12\120\1\0\1\120"+ + "\3\0\5\120\6\0\1\120\1\0\1\120\1\0\1\120\1\0\4\120"+ + "\1\0\3\120\1\0\7\120\3\0\3\120\5\0\5\120\26\0\44\6"+ + "\u0e81\0\2\120\1\6\31\0\11\6\6\7\1\0\5\120\2\0\3\6"+ + "\2\120\4\0\126\120\2\0\2\7\2\0\3\120\1\0\132\120\1\6"+ + "\4\120\5\0\50\120\4\0\136\120\21\0\30\120\70\0\20\120\u0200\0"+ + "\u19b6\120\112\0\u51a6\120\132\0\u048d\120\u0773\0\u2ba4\120\u215c\0\u012e\120\2\0"+ + "\73\120\225\0\7\120\14\0\5\120\5\0\1\120\1\7\12\120\1\0"+ + "\15\120\1\0\5\120\1\0\1\120\1\0\2\120\1\0\2\120\1\0"+ + "\154\120\41\0\u016b\120\22\0\100\120\2\0\66\120\50\0\14\120\1\6"+ + "\3\0\20\7\20\0\4\7\17\0\2\6\30\0\3\6\31\0\1\6"+ + "\6\0\5\120\1\0\207\120\2\0\1\7\4\0\1\6\13\0\12\7"+ + "\7\0\32\120\4\0\1\6\1\0\32\120\12\0\1\6\131\120\3\0"+ + "\6\120\2\0\6\120\2\0\6\120\2\0\3\120\3\0\2\6\3\0"+ + "\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\11\0\1\1\1\2\2\3\1\4\2\5\2\4\1\3"+ + "\1\4\1\3\1\6\1\7\34\4\1\10\1\11\1\12"+ + "\1\13\1\14\1\15\7\3\1\16\2\17\1\20\2\1"+ + "\1\16\1\21\1\1\1\16\1\22\1\16\1\23\1\24"+ + "\1\23\1\25\2\26\6\16\1\27\1\0\1\30\1\0"+ + "\1\3\3\5\1\0\3\5\1\0\3\4\1\0\1\4"+ + "\1\31\26\4\1\31\1\4\2\31\40\4\1\3\1\32"+ + "\1\33\2\16\1\34\1\0\1\35\1\0\2\30\1\0"+ + "\1\36\4\5\1\0\4\4\1\37\30\4\1\31\2\4"+ + "\1\31\44\4\1\40\1\41\2\0\2\5\37\4\1\42"+ + "\30\4\2\5\11\4\1\31\10\4\1\31\2\4\1\31"+ + "\2\4\1\42\22\4\2\5\31\4\1\42\5\4\1\42"+ + "\2\4\2\5\35\4\2\5\27\4\2\5\1\4\1\43"+ + "\24\4\2\5\20\4\1\0\1\5\11\4\1\0\1\5"+ + "\10\4\1\0\1\5\6\4\1\0\1\5\3\4\1\0"+ + "\1\5\1\4\1\0\1\5\1\0\1\5\1\0\5\5"; + + private static int [] zzUnpackAction() { + int [] result = new int[540]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\121\0\242\0\363\0\u0144\0\u0195\0\u01e6\0\u0237"+ + "\0\u0288\0\u02d9\0\u032a\0\u037b\0\u03cc\0\u041d\0\u046e\0\u04bf"+ + "\0\u0510\0\u0561\0\u05b2\0\u0603\0\u0654\0\u06a5\0\u02d9\0\u06f6"+ + "\0\u0747\0\u0798\0\u07e9\0\u083a\0\u088b\0\u08dc\0\u092d\0\u097e"+ + "\0\u09cf\0\u0a20\0\u0a71\0\u0ac2\0\u0b13\0\u0b64\0\u0bb5\0\u0c06"+ + "\0\u0c57\0\u0ca8\0\u0cf9\0\u0d4a\0\u0d9b\0\u0dec\0\u0e3d\0\u0e8e"+ + "\0\u0edf\0\u0f30\0\u0f81\0\u02d9\0\u02d9\0\u02d9\0\u02d9\0\u02d9"+ + "\0\u02d9\0\u02d9\0\u0fd2\0\u1023\0\u1074\0\u10c5\0\u1116\0\u1167"+ + "\0\u11b8\0\u1209\0\u02d9\0\u02d9\0\u125a\0\u12ab\0\u12fc\0\u02d9"+ + "\0\u134d\0\u139e\0\u02d9\0\u13ef\0\u02d9\0\u02d9\0\u1440\0\u02d9"+ + "\0\u02d9\0\u1440\0\u1491\0\u02d9\0\u14e2\0\u1533\0\u1584\0\u12ab"+ + "\0\u02d9\0\u15d5\0\u1626\0\u1677\0\u15d5\0\u16c8\0\u1719\0\u02d9"+ + "\0\u176a\0\u17bb\0\u180c\0\u185d\0\u18ae\0\u18ff\0\u1950\0\u19a1"+ + "\0\u19f2\0\u1a43\0\u1a94\0\u1ae5\0\u1b36\0\u1b87\0\u1bd8\0\u1c29"+ + "\0\u1c7a\0\u1ccb\0\u1d1c\0\u1d6d\0\u1dbe\0\u1e0f\0\u1e60\0\u1eb1"+ + "\0\u1f02\0\u1f53\0\u1fa4\0\u1ff5\0\u2046\0\u2097\0\u20e8\0\u2139"+ + "\0\u218a\0\u21db\0\u222c\0\u041d\0\u227d\0\u22ce\0\u231f\0\u2370"+ + "\0\u23c1\0\u2412\0\u2463\0\u24b4\0\u2505\0\u2556\0\u25a7\0\u25f8"+ + "\0\u2649\0\u269a\0\u26eb\0\u273c\0\u278d\0\u27de\0\u282f\0\u2880"+ + "\0\u28d1\0\u2922\0\u2973\0\u29c4\0\u2a15\0\u2a66\0\u2ab7\0\u2b08"+ + "\0\u2b59\0\u2baa\0\u2bfb\0\u2c4c\0\u2c9d\0\u2cee\0\u02d9\0\u02d9"+ + "\0\u2d3f\0\u2d90\0\u02d9\0\u2de1\0\u02d9\0\u2e32\0\u2e83\0\u02d9"+ + "\0\u2ed4\0\u2f25\0\u2f76\0\u2fc7\0\u3018\0\u3069\0\u30ba\0\u310b"+ + "\0\u315c\0\u31ad\0\u31fe\0\u02d9\0\u324f\0\u32a0\0\u32f1\0\u3342"+ + "\0\u3393\0\u33e4\0\u3435\0\u3486\0\u34d7\0\u3528\0\u3579\0\u35ca"+ + "\0\u361b\0\u366c\0\u36bd\0\u370e\0\u375f\0\u37b0\0\u3801\0\u3852"+ + "\0\u38a3\0\u38f4\0\u3945\0\u3996\0\u39e7\0\u3a38\0\u3a89\0\u3ada"+ + "\0\u3b2b\0\u3b7c\0\u3bcd\0\u3c1e\0\u3c6f\0\u3cc0\0\u3d11\0\u3d62"+ + "\0\u3db3\0\u3e04\0\u3e55\0\u3ea6\0\u3ef7\0\u3f48\0\u3f99\0\u3fea"+ + "\0\u403b\0\u408c\0\u40dd\0\u412e\0\u417f\0\u41d0\0\u4221\0\u4272"+ + "\0\u42c3\0\u4314\0\u4365\0\u43b6\0\u4407\0\u4458\0\u44a9\0\u44fa"+ + "\0\u454b\0\u459c\0\u45ed\0\u463e\0\u02d9\0\u02d9\0\u468f\0\u2f25"+ + "\0\u46e0\0\u4731\0\u4782\0\u47d3\0\u4824\0\u4875\0\u48c6\0\u4917"+ + "\0\u4968\0\u49b9\0\u4a0a\0\u4a5b\0\u4aac\0\u4afd\0\u4b4e\0\u4b9f"+ + "\0\u4bf0\0\u4c41\0\u4c92\0\u4ce3\0\u4d34\0\u4d85\0\u4dd6\0\u4e27"+ + "\0\u4e78\0\u4ec9\0\u4f1a\0\u4f6b\0\u4fbc\0\u500d\0\u505e\0\u50af"+ + "\0\u5100\0\u041d\0\u5151\0\u51a2\0\u51f3\0\u5244\0\u5295\0\u52e6"+ + "\0\u5337\0\u5388\0\u53d9\0\u542a\0\u547b\0\u54cc\0\u551d\0\u556e"+ + "\0\u55bf\0\u5610\0\u5661\0\u56b2\0\u5703\0\u5754\0\u57a5\0\u57f6"+ + "\0\u5847\0\u5898\0\u58e9\0\u593a\0\u598b\0\u59dc\0\u5a2d\0\u5a7e"+ + "\0\u5acf\0\u5b20\0\u5b71\0\u5bc2\0\u5c13\0\u366c\0\u5c64\0\u5cb5"+ + "\0\u5d06\0\u5d57\0\u5da8\0\u5df9\0\u5e4a\0\u5e9b\0\u5eec\0\u5f3d"+ + "\0\u5f8e\0\u5fdf\0\u6030\0\u6081\0\u60d2\0\u6123\0\u6174\0\u61c5"+ + "\0\u6216\0\u6267\0\u62b8\0\u6309\0\u635a\0\u63ab\0\u63fc\0\u644d"+ + "\0\u649e\0\u64ef\0\u6540\0\u6591\0\u65e2\0\u6633\0\u6684\0\u66d5"+ + "\0\u6726\0\u6777\0\u67c8\0\u6819\0\u686a\0\u68bb\0\u690c\0\u695d"+ + "\0\u69ae\0\u69ff\0\u6a50\0\u6aa1\0\u6af2\0\u6b43\0\u6b94\0\u6be5"+ + "\0\u6c36\0\u6c87\0\u6cd8\0\u6d29\0\u6d7a\0\u6dcb\0\u6e1c\0\u6e6d"+ + "\0\u6ebe\0\u6f0f\0\u6f60\0\u6fb1\0\u7002\0\u7053\0\u70a4\0\u70f5"+ + "\0\u7146\0\u7197\0\u71e8\0\u7239\0\u728a\0\u72db\0\u732c\0\u737d"+ + "\0\u73ce\0\u741f\0\u7470\0\u74c1\0\u7512\0\u7563\0\u75b4\0\u7605"+ + "\0\u7656\0\u76a7\0\u76f8\0\u7749\0\u779a\0\u77eb\0\u783c\0\u788d"+ + "\0\u78de\0\u792f\0\u7980\0\u79d1\0\u7a22\0\u7a73\0\u7ac4\0\u7b15"+ + "\0\u7b66\0\u7bb7\0\u7c08\0\u7c59\0\u7caa\0\u7cfb\0\u7d4c\0\u7d9d"+ + "\0\u7dee\0\u7e3f\0\u7e90\0\u7ee1\0\u7f32\0\u7f83\0\u7fd4\0\u8025"+ + "\0\u8076\0\u80c7\0\u8118\0\u8169\0\u81ba\0\u820b\0\u825c\0\u82ad"+ + "\0\u82fe\0\u834f\0\u83a0\0\u83f1\0\u8442\0\u8493\0\u041d\0\u84e4"+ + "\0\u8535\0\u8586\0\u85d7\0\u8628\0\u8679\0\u86ca\0\u871b\0\u876c"+ + "\0\u87bd\0\u880e\0\u885f\0\u88b0\0\u8901\0\u8952\0\u89a3\0\u89f4"+ + "\0\u8a45\0\u8a96\0\u8ae7\0\u8b38\0\u8b89\0\u8bda\0\u8c2b\0\u8c7c"+ + "\0\u8ccd\0\u8d1e\0\u8d6f\0\u8dc0\0\u8e11\0\u8e62\0\u8eb3\0\u8f04"+ + "\0\u8f55\0\u8fa6\0\u8ff7\0\u9048\0\u9099\0\u90ea\0\u913b\0\u918c"+ + "\0\u91dd\0\u922e\0\u927f\0\u92d0\0\u9321\0\u9372\0\u93c3\0\u9414"+ + "\0\u9465\0\u94b6\0\u9507\0\u9558\0\u95a9\0\u95fa\0\u964b\0\u969c"+ + "\0\u96ed\0\u973e\0\u978f\0\u97e0\0\u9831\0\u9882\0\u98d3\0\u9924"+ + "\0\u9975\0\u99c6\0\u9a17\0\u9a68\0\u9ab9\0\u9b0a\0\u9b5b\0\u9bac"+ + "\0\u9bfd\0\u9c4e\0\u9c9f\0\u9cf0\0\u9d41\0\u9d92\0\u9de3\0\u9e34"+ + "\0\u9e85\0\u9ed6\0\u9f27\0\u9f78"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[540]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\12\3\13\1\14\1\15\1\16\1\12\1\17\1\20"+ + "\2\16\1\21\3\20\1\22\1\23\1\24\1\25\1\26"+ + "\1\16\1\27\1\12\1\30\1\31\1\32\1\33\1\34"+ + "\1\35\1\16\1\36\1\37\1\40\3\16\1\41\1\16"+ + "\1\42\2\16\1\43\1\44\1\45\1\46\1\47\1\16"+ + "\1\50\1\51\1\52\1\53\1\54\1\16\1\55\1\56"+ + "\1\57\1\60\1\16\1\61\1\62\1\16\1\63\1\64"+ + "\1\65\1\66\1\67\1\70\1\71\2\72\1\15\1\73"+ + "\1\74\1\15\1\75\1\72\1\76\1\77\1\100\1\16"+ + "\1\101\1\102\1\103\21\101\1\104\1\105\1\101\1\106"+ + "\71\101\1\107\1\102\1\103\23\107\1\110\1\111\71\107"+ + "\1\112\1\102\1\103\1\112\1\113\22\112\1\114\71\112"+ + "\1\115\2\12\21\115\2\12\1\115\1\12\52\115\1\116"+ + "\23\115\1\117\100\115\1\120\12\115\5\121\1\122\4\121"+ + "\3\123\3\121\1\123\1\121\1\123\5\121\47\123\21\121"+ + "\1\123\1\124\1\125\22\124\1\126\1\127\1\124\1\130"+ + "\71\124\102\115\1\131\16\115\122\0\3\13\115\0\4\132"+ + "\1\133\1\134\101\132\1\135\11\132\107\0\1\72\17\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\47\16\21\0"+ + "\1\16\10\0\1\136\1\137\1\140\1\141\1\0\1\142"+ + "\1\143\1\142\1\140\1\144\1\145\14\0\1\140\1\145"+ + "\6\0\1\140\1\0\1\141\1\140\7\0\1\140\46\0"+ + "\2\20\1\140\2\0\3\20\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\44\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\146\42\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\7\16\1\147\37\16\21\0\1\16"+ + "\10\0\2\144\3\0\3\144\107\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\21\16\1\150\25\16\21\0\1\16"+ + "\23\0\1\72\63\0\1\72\35\0\1\151\102\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\1\16\1\152\1\153"+ + "\44\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\4\16\1\154\1\16\1\155\4\16\1\156"+ + "\33\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\157\7\16\1\160\1\161\1\16"+ + "\1\162\7\16\1\163\20\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\4\16\1\164\7\16"+ + "\1\165\32\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\166\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\167"+ + "\5\16\1\170\1\171\4\16\1\172\32\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\173\40\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\7\16\1\174\1\16\1\175\7\16"+ + "\1\176\25\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\1\177\7\16\1\200\5\16\1\201"+ + "\30\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\11\16\1\202\6\16\1\203\1\16\1\204"+ + "\24\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\6\16\1\205\1\16\1\206\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\1\207\5\16\1\210\1\211\5\16\1\212\31\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\1\213\3\16\1\214\11\16\1\215\30\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\216\40\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\217\40\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\14\16"+ + "\1\220\32\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\221\4\16\1\222\33\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\6\16\1\223\1\224\4\16\1\225\32\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\226\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\7\16\1\227\1\16\1\230"+ + "\35\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\16\1\231\45\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\3\16\1\232"+ + "\4\16\1\233\3\16\1\234\32\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\6\16\1\235"+ + "\40\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\6\16\1\236\1\16\1\237\5\16\1\240"+ + "\30\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\241\46\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\14\16\1\242\32\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\10\16\1\243\5\16\1\244\30\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\11\16"+ + "\1\245\35\16\21\0\1\16\107\0\1\72\1\246\117\0"+ + "\1\72\1\0\1\15\30\0\1\72\206\0\1\72\5\0"+ + "\1\72\112\0\1\72\6\0\1\72\111\0\1\72\7\0"+ + "\1\72\1\0\1\101\2\0\21\101\2\0\1\101\1\0"+ + "\71\101\2\0\1\103\217\0\1\247\17\0\2\250\1\0"+ + "\5\250\1\251\4\250\2\251\1\252\101\250\1\107\2\0"+ + "\23\107\2\0\71\107\2\250\1\0\116\250\1\112\2\0"+ + "\1\112\1\0\115\112\1\250\1\0\1\112\1\250\114\112"+ + "\4\0\1\253\126\0\3\123\3\0\1\123\1\0\1\123"+ + "\5\0\47\123\15\0\1\124\3\0\1\123\2\0\1\124"+ + "\142\0\1\254\175\0\1\255\17\0\1\256\2\0\1\256"+ + "\1\0\114\256\1\133\1\257\1\260\116\133\5\261\1\262"+ + "\113\261\10\0\1\136\1\137\1\140\2\0\1\142\1\143"+ + "\1\142\1\140\1\144\1\145\14\0\1\140\1\145\6\0"+ + "\1\140\2\0\1\140\7\0\1\140\46\0\2\137\3\0"+ + "\3\137\1\140\1\144\1\145\15\0\1\145\6\0\1\140"+ + "\2\0\1\140\7\0\1\140\46\0\1\263\1\264\2\0"+ + "\5\264\1\0\1\264\5\0\2\264\3\0\1\264\2\0"+ + "\1\264\6\0\1\264\2\0\1\264\5\0\3\264\46\0"+ + "\1\265\1\137\1\140\2\0\3\265\1\140\1\144\1\145"+ + "\14\0\1\140\1\145\6\0\1\140\2\0\1\140\7\0"+ + "\1\140\46\0\1\142\1\137\1\140\2\0\3\142\1\140"+ + "\1\144\1\145\14\0\1\140\1\145\6\0\1\140\2\0"+ + "\1\140\7\0\1\140\46\0\2\144\3\0\3\144\1\140"+ + "\1\0\1\145\15\0\1\145\6\0\1\140\2\0\1\140"+ + "\7\0\1\140\46\0\2\266\3\0\3\266\3\0\1\267"+ + "\73\0\1\267\7\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\4\16\1\270\10\16\1\271\31\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\272\40\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\273\41\16\21\0\1\16"+ + "\24\0\1\274\102\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\2\16\1\275\44\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\2\16\1\276\44\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\10\16\1\277\36\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\6\16\1\300\40\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\301\43\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\1\302\3\16\1\303"+ + "\42\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\11\16\1\304\35\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\6\16\1\305"+ + "\40\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\23\16\1\306\23\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\15\16\1\307"+ + "\31\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\310\12\16\1\204\2\16\1\301\30\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\4\16\1\311\10\16\1\312\31\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\313\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\2\16\1\301\1\314\43\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\11\16\1\315\35\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\316\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\210"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\11\16\1\317\35\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\2\16\1\301"+ + "\44\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\16\16\1\320\30\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\3\16\1\321"+ + "\43\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\322\43\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\26\16\1\204"+ + "\20\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\7\16\1\323\37\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\2\16\1\324"+ + "\1\325\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\23\16\1\326\23\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\16\16"+ + "\1\327\30\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\22\16\1\330\24\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\7\16"+ + "\1\174\37\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\4\16\1\204\42\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\331\40\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\11\16\1\332\35\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\5\16"+ + "\1\333\41\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\334\6\16\1\335\31\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\16\1\336\45\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\3\16\1\337\43\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\7\16\1\340\5\16\1\341\31\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\342\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\343\40\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\344\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\20\16\1\345\26\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\346"+ + "\5\16\1\347\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\350\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\16\16"+ + "\1\351\30\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\7\16\1\352\37\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\2\16"+ + "\1\353\1\354\13\16\1\355\27\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\35\16\1\356"+ + "\11\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\4\16\1\357\42\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\360"+ + "\1\361\41\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\362\40\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\363\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\36\16\1\364\10\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\24\16"+ + "\1\365\22\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\7\16\1\366\10\16\1\367\26\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\5\16\1\370\41\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\4\16\1\371\42\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\24\16\1\372\22\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\11\16\1\373\35\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\2\16\1\374\44\16\21\0\1\16\107\0\1\72"+ + "\1\15\20\0\1\252\4\0\3\252\111\0\1\124\4\0"+ + "\3\124\125\0\1\375\74\0\1\256\2\0\1\256\1\376"+ + "\114\256\2\0\1\260\116\0\5\261\1\377\113\261\4\0"+ + "\1\260\1\u0100\123\0\1\263\1\264\1\140\1\0\5\264"+ + "\1\0\1\264\5\0\2\264\3\0\1\264\1\0\1\140"+ + "\1\264\6\0\1\264\2\0\1\264\5\0\3\264\46\0"+ + "\2\u0101\1\140\1\0\5\u0101\1\0\1\u0101\5\0\2\u0101"+ + "\3\0\1\u0101\1\0\1\140\1\u0101\6\0\1\u0101\2\0"+ + "\1\u0101\5\0\3\u0101\46\0\1\u0102\1\137\1\140\2\0"+ + "\3\u0102\1\140\1\144\1\145\14\0\1\140\1\145\6\0"+ + "\1\140\2\0\1\140\7\0\1\140\46\0\2\266\3\0"+ + "\3\266\1\140\26\0\1\140\2\0\1\140\7\0\1\140"+ + "\46\0\2\266\3\0\3\266\107\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\1\u0103\46\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\3\16\1\u0104"+ + "\43\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\u0105\46\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\10\16\1\u0106\36\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u0107\43\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\2\16\1\u0108\44\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\u0109\46\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\7\16\1\u010a\37\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\10\16\1\204\36\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\3\16\1\u010b\43\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u010c\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\u010d\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\4\16\1\u010e\42\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\210\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\314\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\11\16\1\u010f\35\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\u0110\1\16\1\u0111\36\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\2\16\1\204"+ + "\44\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\16\16\1\u0112\30\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\5\16\1\u0113"+ + "\41\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\2\16\1\u010e\1\u0114\43\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\2\16"+ + "\1\312\44\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\24\16\1\204\22\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\20\16"+ + "\1\204\26\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u0115\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\u0116\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\7\16\1\204\37\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\u0117\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u0118\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\305\1\u0119\37\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\16\1\342\45\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\1\u011a\46\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\1\u010e\46\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\1\u011b\46\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\12\16\1\u011c\34\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\3\16\1\u011d\43\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\11\16\1\u011e\13\16\1\u011f\21\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\7\16"+ + "\1\u010b\37\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\204\40\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\u0120"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\17\16\1\204\27\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\7\16\1\301"+ + "\37\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\7\16\1\u0121\37\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u0122"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\23\16\1\u0123\23\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\2\16\1\u0124"+ + "\44\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\11\16\1\u0125\35\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\u0126"+ + "\42\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\16\1\u0127\45\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u0128"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\u0129\43\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u012a"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\10\16\1\u012b\36\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u012c"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\15\16\1\u012d\31\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\15\16\1\u012e"+ + "\31\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\16\16\1\u012f\30\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\u0105"+ + "\42\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\17\16\1\u0122\27\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\16\16\1\u0130"+ + "\30\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\u0131\46\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\7\16\1\u0132\37\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\16\1\u0133\45\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\12\16\1\u0134\34\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\6\16\1\u0135\1\16\1\u0136\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\10\16"+ + "\1\u0137\36\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\3\16\1\u0138\5\16\1\u0139\35\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\16\16\1\u013a\30\16\21\0\1\16\4\261\1\260"+ + "\1\377\113\261\10\0\2\u013b\1\140\1\0\5\u013b\1\0"+ + "\1\u013b\5\0\2\u013b\3\0\1\u013b\1\0\1\140\1\u013b"+ + "\6\0\1\u013b\2\0\1\u013b\5\0\3\u013b\46\0\1\u013c"+ + "\1\137\1\140\2\0\3\u013c\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\44\0\13\16\1\0\1\16\2\0\1\16\2\0\13\16"+ + "\1\u013d\33\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\14\16\1\u013e\32\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\u0122\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\23\16\1\u013f\23\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\u0140\42\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\305\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\12\16"+ + "\1\204\34\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u0141\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\u0142\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\u0143\41\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\14\16"+ + "\1\u0144\32\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\3\16\1\204\43\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\2\16"+ + "\1\u0145\44\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\26\16\1\u0146\20\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\u0147"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\4\16\1\u0148\42\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\14\16\1\204"+ + "\32\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\15\16\1\u0149\31\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\11\16\1\u014a"+ + "\35\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\25\16\1\301\21\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\1\u014b\46\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\4\16\1\u014c\42\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\10\16\1\u014d\36\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\16\16\1\u014e\30\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\7\16\1\u014f\37\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\u0150\46\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\u0151\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u0152\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\156\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\220\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u0153\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\u0154"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\2\16\1\u0155\44\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u0156"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\u0157\35\16\1\u0158\10\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\7\16"+ + "\1\344\37\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\24\16\1\u0159\22\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\u015a"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\4\16\1\u015b\17\16\1\u015c\22\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\21\16\1\u015d\25\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\u0105\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\11\16\1\u015e\35\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\u015f\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\u0160\42\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\u0161\41\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\u0162\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\41\16\1\u0163\5\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\10\16"+ + "\1\u0164\36\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\1\u0165\46\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\26\16\1\u0139"+ + "\20\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\363\46\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\21\16\1\u0122\25\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\15\16\1\u0166\31\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\1\351\46\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\23\16\1\u0167\23\16\21\0\1\16\10\0\2\u0168\1\140"+ + "\1\0\5\u0168\1\0\1\u0168\5\0\2\u0168\3\0\1\u0168"+ + "\1\0\1\140\1\u0168\6\0\1\u0168\2\0\1\u0168\5\0"+ + "\3\u0168\46\0\1\u0169\1\137\1\140\2\0\3\u0169\1\140"+ + "\1\144\1\145\14\0\1\140\1\145\6\0\1\140\2\0"+ + "\1\140\7\0\1\140\44\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\33\16\1\u016a\13\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\20\16\1\u016b"+ + "\26\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\u016c\43\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\1\u016d\46\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\u0148\46\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\204\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u016e\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\4\16\1\u016f\42\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u0170\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\17\16\1\u0171\27\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\11\16\1\204\35\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\11\16\1\u0172\35\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\17\16\1\312\27\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\11\16\1\u0173\35\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\22\16\1\u0174\24\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\20\16\1\u0175\26\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\7\16\1\u010e\37\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\7\16\1\u0176\37\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\24\16\1\301\22\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\u0177\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\7\16\1\u0148\37\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\u0178\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\u0139\42\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\31\16\1\u0179\6\16\1\u017a\6\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\351\37\16\1\u017b\6\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\5\16\1\u017c"+ + "\41\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\10\16\1\u017d\36\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\1\u017e\46\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\11\16\1\u017f\35\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\4\16\1\u0180\42\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\10\16\1\u0181\36\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\34\16\1\u0182\12\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\24\16\1\u0183\22\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\7\16\1\u0184\37\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\15\16\1\u0185\31\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\14\16\1\u0186\32\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\15\16\1\u0187\31\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\6\16\1\u0188\40\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\4\16\1\u0189\42\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\24\16\1\344\22\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\20\16\1\u018a\26\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\23\16\1\u018b\23\16"+ + "\21\0\1\16\10\0\2\u018c\1\140\1\0\5\u018c\1\0"+ + "\1\u018c\5\0\2\u018c\3\0\1\u018c\1\0\1\140\1\u018c"+ + "\6\0\1\u018c\2\0\1\u018c\5\0\3\u018c\46\0\1\u018d"+ + "\1\137\1\140\2\0\3\u018d\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\44\0\13\16\1\0\1\16\2\0\1\16\2\0\11\16"+ + "\1\u018e\35\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u018f\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\u0190\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\u010e\41\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\22\16"+ + "\1\u0191\24\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\u0192\40\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\10\16"+ + "\1\u0193\36\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\2\16\1\u0194\44\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\16\16"+ + "\1\301\30\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\u0195\41\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\1\u0196"+ + "\46\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\10\16\1\u0197\36\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\13\16\1\204"+ + "\33\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\u0198\43\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\11\16\1\u0122"+ + "\35\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\1\u0199\46\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\6\16\1\u019a\40\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\6\16\1\u019b\40\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\3\16\1\u015c\43\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\42\16\1\u019c\4\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\7\16\1\u019d\37\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u019e\43\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\16\16\1\u019f\30\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\4\16\1\u0122\42\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\16\16\1\u01a0\30\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\30\16\1\u01a1\2\16\1\u016a\13\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\u01a2\31\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\3\16\1\u01a3\43\16\21\0\1\16"+ + "\6\0\12\16\1\u01a4\1\0\1\16\2\0\1\16\2\0"+ + "\45\16\1\u01a5\1\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\25\16\1\u01a6\21\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01a7\31\16\21\0\1\16\6\0\12\16\1\u01a8"+ + "\1\0\1\16\2\0\1\16\2\0\47\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\10\16"+ + "\1\u01a9\36\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\6\16\1\u01aa\40\16\21\0\1\16"+ + "\10\0\2\u01ab\1\140\1\0\5\u01ab\1\0\1\u01ab\5\0"+ + "\2\u01ab\3\0\1\u01ab\1\0\1\140\1\u01ab\6\0\1\u01ab"+ + "\2\0\1\u01ab\5\0\3\u01ab\46\0\1\u01ac\1\137\1\140"+ + "\2\0\3\u01ac\1\140\1\144\1\145\14\0\1\140\1\145"+ + "\6\0\1\140\2\0\1\140\7\0\1\140\44\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\17\16\1\355\27\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u01ad\43\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\6\16\1\u01ae\40\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\23\16\1\204\23\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\11\16\1\u01af\35\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\11\16\1\u010e\35\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\1\u01b0\46\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\10\16\1\u01b1\36\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\301\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\11\16\1\u01b2\35\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\341\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\2\16\1\u01b3\44\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\3\16\1\u01b4\43\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u01b5\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\16\16\1\u01b6\30\16\21\0"+ + "\1\16\6\0\6\16\1\u01b7\4\16\1\0\1\16\2\0"+ + "\1\16\2\0\36\16\1\u01b8\4\16\1\u01b9\3\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01ba\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\23\16\1\u01bb\23\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u01bc\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\16\16\1\u01bd\30\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\27\16\1\u0139\17\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\13\16\1\u01a9\33\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01be\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\u01bf\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\10\16\1\u01c0\36\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\11\16\1\u01c1\35\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\u01c2\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\24\2\0\1\16\2\0\47\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\u01c3"+ + "\42\16\21\0\1\16\10\0\2\u01c4\1\140\1\0\5\u01c4"+ + "\1\0\1\u01c4\5\0\2\u01c4\3\0\1\u01c4\1\0\1\140"+ + "\1\u01c4\6\0\1\u01c4\2\0\1\u01c4\5\0\3\u01c4\46\0"+ + "\1\u01c5\1\137\1\140\2\0\3\u01c5\1\140\1\144\1\145"+ + "\14\0\1\140\1\145\6\0\1\140\2\0\1\140\7\0"+ + "\1\140\44\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01c6\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\11\16\1\u01c7\35\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01c8\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\22\16\1\301\24\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\u01c9\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\3\16\1\312\43\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u01a9\43\16\21\0\1\16\6\0\12\16\1\u01ca"+ + "\1\0\1\16\2\0\1\16\2\0\47\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\36\16"+ + "\1\u01cb\10\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u01cc\36\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\u01cd\1\u01ce\41\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\3\16\1\u01cf\43\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\14\16\1\u01d0\32\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\u01d1\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\3\16"+ + "\1\u01d2\43\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\34\16\1\u01d3\12\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\15\16"+ + "\1\u01d4\4\16\1\u01d5\24\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\10\16\1\u01d6\36\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u01d7\43\16\21\0\1\16\6\0\6\16"+ + "\1\u01d8\4\16\1\0\1\16\2\0\1\16\2\0\47\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u01d9\43\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\4\16\1\u01da\42\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\3\16\1\u01db\43\16\21\0\1\16\10\0\2\u01dc"+ + "\1\140\1\0\5\u01dc\1\0\1\u01dc\5\0\2\u01dc\3\0"+ + "\1\u01dc\1\0\1\140\1\u01dc\6\0\1\u01dc\2\0\1\u01dc"+ + "\5\0\3\u01dc\46\0\1\u01dd\1\137\1\140\2\0\3\u01dd"+ + "\1\140\1\144\1\145\14\0\1\140\1\145\6\0\1\140"+ + "\2\0\1\140\7\0\1\140\44\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\5\16\1\u01a9\41\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\27\16"+ + "\1\u0198\17\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\22\16\1\204\24\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\6\16"+ + "\1\u01de\40\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\16\16\1\u01df\30\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\11\16"+ + "\1\u01e0\35\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\24\16\1\u01e1\22\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\5\16"+ + "\1\u01e2\41\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\1\u01e3\46\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\u01e4"+ + "\42\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\3\16\1\u01e5\43\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\10\16\1\u01e6"+ + "\36\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\22\16\1\u01e7\24\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\7\16\1\u01e8"+ + "\37\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\22\16\1\u015c\24\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\7\16\1\u01e6"+ + "\37\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\14\16\1\u01e9\32\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\4\16\1\u01ea"+ + "\42\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\10\16\1\u01eb\36\16\21\0\1\16\6\0"+ + "\13\16\1\0\1\16\2\0\1\16\2\0\20\16\1\u01ec"+ + "\26\16\21\0\1\16\6\0\13\16\1\0\1\16\2\0"+ + "\1\16\2\0\10\16\1\u01ed\36\16\21\0\1\16\10\0"+ + "\2\u01ee\1\140\1\0\5\u01ee\1\0\1\u01ee\5\0\2\u01ee"+ + "\3\0\1\u01ee\1\0\1\140\1\u01ee\6\0\1\u01ee\2\0"+ + "\1\u01ee\5\0\3\u01ee\46\0\1\u01ef\1\137\1\140\2\0"+ + "\3\u01ef\1\140\1\144\1\145\14\0\1\140\1\145\6\0"+ + "\1\140\2\0\1\140\7\0\1\140\44\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\16\16\1\u01f0\30\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\23\16\1\u01f1\23\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\5\16\1\344\41\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\16\16\1\u01f2\30\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\u01f3\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\3\16\1\u018a\43\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\10\16\1\u01f4\36\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\15\16\1\u01f5\31\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\17\16\1\u01a9\27\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\30\16\1\u01f6\16\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\17\16\1\u015c\27\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\u01e6\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\4\16\1\u01f7\42\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\4\16\1\u01a9\42\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\u01b3\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\17\16"+ + "\1\u01f8\27\16\21\0\1\16\10\0\2\u01f9\1\140\1\0"+ + "\5\u01f9\1\0\1\u01f9\5\0\2\u01f9\3\0\1\u01f9\1\0"+ + "\1\140\1\u01f9\6\0\1\u01f9\2\0\1\u01f9\5\0\3\u01f9"+ + "\46\0\1\u01fa\1\137\1\140\2\0\3\u01fa\1\140\1\144"+ + "\1\145\14\0\1\140\1\145\6\0\1\140\2\0\1\140"+ + "\7\0\1\140\44\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\11\16\1\u01e6\35\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\23\16\1\u01fb\23\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\20\16\1\u01fc\26\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\2\16\1\u01fd\44\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\1\u01fe\46\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\6\16\1\u01ff\40\16\21\0"+ + "\1\16\6\0\13\16\1\0\1\16\2\0\1\16\2\0"+ + "\6\16\1\u0200\40\16\21\0\1\16\6\0\13\16\1\0"+ + "\1\16\2\0\1\16\2\0\1\u0201\46\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\34\16"+ + "\1\u0202\12\16\21\0\1\16\10\0\2\u0203\1\140\1\0"+ + "\5\u0203\1\0\1\u0203\5\0\2\u0203\3\0\1\u0203\1\0"+ + "\1\140\1\u0203\6\0\1\u0203\2\0\1\u0203\5\0\3\u0203"+ + "\46\0\1\u0204\1\137\1\140\2\0\3\u0204\1\140\1\144"+ + "\1\145\14\0\1\140\1\145\6\0\1\140\2\0\1\140"+ + "\7\0\1\140\44\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\6\16\1\u0205\40\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\10\16\1\u0206\36\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\2\16\1\u01a9\44\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\17\16\1\u0207\27\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\11\16\1\u01a9\35\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\16\16\1\u0208\30\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\13\16\1\u0209\33\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\23\16\1\u020a\23\16"+ + "\21\0\1\16\10\0\2\u020b\1\140\1\0\5\u020b\1\0"+ + "\1\u020b\5\0\2\u020b\3\0\1\u020b\1\0\1\140\1\u020b"+ + "\6\0\1\u020b\2\0\1\u020b\5\0\3\u020b\46\0\1\u020c"+ + "\1\137\1\140\2\0\3\u020c\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\44\0\13\16\1\0\1\16\2\0\1\16\2\0\4\16"+ + "\1\u01bb\42\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\11\16\1\u01b3\35\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\36\16"+ + "\1\u01b8\10\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\11\16\1\u020d\35\16\21\0\1\16"+ + "\6\0\13\16\1\0\1\16\2\0\1\16\2\0\36\16"+ + "\1\u020e\10\16\21\0\1\16\6\0\13\16\1\0\1\16"+ + "\2\0\1\16\2\0\10\16\1\u020f\36\16\21\0\1\16"+ + "\10\0\2\u0210\1\140\1\0\5\u0210\1\0\1\u0210\5\0"+ + "\2\u0210\3\0\1\u0210\1\0\1\140\1\u0210\6\0\1\u0210"+ + "\2\0\1\u0210\5\0\3\u0210\46\0\1\u0211\1\137\1\140"+ + "\2\0\3\u0211\1\140\1\144\1\145\14\0\1\140\1\145"+ + "\6\0\1\140\2\0\1\140\7\0\1\140\44\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\17\16\1\u01fd\27\16"+ + "\21\0\1\16\6\0\13\16\1\0\1\16\2\0\1\16"+ + "\2\0\15\16\1\u0212\31\16\21\0\1\16\6\0\13\16"+ + "\1\0\1\16\2\0\1\16\2\0\4\16\1\u01ba\42\16"+ + "\21\0\1\16\10\0\2\u0213\1\140\1\0\5\u0213\1\0"+ + "\1\u0213\5\0\2\u0213\3\0\1\u0213\1\0\1\140\1\u0213"+ + "\6\0\1\u0213\2\0\1\u0213\5\0\3\u0213\46\0\1\u0214"+ + "\1\137\1\140\2\0\3\u0214\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\44\0\13\16\1\0\1\16\2\0\1\16\2\0\27\16"+ + "\1\u018a\17\16\21\0\1\16\10\0\2\u0215\1\140\1\0"+ + "\5\u0215\1\0\1\u0215\5\0\2\u0215\3\0\1\u0215\1\0"+ + "\1\140\1\u0215\6\0\1\u0215\2\0\1\u0215\5\0\3\u0215"+ + "\46\0\1\u0216\1\137\1\140\2\0\3\u0216\1\140\1\144"+ + "\1\145\14\0\1\140\1\145\6\0\1\140\2\0\1\140"+ + "\7\0\1\140\46\0\2\u0217\1\140\1\0\5\u0217\1\0"+ + "\1\u0217\5\0\2\u0217\3\0\1\u0217\1\0\1\140\1\u0217"+ + "\6\0\1\u0217\2\0\1\u0217\5\0\3\u0217\46\0\1\u0218"+ + "\1\137\1\140\2\0\3\u0218\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\50\0\1\140\24\0\1\140\71\0\1\u0219\1\137\1\140"+ + "\2\0\3\u0219\1\140\1\144\1\145\14\0\1\140\1\145"+ + "\6\0\1\140\2\0\1\140\7\0\1\140\46\0\1\u021a"+ + "\1\137\1\140\2\0\3\u021a\1\140\1\144\1\145\14\0"+ + "\1\140\1\145\6\0\1\140\2\0\1\140\7\0\1\140"+ + "\46\0\1\u021b\1\137\1\140\2\0\3\u021b\1\140\1\144"+ + "\1\145\14\0\1\140\1\145\6\0\1\140\2\0\1\140"+ + "\7\0\1\140\46\0\1\u021c\1\137\1\140\2\0\3\u021c"+ + "\1\140\1\144\1\145\14\0\1\140\1\145\6\0\1\140"+ + "\2\0\1\140\7\0\1\140\46\0\2\137\1\140\2\0"+ + "\3\137\1\140\1\144\1\145\14\0\1\140\1\145\6\0"+ + "\1\140\2\0\1\140\7\0\1\140\36\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[40905]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\11\0\1\11\14\1\1\11\34\1\7\11\10\1\2\11"+ + "\3\1\1\11\2\1\1\11\1\1\2\11\1\1\2\11"+ + "\2\1\1\11\4\1\1\11\1\0\1\1\1\0\3\1"+ + "\1\11\1\0\3\1\1\0\3\1\1\0\75\1\2\11"+ + "\2\1\1\11\1\0\1\11\1\0\1\1\1\11\1\0"+ + "\5\1\1\0\4\1\1\11\100\1\2\11\2\0\355\1"+ + "\1\0\12\1\1\0\11\1\1\0\7\1\1\0\4\1"+ + "\1\0\2\1\1\0\1\1\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[540]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Default constructor is needed as we will always call the yyreset + */ + public GroovyLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public GroovyLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public GroovyLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1828) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 26: + { yybegin(GSTRING_EXPR); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength; + tokenStart = yychar; + tokenLength = 2; + return token(TokenType.STRING, s, l); + } + case 36: break; + case 18: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.REGEX, tokenStart, tokenLength + 1); + } + case 37: break; + case 9: + { return token(TokenType.OPERATOR, -PARAN); + } + case 38: break; + case 25: + { return token(TokenType.KEYWORD); + } + case 39: break; + case 28: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + case 40: break; + case 5: + { return token(TokenType.NUMBER); + } + case 41: break; + case 3: + { return token(TokenType.OPERATOR); + } + case 42: break; + case 10: + { return token(TokenType.OPERATOR, CURLY); + } + case 43: break; + case 11: + { return token(TokenType.OPERATOR, -CURLY); + } + case 44: break; + case 33: + { return token(TokenType.REGEX); + } + case 45: break; + case 21: + { yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + case 46: break; + case 16: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 47: break; + case 31: + { yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + case 48: break; + case 23: + { yybegin(ML_STRING); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength + 1; + tokenStart = yychar + 1; + tokenLength = 0; + return token(TokenType.STRING2, s, l); + } + case 49: break; + case 14: + { tokenLength += yylength(); + } + case 50: break; + case 15: + { yybegin(YYINITIAL); + } + case 51: break; + case 7: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 52: break; + case 17: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 53: break; + case 34: + { return token(TokenType.TYPE); + } + case 54: break; + case 32: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + case 55: break; + case 2: + { /* skip */ + } + case 56: break; + case 13: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 57: break; + case 8: + { return token(TokenType.OPERATOR, PARAN); + } + case 58: break; + case 4: + { return token(TokenType.IDENTIFIER); + } + case 59: break; + case 27: + { tokenLength += 2; + } + case 60: break; + case 35: + { return token(TokenType.TYPE2); + } + case 61: break; + case 30: + { yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + case 62: break; + case 19: + { tokenLength ++; + } + case 63: break; + case 12: + { return token(TokenType.OPERATOR, BRACKET); + } + case 64: break; + case 24: + { return token(TokenType.COMMENT); + } + case 65: break; + case 6: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 66: break; + case 29: + { yybegin(ML_STRING_EXPR); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength; + tokenStart = yychar; + tokenLength = 2; + return token(TokenType.STRING, s, l); + } + case 67: break; + case 22: + { yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } + case 68: break; + case 20: + { yybegin(STRING); + // length also includes the trailing quote + int s = tokenStart; + int l = tokenLength + 1; + tokenStart = yychar + 1; + tokenLength = 0; + return token(TokenType.STRING2, s, l); + } + case 69: break; + case 1: + { + } + case 70: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JFlexLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JFlexLexer.java new file mode 100644 index 000000000..09e445191 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JFlexLexer.java @@ -0,0 +1,1470 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/jflex.flex + */ +public final class JFlexLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int JDOC_TAG = 8; + public static final int JDOC = 6; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\103"+ + "\1\24\1\0\1\6\1\70\1\104\1\25\1\101\1\101\1\5\1\106"+ + "\1\101\1\23\1\21\1\4\1\10\1\16\2\15\2\17\1\74\1\72"+ + "\1\73\1\11\1\63\1\101\1\57\1\102\1\61\1\101\1\107\1\14"+ + "\1\75\1\14\1\76\1\22\1\20\2\66\1\77\2\66\1\12\2\66"+ + "\1\60\3\66\1\100\4\66\1\13\2\66\1\62\1\26\1\65\1\103"+ + "\1\67\1\0\1\27\1\30\1\34\1\46\1\37\1\51\1\53\1\43"+ + "\1\44\1\64\1\41\1\36\1\47\1\40\1\35\1\52\1\66\1\33"+ + "\1\31\1\32\1\45\1\54\1\55\1\50\1\42\1\56\1\71\1\105"+ + "\1\71\1\101\41\7\2\0\4\6\4\0\1\110\2\0\1\7\7\0"+ + "\1\110\4\0\1\110\5\0\27\110\1\0\37\110\1\0\u013f\110\31\0"+ + "\162\110\4\0\14\110\16\0\5\110\11\0\1\110\21\0\130\7\5\0"+ + "\23\7\12\0\1\110\13\0\1\110\1\0\3\110\1\0\1\110\1\0"+ + "\24\110\1\0\54\110\1\0\46\110\1\0\5\110\4\0\202\110\1\0"+ + "\4\7\3\0\105\110\1\0\46\110\2\0\2\110\6\0\20\110\41\0"+ + "\46\110\2\0\1\110\7\0\47\110\11\0\21\7\1\0\27\7\1\0"+ + "\3\7\1\0\1\7\1\0\2\7\1\0\1\7\13\0\33\110\5\0"+ + "\3\110\15\0\4\7\14\0\6\7\13\0\32\110\5\0\13\110\16\7"+ + "\7\0\12\7\4\0\2\110\1\7\143\110\1\0\1\110\10\7\1\0"+ + "\6\7\2\110\2\7\1\0\4\7\2\110\12\7\3\110\2\0\1\110"+ + "\17\0\1\7\1\110\1\7\36\110\33\7\2\0\3\110\60\0\46\110"+ + "\13\7\1\110\u014f\0\3\7\66\110\2\0\1\7\1\110\20\7\2\0"+ + "\1\110\4\7\3\0\12\110\2\7\2\0\12\7\21\0\3\7\1\0"+ + "\10\110\2\0\2\110\2\0\26\110\1\0\7\110\1\0\1\110\3\0"+ + "\4\110\2\0\1\7\1\110\7\7\2\0\2\7\2\0\3\7\11\0"+ + "\1\7\4\0\2\110\1\0\3\110\2\7\2\0\12\7\2\110\2\6"+ + "\15\0\3\7\1\0\6\110\4\0\2\110\2\0\26\110\1\0\7\110"+ + "\1\0\2\110\1\0\2\110\1\0\2\110\2\0\1\7\1\0\5\7"+ + "\4\0\2\7\2\0\3\7\13\0\4\110\1\0\1\110\7\0\14\7"+ + "\3\110\14\0\3\7\1\0\11\110\1\0\3\110\1\0\26\110\1\0"+ + "\7\110\1\0\2\110\1\0\5\110\2\0\1\7\1\110\10\7\1\0"+ + "\3\7\1\0\3\7\2\0\1\110\17\0\2\110\2\7\2\0\12\7"+ + "\1\0\1\6\17\0\3\7\1\0\10\110\2\0\2\110\2\0\26\110"+ + "\1\0\7\110\1\0\2\110\1\0\5\110\2\0\1\7\1\110\6\7"+ + "\3\0\2\7\2\0\3\7\10\0\2\7\4\0\2\110\1\0\3\110"+ + "\4\0\12\7\1\0\1\110\20\0\1\7\1\110\1\0\6\110\3\0"+ + "\3\110\1\0\4\110\3\0\2\110\1\0\1\110\1\0\2\110\3\0"+ + "\2\110\3\0\3\110\3\0\10\110\1\0\3\110\4\0\5\7\3\0"+ + "\3\7\1\0\4\7\11\0\1\7\17\0\11\7\11\0\1\6\7\0"+ + "\3\7\1\0\10\110\1\0\3\110\1\0\27\110\1\0\12\110\1\0"+ + "\5\110\4\0\7\7\1\0\3\7\1\0\4\7\7\0\2\7\11\0"+ + "\2\110\4\0\12\7\22\0\2\7\1\0\10\110\1\0\3\110\1\0"+ + "\27\110\1\0\12\110\1\0\5\110\2\0\1\7\1\110\7\7\1\0"+ + "\3\7\1\0\4\7\7\0\2\7\7\0\1\110\1\0\2\110\4\0"+ + "\12\7\22\0\2\7\1\0\10\110\1\0\3\110\1\0\27\110\1\0"+ + "\20\110\4\0\6\7\2\0\3\7\1\0\4\7\11\0\1\7\10\0"+ + "\2\110\4\0\12\7\22\0\2\7\1\0\22\110\3\0\30\110\1\0"+ + "\11\110\1\0\1\110\2\0\7\110\3\0\1\7\4\0\6\7\1\0"+ + "\1\7\1\0\10\7\22\0\2\7\15\0\60\110\1\7\2\110\7\7"+ + "\4\0\1\6\7\110\10\7\1\0\12\7\47\0\2\110\1\0\1\110"+ + "\2\0\2\110\1\0\1\110\2\0\1\110\6\0\4\110\1\0\7\110"+ + "\1\0\3\110\1\0\1\110\1\0\1\110\2\0\2\110\1\0\4\110"+ + "\1\7\2\110\6\7\1\0\2\7\1\110\2\0\5\110\1\0\1\110"+ + "\1\0\6\7\2\0\12\7\2\0\2\110\42\0\1\110\27\0\2\7"+ + "\6\0\12\7\13\0\1\7\1\0\1\7\1\0\1\7\4\0\2\7"+ + "\10\110\1\0\42\110\6\0\24\7\1\0\2\7\4\110\4\0\10\7"+ + "\1\0\44\7\11\0\1\7\71\0\42\110\1\0\5\110\1\0\2\110"+ + "\1\0\7\7\3\0\4\7\6\0\12\7\6\0\6\110\4\7\106\0"+ + "\46\110\12\0\51\110\7\0\132\110\5\0\104\110\5\0\122\110\6\0"+ + "\7\110\1\0\77\110\1\0\1\110\1\0\4\110\2\0\7\110\1\0"+ + "\1\110\1\0\4\110\2\0\47\110\1\0\1\110\1\0\4\110\2\0"+ + "\37\110\1\0\1\110\1\0\4\110\2\0\7\110\1\0\1\110\1\0"+ + "\4\110\2\0\7\110\1\0\7\110\1\0\27\110\1\0\37\110\1\0"+ + "\1\110\1\0\4\110\2\0\7\110\1\0\47\110\1\0\23\110\16\0"+ + "\11\7\56\0\125\110\14\0\u026c\110\2\0\10\110\12\0\32\110\5\0"+ + "\113\110\3\0\3\6\17\0\15\110\1\0\4\110\3\7\13\0\22\110"+ + "\3\7\13\0\22\110\2\7\14\0\15\110\1\0\3\110\1\0\2\7"+ + "\14\0\64\110\40\7\3\0\1\110\3\0\1\6\1\110\1\7\2\0"+ + "\12\7\41\0\3\7\2\0\12\7\6\0\130\110\10\0\51\110\1\7"+ + "\126\0\35\110\3\0\14\7\4\0\14\7\12\0\12\7\36\110\2\0"+ + "\5\110\u038b\0\154\110\224\0\234\110\4\0\132\110\6\0\26\110\2\0"+ + "\6\110\2\0\46\110\2\0\6\110\2\0\10\110\1\0\1\110\1\0"+ + "\1\110\1\0\1\110\1\0\37\110\2\0\65\110\1\0\7\110\1\0"+ + "\1\110\3\0\3\110\1\0\7\110\3\0\4\110\2\0\6\110\4\0"+ + "\15\110\5\0\3\110\1\0\7\110\17\0\4\7\32\0\5\7\20\0"+ + "\2\6\23\0\1\6\13\0\4\7\6\0\6\7\1\0\1\110\15\0"+ + "\1\110\40\0\22\6\36\0\15\7\4\0\1\7\3\0\6\7\27\0"+ + "\1\110\4\0\1\110\2\0\12\110\1\0\1\110\3\0\5\110\6\0"+ + "\1\110\1\0\1\110\1\0\1\110\1\0\4\110\1\0\3\110\1\0"+ + "\7\110\3\0\3\110\5\0\5\110\26\0\44\6\u0e81\0\2\110\1\6"+ + "\31\0\11\6\6\7\1\0\5\110\2\0\3\6\2\110\4\0\126\110"+ + "\2\0\2\7\2\0\3\110\1\0\132\110\1\6\4\110\5\0\50\110"+ + "\4\0\136\110\21\0\30\110\70\0\20\110\u0200\0\u19b6\110\112\0\u51a6\110"+ + "\132\0\u048d\110\u0773\0\u2ba4\110\u215c\0\u012e\110\2\0\73\110\225\0\7\110"+ + "\14\0\5\110\5\0\1\110\1\7\12\110\1\0\15\110\1\0\5\110"+ + "\1\0\1\110\1\0\2\110\1\0\2\110\1\0\154\110\41\0\u016b\110"+ + "\22\0\100\110\2\0\66\110\50\0\14\110\1\6\3\0\20\7\20\0"+ + "\4\7\17\0\2\6\30\0\3\6\31\0\1\6\6\0\5\110\1\0"+ + "\207\110\2\0\1\7\4\0\1\6\13\0\12\7\7\0\32\110\4\0"+ + "\1\6\1\0\32\110\12\0\1\6\131\110\3\0\6\110\2\0\6\110"+ + "\2\0\6\110\2\0\3\110\3\0\2\6\3\0\2\6\22\0\3\7"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\3\1\2\2\1\3\2\4\1\3\2\2\1\5"+ + "\1\6\20\3\1\2\1\3\4\2\4\3\3\2\1\7"+ + "\2\10\1\11\1\1\1\7\1\1\2\12\1\13\2\14"+ + "\1\7\1\15\1\0\3\4\1\0\3\4\1\0\32\3"+ + "\2\16\13\3\1\0\1\2\1\3\1\2\4\0\1\17"+ + "\11\0\1\17\2\0\1\17\1\0\6\3\1\20\2\7"+ + "\1\21\1\7\2\15\1\0\1\22\4\4\1\0\30\3"+ + "\1\16\15\3\1\23\1\0\1\3\43\0\6\3\2\0"+ + "\2\4\30\3\1\0\1\3\23\0\1\17\5\0\1\17"+ + "\15\0\1\3\1\24\3\3\2\4\6\3\1\16\7\3"+ + "\1\16\2\3\43\0\3\3\2\4\12\3\31\0\2\3"+ + "\2\4\7\3\20\0\2\4\3\3\10\0\2\4\2\3"+ + "\2\0\1\17\1\0\2\4\2\0\1\4\1\0\1\4"+ + "\1\0\1\4\1\0\1\4\1\0\1\4\1\0\1\4"+ + "\1\0\1\4\1\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[473]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\111\0\222\0\333\0\u0124\0\u016d\0\u01b6\0\u01ff"+ + "\0\u0248\0\u0291\0\u02da\0\u0323\0\u036c\0\u03b5\0\u03fe\0\u0447"+ + "\0\u016d\0\u016d\0\u0490\0\u04d9\0\u0522\0\u056b\0\u05b4\0\u05fd"+ + "\0\u0646\0\u068f\0\u06d8\0\u0721\0\u076a\0\u07b3\0\u07fc\0\u0845"+ + "\0\u088e\0\u08d7\0\u0920\0\u0969\0\u09b2\0\u09fb\0\u016d\0\u0a44"+ + "\0\u0a8d\0\u0ad6\0\u0b1f\0\u0b68\0\u0bb1\0\u0bfa\0\u0c43\0\u0c8c"+ + "\0\u0cd5\0\u016d\0\u016d\0\u0d1e\0\u0d67\0\u0db0\0\u016d\0\u0df9"+ + "\0\u016d\0\u016d\0\u0df9\0\u0e42\0\u0e8b\0\u0ed4\0\u0f1d\0\u0f66"+ + "\0\u016d\0\u0faf\0\u0ff8\0\u1041\0\u108a\0\u10d3\0\u111c\0\u1165"+ + "\0\u11ae\0\u11f7\0\u1240\0\u1289\0\u12d2\0\u131b\0\u1364\0\u13ad"+ + "\0\u13f6\0\u143f\0\u1488\0\u14d1\0\u151a\0\u1563\0\u15ac\0\u15f5"+ + "\0\u163e\0\u1687\0\u16d0\0\u1719\0\u1762\0\u17ab\0\u17f4\0\u183d"+ + "\0\u02da\0\u1886\0\u18cf\0\u1918\0\u1961\0\u19aa\0\u19f3\0\u1a3c"+ + "\0\u1a85\0\u1ace\0\u1b17\0\u1b60\0\u1ba9\0\u1bf2\0\u1c3b\0\u1c84"+ + "\0\u1ccd\0\u1d16\0\u1d5f\0\u1da8\0\u1df1\0\u1e3a\0\u1e83\0\u1ecc"+ + "\0\u1f15\0\u1f5e\0\u1fa7\0\u1ff0\0\u2039\0\u2082\0\u20cb\0\u2114"+ + "\0\u215d\0\u21a6\0\u016d\0\u21ef\0\u2238\0\u2281\0\u22ca\0\u2313"+ + "\0\u235c\0\u23a5\0\u016d\0\u23ee\0\u2437\0\u016d\0\u016d\0\u2480"+ + "\0\u016d\0\u24c9\0\u2512\0\u255b\0\u25a4\0\u25ed\0\u2636\0\u267f"+ + "\0\u26c8\0\u2711\0\u275a\0\u27a3\0\u27ec\0\u2835\0\u287e\0\u28c7"+ + "\0\u2910\0\u2959\0\u29a2\0\u29eb\0\u2a34\0\u2a7d\0\u2ac6\0\u2b0f"+ + "\0\u2b58\0\u2ba1\0\u2bea\0\u2c33\0\u2c7c\0\u2cc5\0\u2d0e\0\u2d57"+ + "\0\u2da0\0\u2de9\0\u2e32\0\u2e7b\0\u2ec4\0\u2f0d\0\u2f56\0\u2f9f"+ + "\0\u2fe8\0\u3031\0\u307a\0\u30c3\0\u310c\0\u3155\0\u016d\0\u319e"+ + "\0\u31e7\0\u3230\0\u3279\0\u32c2\0\u330b\0\u3354\0\u339d\0\u33e6"+ + "\0\u342f\0\u3478\0\u34c1\0\u350a\0\u3553\0\u359c\0\u35e5\0\u362e"+ + "\0\u3677\0\u36c0\0\u3709\0\u3752\0\u379b\0\u37e4\0\u382d\0\u3876"+ + "\0\u38bf\0\u3908\0\u3951\0\u399a\0\u39e3\0\u3a2c\0\u3a75\0\u3abe"+ + "\0\u3b07\0\u3b50\0\u3b99\0\u3be2\0\u3c2b\0\u3c74\0\u3cbd\0\u3d06"+ + "\0\u3d4f\0\u3d98\0\u3de1\0\u2512\0\u3e2a\0\u3e73\0\u3ebc\0\u3f05"+ + "\0\u3f4e\0\u3f97\0\u3fe0\0\u4029\0\u4072\0\u40bb\0\u4104\0\u414d"+ + "\0\u4196\0\u41df\0\u4228\0\u4271\0\u42ba\0\u4303\0\u434c\0\u4395"+ + "\0\u43de\0\u4427\0\u4470\0\u44b9\0\u4502\0\u454b\0\u4594\0\u45dd"+ + "\0\u4626\0\u466f\0\u46b8\0\u4701\0\u474a\0\u4793\0\u47dc\0\u4825"+ + "\0\u486e\0\u48b7\0\u4900\0\u4949\0\u4992\0\u49db\0\u4a24\0\u4a6d"+ + "\0\u4ab6\0\u4aff\0\u4b48\0\u4b91\0\u4bda\0\u4c23\0\u4c6c\0\u4cb5"+ + "\0\u4cfe\0\u4d47\0\u4d90\0\u4dd9\0\u4e22\0\u4e6b\0\u4eb4\0\u4efd"+ + "\0\u4f46\0\u4f8f\0\u4fd8\0\u5021\0\u506a\0\u50b3\0\u50fc\0\u5145"+ + "\0\u02da\0\u518e\0\u51d7\0\u5220\0\u5269\0\u52b2\0\u52fb\0\u5344"+ + "\0\u538d\0\u53d6\0\u541f\0\u5468\0\u2a7d\0\u54b1\0\u54fa\0\u5543"+ + "\0\u558c\0\u55d5\0\u561e\0\u5667\0\u56b0\0\u56f9\0\u5742\0\u578b"+ + "\0\u57d4\0\u581d\0\u5866\0\u58af\0\u58f8\0\u5941\0\u598a\0\u59d3"+ + "\0\u5a1c\0\u5a65\0\u5aae\0\u5af7\0\u5b40\0\u5b89\0\u5bd2\0\u5c1b"+ + "\0\u5c64\0\u5cad\0\u5cf6\0\u5d3f\0\u5d88\0\u5dd1\0\u5e1a\0\u5e63"+ + "\0\u5eac\0\u5ef5\0\u5f3e\0\u5f87\0\u5fd0\0\u6019\0\u6062\0\u60ab"+ + "\0\u60f4\0\u613d\0\u6186\0\u61cf\0\u6218\0\u6261\0\u62aa\0\u62f3"+ + "\0\u633c\0\u6385\0\u63ce\0\u6417\0\u6460\0\u64a9\0\u64f2\0\u653b"+ + "\0\u6584\0\u65cd\0\u6616\0\u665f\0\u66a8\0\u66f1\0\u673a\0\u6783"+ + "\0\u67cc\0\u6815\0\u685e\0\u68a7\0\u68f0\0\u6939\0\u6982\0\u69cb"+ + "\0\u6a14\0\u6a5d\0\u6aa6\0\u6aef\0\u6b38\0\u6b81\0\u6bca\0\u6c13"+ + "\0\u6c5c\0\u6ca5\0\u6cee\0\u6d37\0\u6d80\0\u6dc9\0\u6e12\0\u6e5b"+ + "\0\u6ea4\0\u6eed\0\u6f36\0\u6f7f\0\u6fc8\0\u7011\0\u705a\0\u70a3"+ + "\0\u70ec\0\u7135\0\u717e\0\u71c7\0\u7210\0\u7259\0\u72a2\0\u72eb"+ + "\0\u7334\0\u737d\0\u73c6\0\u740f\0\u7458\0\u74a1\0\u74ea\0\u7533"+ + "\0\u757c\0\u75c5\0\u760e\0\u7657\0\u76a0\0\u76e9\0\u7732\0\u777b"+ + "\0\u77c4\0\u780d\0\u7856\0\u789f\0\u78e8\0\u7931\0\u797a\0\u79c3"+ + "\0\u72eb\0\u7a0c\0\u7a55\0\u7a9e\0\u7ae7\0\u7b30\0\u7b79\0\u7bc2"+ + "\0\u7c0b\0\u7c54\0\u7c9d\0\u7ce6\0\u7d2f\0\u7d78\0\u7dc1\0\u7e0a"+ + "\0\u7e53\0\u7e9c\0\u7ee5\0\u7f2e\0\u7f77\0\u7fc0\0\u8009\0\u8052"+ + "\0\u809b"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[473]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\6\1\10\1\11\1\12\1\13\1\6"+ + "\1\14\1\15\3\13\3\15\1\16\1\17\1\13\1\20"+ + "\1\21\1\22\1\6\1\23\1\24\1\25\1\26\1\27"+ + "\1\30\1\13\1\31\1\32\1\33\3\13\1\34\1\13"+ + "\1\35\2\13\1\36\1\37\1\40\1\41\1\42\1\13"+ + "\1\43\1\44\1\45\1\46\1\47\1\13\1\47\2\13"+ + "\1\50\1\47\3\15\1\51\1\52\1\53\1\54\1\47"+ + "\2\12\1\55\1\56\1\57\1\6\1\13\1\60\1\61"+ + "\1\62\21\60\1\63\1\60\1\64\62\60\1\65\1\61"+ + "\1\62\22\65\1\63\1\66\62\65\5\67\1\70\101\67"+ + "\1\71\1\67\5\72\1\73\4\72\3\74\3\72\1\74"+ + "\1\72\1\74\4\72\30\74\1\72\1\74\3\72\1\74"+ + "\1\72\1\74\6\72\4\74\7\72\1\74\113\0\1\6"+ + "\111\0\1\10\111\0\1\75\1\76\74\0\1\47\110\0"+ + "\1\47\14\0\13\13\1\0\1\13\4\0\30\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\10\0\1\77\1\100\1\101\1\102\1\0\1\103"+ + "\1\104\1\103\1\101\1\105\1\106\13\0\1\101\1\106"+ + "\6\0\1\101\1\0\1\102\1\101\20\0\1\103\1\100"+ + "\1\103\1\0\1\101\22\0\2\15\1\101\2\0\3\15"+ + "\1\101\1\105\1\106\13\0\1\101\1\106\6\0\1\101"+ + "\2\0\1\101\20\0\3\15\1\0\1\101\20\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\107\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\10\0\2\105\3\0\3\105\52\0\3\105\37\0\1\47"+ + "\56\0\1\47\14\0\13\13\1\0\1\13\4\0\1\13"+ + "\1\110\26\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\4\13\1\111\1\13\1\112\4\13\1\113\14\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\114\7\13\1\115\1\116\1\13\1\117\7\13\1\120"+ + "\1\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\4\13\1\121\7\13\1\122\13\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\123\17\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\124\5\13"+ + "\1\125\1\126\4\13\1\127\13\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\130\21\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\7\13\1\131"+ + "\1\13\1\132\7\13\1\133\6\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\134\7\13\1\135\5\13"+ + "\1\136\11\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\137\6\13\1\140\1\13\1\141\5\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\142\1\13\1\143\17\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\144\5\13\1\145\1\146\5\13"+ + "\1\147\12\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\150\3\13\1\151\11\13\1\152\11\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\153"+ + "\21\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\154\21\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\14\13\1\155\13\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\12\0"+ + "\3\156\3\0\1\156\1\0\1\156\4\0\30\156\1\157"+ + "\1\156\3\0\1\156\1\0\1\156\6\0\4\156\1\0"+ + "\1\47\14\0\13\13\1\0\1\13\4\0\1\13\1\160"+ + "\26\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\61\0\1\161\20\0\1\47\71\0"+ + "\1\162\43\0\1\163\10\0\1\164\1\165\1\166\1\167"+ + "\1\0\1\170\1\0\1\171\1\172\1\173\1\0\1\174"+ + "\1\0\1\175\1\176\1\177\1\0\1\200\1\201\1\202"+ + "\15\0\2\203\2\204\6\0\1\47\14\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\205\4\13\1\206\14\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\207"+ + "\21\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\210\16\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\211\10\13\1\212\13\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\102\0\1\47\1\0\1\47\106\0\1\47\2\0"+ + "\1\47\105\0\1\47\3\0\1\47\2\0\1\60\2\0"+ + "\21\60\1\0\1\60\1\0\62\60\2\0\1\62\106\0"+ + "\2\213\1\0\5\213\1\214\4\213\2\214\1\215\52\213"+ + "\1\215\1\213\1\215\14\213\1\65\2\0\22\65\2\0"+ + "\62\65\2\213\1\0\106\213\4\0\1\216\116\0\3\74"+ + "\3\0\1\74\1\0\1\74\4\0\30\74\1\0\1\74"+ + "\2\0\1\217\1\74\1\0\1\74\6\0\4\74\7\0"+ + "\1\74\1\75\1\220\1\221\106\75\5\222\1\223\103\222"+ + "\10\0\1\77\1\100\1\101\2\0\1\103\1\104\1\103"+ + "\1\101\1\105\1\106\13\0\1\101\1\106\6\0\1\101"+ + "\2\0\1\101\20\0\1\103\1\100\1\103\1\0\1\101"+ + "\22\0\2\100\3\0\3\100\1\101\1\105\1\106\14\0"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\3\100\1\0"+ + "\1\101\22\0\1\224\1\225\2\0\5\225\1\0\1\225"+ + "\4\0\2\225\3\0\1\225\2\0\1\225\6\0\1\225"+ + "\2\0\1\225\20\0\5\225\22\0\1\226\1\100\1\101"+ + "\2\0\3\226\1\101\1\105\1\106\13\0\1\101\1\106"+ + "\6\0\1\101\2\0\1\101\20\0\1\226\1\100\1\226"+ + "\1\0\1\101\22\0\1\103\1\100\1\101\2\0\3\103"+ + "\1\101\1\105\1\106\13\0\1\101\1\106\6\0\1\101"+ + "\2\0\1\101\20\0\1\103\1\100\1\103\1\0\1\101"+ + "\22\0\2\105\3\0\3\105\1\101\1\0\1\106\14\0"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\3\105\1\0"+ + "\1\101\22\0\2\227\3\0\3\227\3\0\1\230\46\0"+ + "\3\227\11\0\1\230\10\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\231\21\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\2\13\1\232\25\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\233\17\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\234"+ + "\21\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\235\24\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\236\3\13\1\237\23\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\240\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\241\21\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\23\13\1\242\4\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\243\12\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\244\12\13\1\141"+ + "\2\13\1\235\11\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\245\10\13\1\246\12\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\247"+ + "\24\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\2\13\1\235\1\250\24\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\251\16\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\252\27\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\145\27\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\253\16\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\2\13\1\235\25\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\254\11\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\255\24\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\256\24\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\26\13\1\141\1\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\257\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\2\13\1\260\1\261"+ + "\24\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\23\13\1\262\4\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\16\13\1\263\11\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\22\13\1\264\5\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\7\13\1\131"+ + "\20\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\4\13\1\141\23\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\265\21\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\11\13\1\266\16\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\5\13\1\267"+ + "\22\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\270\6\13\1\271\12\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\13\1\272\26\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\273"+ + "\24\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\274\5\13\1\275\12\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\15\13\1\276\12\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\10\0\11\156\1\0\1\156\4\0\30\156\1\0"+ + "\1\156\1\277\2\0\1\156\1\0\2\156\2\0\7\156"+ + "\32\0\1\300\57\0\1\47\14\0\13\13\1\0\1\13"+ + "\4\0\30\13\1\0\1\13\3\0\1\301\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\61\0\1\12\20\0\1\47"+ + "\44\0\1\302\6\0\1\303\1\304\15\0\1\305\120\0"+ + "\1\204\44\0\1\306\21\0\1\307\100\0\1\310\2\0"+ + "\1\311\75\0\1\312\1\0\1\313\20\0\1\314\62\0"+ + "\1\315\12\0\1\316\75\0\1\317\2\0\1\320\2\0"+ + "\1\321\1\322\4\0\1\323\1\0\1\324\107\0\1\325"+ + "\101\0\1\326\12\0\1\327\75\0\1\330\115\0\1\331"+ + "\106\0\1\332\6\0\1\333\3\0\1\334\75\0\1\335"+ + "\107\0\1\336\102\0\1\337\123\0\1\340\1\341\72\0"+ + "\1\342\15\0\1\343\73\0\1\344\66\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\345\21\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\346\24\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\16\13\1\347"+ + "\11\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\350\24\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\351\23\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\352\21\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\10\0\1\215\4\0\3\215\52\0\1\215\1\0"+ + "\1\215\24\0\1\217\4\0\3\217\52\0\1\217\1\0"+ + "\1\217\16\0\1\221\106\0\5\222\1\353\103\222\4\0"+ + "\1\221\1\354\113\0\1\224\1\225\1\101\1\0\5\225"+ + "\1\0\1\225\4\0\2\225\3\0\1\225\1\0\1\101"+ + "\1\225\6\0\1\225\2\0\1\225\20\0\5\225\22\0"+ + "\2\355\1\101\1\0\5\355\1\0\1\355\4\0\2\355"+ + "\3\0\1\355\1\0\1\101\1\355\6\0\1\355\2\0"+ + "\1\355\20\0\5\355\22\0\1\356\1\100\1\101\2\0"+ + "\3\356\1\101\1\105\1\106\13\0\1\101\1\106\6\0"+ + "\1\101\2\0\1\101\20\0\1\356\1\100\1\356\1\0"+ + "\1\101\22\0\2\227\3\0\3\227\1\101\25\0\1\101"+ + "\2\0\1\101\20\0\3\227\1\0\1\101\22\0\2\227"+ + "\3\0\3\227\52\0\3\227\22\0\13\13\1\0\1\13"+ + "\4\0\1\357\27\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\360\24\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\361\27\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\362\20\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\141\17\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\363\24\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\364\12\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\365\22\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\366\23\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\145\17\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\3\13\1\250\24\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\367\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\370\21\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\2\13\1\141\25\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\371\11\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\372\22\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\2\13"+ + "\1\366\1\373\24\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\2\13\1\246\25\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\24\13\1\141\3\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\20\13\1\141"+ + "\7\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\374\17\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\15\13\1\375\12\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\141\20\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\376"+ + "\24\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\377\17\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\241\1\u0100\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\13\1\276\26\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\1\u0101"+ + "\27\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\366\27\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u0102\27\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\12\13\1\u0103\15\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\u0104\24\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\25\13\1\u0105"+ + "\2\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\363\20\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\141\21\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u0106\27\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\17\13\1\141\10\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\7\13"+ + "\1\235\20\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\60\0\1\u0107\36\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u0108\17\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\35\0\1\u0109\1\0\1\u010a\123\0\1\u010b\102\0\1\u010c"+ + "\102\0\1\u010d\103\0\1\u010e\123\0\1\u010f\73\0\1\u0110"+ + "\132\0\1\u0111\66\0\1\u0112\110\0\1\u0113\125\0\1\u0114"+ + "\74\0\1\u0115\132\0\1\u0116\67\0\1\u0117\114\0\1\u0118"+ + "\111\0\1\u0119\101\0\1\u011a\110\0\1\u011b\133\0\1\u011c"+ + "\76\0\1\u0116\121\0\1\u011d\71\0\1\u011e\110\0\1\u011f"+ + "\114\0\1\u0120\1\u0121\103\0\1\u0122\1\0\1\u0123\7\0"+ + "\1\u0124\116\0\1\u0125\76\0\1\u0126\114\0\1\u0127\74\0"+ + "\1\u0128\112\0\1\u0129\116\0\1\u012a\106\0\1\u012b\1\0"+ + "\1\u012c\104\0\1\u012d\104\0\1\u012e\124\0\1\u012f\52\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\u0130\20\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\u0131"+ + "\17\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\13\1\u0132\26\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\u0133\17\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\15\13\1\u0134\12\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\4\13\1\357"+ + "\23\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\4\222\1\221\1\353\103\222\10\0"+ + "\2\u0135\1\101\1\0\5\u0135\1\0\1\u0135\4\0\2\u0135"+ + "\3\0\1\u0135\1\0\1\101\1\u0135\6\0\1\u0135\2\0"+ + "\1\u0135\20\0\5\u0135\22\0\1\u0136\1\100\1\101\2\0"+ + "\3\u0136\1\101\1\105\1\106\13\0\1\101\1\106\6\0"+ + "\1\101\2\0\1\101\20\0\1\u0136\1\100\1\u0136\1\0"+ + "\1\101\20\0\13\13\1\0\1\13\4\0\3\13\1\u0131"+ + "\24\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\4\13\1\u0137\23\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\12\13\1\141\15\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\u0138\17\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u0139"+ + "\12\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\u013a\22\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\14\13\1\u013b\13\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\141\24\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\u013c"+ + "\25\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\26\13\1\u013d\1\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\u013e\23\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\14\13\1\141\13\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u013f"+ + "\12\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u0140\16\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\25\13\1\235\2\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u0141\27\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u0142\23\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\u0143\17\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\u0144\11\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\u0145\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\u0146\27\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\u0147"+ + "\17\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\113\27\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\155\24\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\20\0\1\u0148"+ + "\76\0\13\13\1\0\1\13\4\0\5\13\1\357\22\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\55\0\1\u0149\65\0\1\u014a\130\0\1\u0149"+ + "\111\0\1\u014b\74\0\1\u014c\103\0\1\u014d\130\0\1\u014e"+ + "\72\0\1\u014f\125\0\1\u0150\71\0\1\u0116\5\0\1\u0151"+ + "\110\0\1\u0152\102\0\1\u0153\114\0\1\u0116\111\0\1\203"+ + "\110\0\1\u0154\104\0\1\u0155\122\0\1\u0156\74\0\1\u0157"+ + "\112\0\1\203\106\0\1\u0158\14\0\1\177\74\0\1\u0159"+ + "\1\0\1\u015a\17\0\1\u015b\14\0\1\203\56\0\1\u015c"+ + "\116\0\1\u015d\102\0\1\u015e\106\0\1\u015f\112\0\1\u0160"+ + "\15\0\1\u0161\71\0\1\u0162\104\0\1\u0163\114\0\1\u0164"+ + "\107\0\1\u0165\107\0\1\u0166\121\0\1\u0167\72\0\1\u0168"+ + "\110\0\1\u012b\117\0\1\203\106\0\1\u0169\115\0\1\203"+ + "\105\0\1\u016a\104\0\1\203\64\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u016b\17\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\346\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\24\13\1\u016c\3\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\u016d\16\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\10\0\2\u016e\1\101\1\0"+ + "\5\u016e\1\0\1\u016e\4\0\2\u016e\3\0\1\u016e\1\0"+ + "\1\101\1\u016e\6\0\1\u016e\2\0\1\u016e\20\0\5\u016e"+ + "\22\0\1\u016f\1\100\1\101\2\0\3\u016f\1\101\1\105"+ + "\1\106\13\0\1\101\1\106\6\0\1\101\2\0\1\101"+ + "\20\0\1\u016f\1\100\1\u016f\1\0\1\101\20\0\13\13"+ + "\1\0\1\13\4\0\1\u0170\27\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u013e\27\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\141\22\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\u0171\24\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\4\13\1\u0172\23\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u0173\12\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\141\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\u0174\16\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\17\13\1\246\10\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\u0175\16\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\22\13\1\u0176\5\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\20\13"+ + "\1\u0177\7\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\7\13\1\366\20\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\u0178\20\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\24\13\1\235\3\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\5\13"+ + "\1\u0179\22\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\61\0\1\u017a\66\0\1\u017b"+ + "\103\0\1\u017c\122\0\1\u017d\76\0\1\u017e\111\0\1\u017f"+ + "\110\0\1\u0180\111\0\1\203\113\0\1\u011b\117\0\1\u0181"+ + "\101\0\1\u0182\105\0\1\u0183\112\0\1\u0184\101\0\1\u0185"+ + "\130\0\1\u0186\72\0\1\203\121\0\1\u0187\111\0\1\u0188"+ + "\103\0\1\u0189\101\0\1\u018a\121\0\1\u018b\110\0\1\u018c"+ + "\120\0\1\u018d\111\0\1\203\112\0\1\u0150\70\0\1\u018e"+ + "\122\0\1\u018f\75\0\1\u0159\36\0\1\203\56\0\1\u0190"+ + "\104\0\1\u0191\112\0\1\u018f\126\0\1\203\67\0\1\u0116"+ + "\110\0\1\u0192\122\0\1\u014f\52\0\13\13\1\0\1\13"+ + "\4\0\1\u0193\27\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\u0194\17\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\24\13\1\u0131\3\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\10\0\2\u0195\1\101\1\0\5\u0195\1\0\1\u0195"+ + "\4\0\2\u0195\3\0\1\u0195\1\0\1\101\1\u0195\6\0"+ + "\1\u0195\2\0\1\u0195\20\0\5\u0195\22\0\1\u0196\1\100"+ + "\1\101\2\0\3\u0196\1\101\1\105\1\106\13\0\1\101"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\1\u0196\1\100"+ + "\1\u0196\1\0\1\101\20\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\366\22\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\22\13\1\u0197\5\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\u0198\21\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\u0199"+ + "\17\13\1\0\1\13\3\0\1\13\1\0\2\13\2\0"+ + "\7\13\7\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\235\11\13\1\0\1\13\3\0\1\13\1\0"+ + "\2\13\2\0\7\13\7\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\5\13\1\u019a\22\13\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u019b\27\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u019c\17\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\13\13"+ + "\1\141\14\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\u019d\24\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\61\0\1\277"+ + "\62\0\1\u019e\114\0\1\u019f\103\0\1\u01a0\110\0\1\u01a1"+ + "\105\0\1\u01a2\125\0\1\u01a3\73\0\1\u01a4\114\0\1\u01a5"+ + "\120\0\1\203\104\0\1\u011a\104\0\1\u0167\115\0\1\203"+ + "\117\0\1\203\74\0\1\u01a6\112\0\1\u01a7\111\0\1\u01a8"+ + "\120\0\1\u0157\106\0\1\u01a9\76\0\1\u0159\105\0\1\u01aa"+ + "\127\0\1\u0116\111\0\1\u01ab\100\0\1\u01ac\115\0\1\u01ad"+ + "\52\0\13\13\1\0\1\13\4\0\11\13\1\u0131\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u0131\23\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\10\0\2\u01ae\1\101\1\0"+ + "\5\u01ae\1\0\1\u01ae\4\0\2\u01ae\3\0\1\u01ae\1\0"+ + "\1\101\1\u01ae\6\0\1\u01ae\2\0\1\u01ae\20\0\5\u01ae"+ + "\22\0\1\u01af\1\100\1\101\2\0\3\u01af\1\101\1\105"+ + "\1\106\13\0\1\101\1\106\6\0\1\101\2\0\1\101"+ + "\20\0\1\u01af\1\100\1\u01af\1\0\1\101\20\0\13\13"+ + "\1\0\1\13\4\0\23\13\1\141\4\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u01b0\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\366\16\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u01b1\17\13\1\0\1\13\3\0\1\13"+ + "\1\0\2\13\2\0\7\13\7\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\5\13\1\235\22\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u01b2\16\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\275\17\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\34\0\1\u01b3\107\0\1\u01a0"+ + "\140\0\1\u01b4\64\0\1\u01b5\105\0\1\u012f\130\0\1\u0129"+ + "\72\0\1\u01b6\105\0\1\u01b7\112\0\1\u01b8\104\0\1\u0116"+ + "\150\0\1\203\67\0\1\203\112\0\1\203\75\0\1\u01b9"+ + "\105\0\1\u01ba\111\0\1\u0186\63\0\2\u01bb\1\101\1\0"+ + "\5\u01bb\1\0\1\u01bb\4\0\2\u01bb\3\0\1\u01bb\1\0"+ + "\1\101\1\u01bb\6\0\1\u01bb\2\0\1\u01bb\20\0\5\u01bb"+ + "\22\0\1\u01bc\1\100\1\101\2\0\3\u01bc\1\101\1\105"+ + "\1\106\13\0\1\101\1\106\6\0\1\101\2\0\1\101"+ + "\20\0\1\u01bc\1\100\1\u01bc\1\0\1\101\20\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u01bd\12\13\1\0\1\13"+ + "\3\0\1\13\1\0\2\13\2\0\7\13\7\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\u01be\21\13"+ + "\1\0\1\13\3\0\1\13\1\0\2\13\2\0\7\13"+ + "\7\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\246\24\13\1\0\1\13\3\0\1\13\1\0\2\13"+ + "\2\0\7\13\7\0\1\13\27\0\1\u01bf\146\0\1\277"+ + "\56\0\1\u01c0\112\0\1\325\110\0\1\u011b\130\0\1\u01c1"+ + "\73\0\1\u01c2\77\0\1\u01a7\71\0\2\u01c3\1\101\1\0"+ + "\5\u01c3\1\0\1\u01c3\4\0\2\u01c3\3\0\1\u01c3\1\0"+ + "\1\101\1\u01c3\6\0\1\u01c3\2\0\1\u01c3\20\0\5\u01c3"+ + "\22\0\1\u01c4\1\100\1\101\2\0\3\u01c4\1\101\1\105"+ + "\1\106\13\0\1\101\1\106\6\0\1\101\2\0\1\101"+ + "\20\0\1\u01c4\1\100\1\u01c4\1\0\1\101\20\0\13\13"+ + "\1\0\1\13\4\0\27\13\1\u019d\1\0\1\13\3\0"+ + "\1\13\1\0\2\13\2\0\7\13\7\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\22\13\1\141\5\13\1\0"+ + "\1\13\3\0\1\13\1\0\2\13\2\0\7\13\7\0"+ + "\1\13\31\0\1\u01c5\125\0\1\304\14\0\1\u01b4\57\0"+ + "\1\u0157\66\0\2\u01c6\1\101\1\0\5\u01c6\1\0\1\u01c6"+ + "\4\0\2\u01c6\3\0\1\u01c6\1\0\1\101\1\u01c6\6\0"+ + "\1\u01c6\2\0\1\u01c6\20\0\5\u01c6\22\0\1\u01c7\1\100"+ + "\1\101\2\0\3\u01c7\1\101\1\105\1\106\13\0\1\101"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\1\u01c7\1\100"+ + "\1\u01c7\1\0\1\101\51\0\1\u01a0\61\0\2\u01c8\1\101"+ + "\1\0\5\u01c8\1\0\1\u01c8\4\0\2\u01c8\3\0\1\u01c8"+ + "\1\0\1\101\1\u01c8\6\0\1\u01c8\2\0\1\u01c8\20\0"+ + "\5\u01c8\22\0\1\u01c9\1\100\1\101\2\0\3\u01c9\1\101"+ + "\1\105\1\106\13\0\1\101\1\106\6\0\1\101\2\0"+ + "\1\101\20\0\1\u01c9\1\100\1\u01c9\1\0\1\101\22\0"+ + "\2\u01ca\1\101\1\0\5\u01ca\1\0\1\u01ca\4\0\2\u01ca"+ + "\3\0\1\u01ca\1\0\1\101\1\u01ca\6\0\1\u01ca\2\0"+ + "\1\u01ca\20\0\5\u01ca\22\0\1\u01cb\1\100\1\101\2\0"+ + "\3\u01cb\1\101\1\105\1\106\13\0\1\101\1\106\6\0"+ + "\1\101\2\0\1\101\20\0\1\u01cb\1\100\1\u01cb\1\0"+ + "\1\101\22\0\2\u01cc\1\101\1\0\5\u01cc\1\0\1\u01cc"+ + "\4\0\2\u01cc\3\0\1\u01cc\1\0\1\101\1\u01cc\6\0"+ + "\1\u01cc\2\0\1\u01cc\20\0\5\u01cc\22\0\1\u01cd\1\100"+ + "\1\101\2\0\3\u01cd\1\101\1\105\1\106\13\0\1\101"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\1\u01cd\1\100"+ + "\1\u01cd\1\0\1\101\22\0\2\u01ce\1\101\1\0\5\u01ce"+ + "\1\0\1\u01ce\4\0\2\u01ce\3\0\1\u01ce\1\0\1\101"+ + "\1\u01ce\6\0\1\u01ce\2\0\1\u01ce\20\0\5\u01ce\22\0"+ + "\1\u01cf\1\100\1\101\2\0\3\u01cf\1\101\1\105\1\106"+ + "\13\0\1\101\1\106\6\0\1\101\2\0\1\101\20\0"+ + "\1\u01cf\1\100\1\u01cf\1\0\1\101\22\0\2\u01d0\1\101"+ + "\1\0\5\u01d0\1\0\1\u01d0\4\0\2\u01d0\3\0\1\u01d0"+ + "\1\0\1\101\1\u01d0\6\0\1\u01d0\2\0\1\u01d0\20\0"+ + "\5\u01d0\22\0\1\u01d1\1\100\1\101\2\0\3\u01d1\1\101"+ + "\1\105\1\106\13\0\1\101\1\106\6\0\1\101\2\0"+ + "\1\101\20\0\1\u01d1\1\100\1\u01d1\1\0\1\101\22\0"+ + "\2\u01d2\1\101\1\0\5\u01d2\1\0\1\u01d2\4\0\2\u01d2"+ + "\3\0\1\u01d2\1\0\1\101\1\u01d2\6\0\1\u01d2\2\0"+ + "\1\u01d2\20\0\5\u01d2\22\0\1\u01d3\1\100\1\101\2\0"+ + "\3\u01d3\1\101\1\105\1\106\13\0\1\101\1\106\6\0"+ + "\1\101\2\0\1\101\20\0\1\u01d3\1\100\1\u01d3\1\0"+ + "\1\101\22\0\2\u01d4\1\101\1\0\5\u01d4\1\0\1\u01d4"+ + "\4\0\2\u01d4\3\0\1\u01d4\1\0\1\101\1\u01d4\6\0"+ + "\1\u01d4\2\0\1\u01d4\20\0\5\u01d4\22\0\1\u01d5\1\100"+ + "\1\101\2\0\3\u01d5\1\101\1\105\1\106\13\0\1\101"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\1\u01d5\1\100"+ + "\1\u01d5\1\0\1\101\24\0\1\101\23\0\1\101\62\0"+ + "\1\u01d6\1\100\1\101\2\0\3\u01d6\1\101\1\105\1\106"+ + "\13\0\1\101\1\106\6\0\1\101\2\0\1\101\20\0"+ + "\1\u01d6\1\100\1\u01d6\1\0\1\101\22\0\1\u01d7\1\100"+ + "\1\101\2\0\3\u01d7\1\101\1\105\1\106\13\0\1\101"+ + "\1\106\6\0\1\101\2\0\1\101\20\0\1\u01d7\1\100"+ + "\1\u01d7\1\0\1\101\22\0\1\u01d8\1\100\1\101\2\0"+ + "\3\u01d8\1\101\1\105\1\106\13\0\1\101\1\106\6\0"+ + "\1\101\2\0\1\101\20\0\1\u01d8\1\100\1\u01d8\1\0"+ + "\1\101\22\0\1\u01d9\1\100\1\101\2\0\3\u01d9\1\101"+ + "\1\105\1\106\13\0\1\101\1\106\6\0\1\101\2\0"+ + "\1\101\20\0\1\u01d9\1\100\1\u01d9\1\0\1\101\22\0"+ + "\2\100\1\101\2\0\3\100\1\101\1\105\1\106\13\0"+ + "\1\101\1\106\6\0\1\101\2\0\1\101\20\0\3\100"+ + "\1\0\1\101\12\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[32996]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\12\1\2\11\24\1\1\11\12\1\2\11"+ + "\3\1\1\11\1\1\2\11\3\1\1\0\2\1\1\11"+ + "\1\0\3\1\1\0\47\1\1\0\3\1\4\0\1\1"+ + "\11\0\1\1\2\0\1\11\1\0\6\1\1\11\2\1"+ + "\2\11\1\1\1\11\1\0\5\1\1\0\46\1\1\11"+ + "\1\0\1\1\43\0\6\1\2\0\32\1\1\0\1\1"+ + "\23\0\1\1\5\0\1\1\15\0\30\1\43\0\17\1"+ + "\31\0\13\1\20\0\5\1\10\0\4\1\2\0\1\1"+ + "\1\0\2\1\2\0\1\1\1\0\1\1\1\0\1\1"+ + "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\1\1"+ + "\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[473]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JFlexLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public JFlexLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public JFlexLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1822) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 14: + { return token(TokenType.KEYWORD); + } + case 21: break; + case 4: + { return token(TokenType.NUMBER); + } + case 22: break; + case 12: + { yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } + case 23: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 24: break; + case 17: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + case 25: break; + case 11: + { yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + case 26: break; + case 7: + { tokenLength += yylength(); + } + case 27: break; + case 8: + { yybegin(YYINITIAL); + } + case 28: break; + case 6: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 29: break; + case 18: + { yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + case 30: break; + case 9: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 31: break; + case 20: + { return token(TokenType.TYPE); + } + case 32: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 33: break; + case 15: + { return token(TokenType.KEYWORD2); + } + case 34: break; + case 16: + { tokenLength += 2; + } + case 35: break; + case 19: + { return token(TokenType.TYPE2); + } + case 36: break; + case 10: + { tokenLength ++; + } + case 37: break; + case 13: + { return token(TokenType.COMMENT); + } + case 38: break; + case 5: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 39: break; + case 1: + { + } + case 40: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaLexer.java new file mode 100644 index 000000000..c7e88e751 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaLexer.java @@ -0,0 +1,1520 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/java.flex + */ +public final class JavaLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int JDOC_TAG = 8; + public static final int JDOC = 6; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\112"+ + "\1\24\1\0\1\6\1\112\1\114\1\25\1\100\1\101\1\5\1\116"+ + "\1\106\1\23\1\21\1\4\1\10\1\16\2\15\4\17\2\11\1\113"+ + "\1\106\1\111\1\107\1\110\1\106\1\117\1\14\1\57\1\60\1\61"+ + "\1\22\1\20\1\75\1\120\1\62\2\120\1\12\1\76\1\67\1\63"+ + "\1\70\1\120\1\73\1\65\1\72\1\77\1\66\1\74\1\13\2\120"+ + "\1\104\1\26\1\105\1\112\1\6\1\0\1\27\1\30\1\34\1\46"+ + "\1\37\1\51\1\53\1\43\1\44\1\64\1\41\1\36\1\47\1\40"+ + "\1\35\1\52\1\71\1\33\1\31\1\32\1\45\1\54\1\55\1\50"+ + "\1\42\1\56\1\102\1\115\1\103\1\106\41\7\2\0\4\6\4\0"+ + "\1\120\2\0\1\7\7\0\1\120\4\0\1\120\5\0\27\120\1\0"+ + "\37\120\1\0\u013f\120\31\0\162\120\4\0\14\120\16\0\5\120\11\0"+ + "\1\120\21\0\130\7\5\0\23\7\12\0\1\120\13\0\1\120\1\0"+ + "\3\120\1\0\1\120\1\0\24\120\1\0\54\120\1\0\46\120\1\0"+ + "\5\120\4\0\202\120\1\0\4\7\3\0\105\120\1\0\46\120\2\0"+ + "\2\120\6\0\20\120\41\0\46\120\2\0\1\120\7\0\47\120\11\0"+ + "\21\7\1\0\27\7\1\0\3\7\1\0\1\7\1\0\2\7\1\0"+ + "\1\7\13\0\33\120\5\0\3\120\15\0\4\7\14\0\6\7\13\0"+ + "\32\120\5\0\13\120\16\7\7\0\12\7\4\0\2\120\1\7\143\120"+ + "\1\0\1\120\10\7\1\0\6\7\2\120\2\7\1\0\4\7\2\120"+ + "\12\7\3\120\2\0\1\120\17\0\1\7\1\120\1\7\36\120\33\7"+ + "\2\0\3\120\60\0\46\120\13\7\1\120\u014f\0\3\7\66\120\2\0"+ + "\1\7\1\120\20\7\2\0\1\120\4\7\3\0\12\120\2\7\2\0"+ + "\12\7\21\0\3\7\1\0\10\120\2\0\2\120\2\0\26\120\1\0"+ + "\7\120\1\0\1\120\3\0\4\120\2\0\1\7\1\120\7\7\2\0"+ + "\2\7\2\0\3\7\11\0\1\7\4\0\2\120\1\0\3\120\2\7"+ + "\2\0\12\7\2\120\2\6\15\0\3\7\1\0\6\120\4\0\2\120"+ + "\2\0\26\120\1\0\7\120\1\0\2\120\1\0\2\120\1\0\2\120"+ + "\2\0\1\7\1\0\5\7\4\0\2\7\2\0\3\7\13\0\4\120"+ + "\1\0\1\120\7\0\14\7\3\120\14\0\3\7\1\0\11\120\1\0"+ + "\3\120\1\0\26\120\1\0\7\120\1\0\2\120\1\0\5\120\2\0"+ + "\1\7\1\120\10\7\1\0\3\7\1\0\3\7\2\0\1\120\17\0"+ + "\2\120\2\7\2\0\12\7\1\0\1\6\17\0\3\7\1\0\10\120"+ + "\2\0\2\120\2\0\26\120\1\0\7\120\1\0\2\120\1\0\5\120"+ + "\2\0\1\7\1\120\6\7\3\0\2\7\2\0\3\7\10\0\2\7"+ + "\4\0\2\120\1\0\3\120\4\0\12\7\1\0\1\120\20\0\1\7"+ + "\1\120\1\0\6\120\3\0\3\120\1\0\4\120\3\0\2\120\1\0"+ + "\1\120\1\0\2\120\3\0\2\120\3\0\3\120\3\0\10\120\1\0"+ + "\3\120\4\0\5\7\3\0\3\7\1\0\4\7\11\0\1\7\17\0"+ + "\11\7\11\0\1\6\7\0\3\7\1\0\10\120\1\0\3\120\1\0"+ + "\27\120\1\0\12\120\1\0\5\120\4\0\7\7\1\0\3\7\1\0"+ + "\4\7\7\0\2\7\11\0\2\120\4\0\12\7\22\0\2\7\1\0"+ + "\10\120\1\0\3\120\1\0\27\120\1\0\12\120\1\0\5\120\2\0"+ + "\1\7\1\120\7\7\1\0\3\7\1\0\4\7\7\0\2\7\7\0"+ + "\1\120\1\0\2\120\4\0\12\7\22\0\2\7\1\0\10\120\1\0"+ + "\3\120\1\0\27\120\1\0\20\120\4\0\6\7\2\0\3\7\1\0"+ + "\4\7\11\0\1\7\10\0\2\120\4\0\12\7\22\0\2\7\1\0"+ + "\22\120\3\0\30\120\1\0\11\120\1\0\1\120\2\0\7\120\3\0"+ + "\1\7\4\0\6\7\1\0\1\7\1\0\10\7\22\0\2\7\15\0"+ + "\60\120\1\7\2\120\7\7\4\0\1\6\7\120\10\7\1\0\12\7"+ + "\47\0\2\120\1\0\1\120\2\0\2\120\1\0\1\120\2\0\1\120"+ + "\6\0\4\120\1\0\7\120\1\0\3\120\1\0\1\120\1\0\1\120"+ + "\2\0\2\120\1\0\4\120\1\7\2\120\6\7\1\0\2\7\1\120"+ + "\2\0\5\120\1\0\1\120\1\0\6\7\2\0\12\7\2\0\2\120"+ + "\42\0\1\120\27\0\2\7\6\0\12\7\13\0\1\7\1\0\1\7"+ + "\1\0\1\7\4\0\2\7\10\120\1\0\42\120\6\0\24\7\1\0"+ + "\2\7\4\120\4\0\10\7\1\0\44\7\11\0\1\7\71\0\42\120"+ + "\1\0\5\120\1\0\2\120\1\0\7\7\3\0\4\7\6\0\12\7"+ + "\6\0\6\120\4\7\106\0\46\120\12\0\51\120\7\0\132\120\5\0"+ + "\104\120\5\0\122\120\6\0\7\120\1\0\77\120\1\0\1\120\1\0"+ + "\4\120\2\0\7\120\1\0\1\120\1\0\4\120\2\0\47\120\1\0"+ + "\1\120\1\0\4\120\2\0\37\120\1\0\1\120\1\0\4\120\2\0"+ + "\7\120\1\0\1\120\1\0\4\120\2\0\7\120\1\0\7\120\1\0"+ + "\27\120\1\0\37\120\1\0\1\120\1\0\4\120\2\0\7\120\1\0"+ + "\47\120\1\0\23\120\16\0\11\7\56\0\125\120\14\0\u026c\120\2\0"+ + "\10\120\12\0\32\120\5\0\113\120\3\0\3\6\17\0\15\120\1\0"+ + "\4\120\3\7\13\0\22\120\3\7\13\0\22\120\2\7\14\0\15\120"+ + "\1\0\3\120\1\0\2\7\14\0\64\120\40\7\3\0\1\120\3\0"+ + "\1\6\1\120\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0"+ + "\130\120\10\0\51\120\1\7\126\0\35\120\3\0\14\7\4\0\14\7"+ + "\12\0\12\7\36\120\2\0\5\120\u038b\0\154\120\224\0\234\120\4\0"+ + "\132\120\6\0\26\120\2\0\6\120\2\0\46\120\2\0\6\120\2\0"+ + "\10\120\1\0\1\120\1\0\1\120\1\0\1\120\1\0\37\120\2\0"+ + "\65\120\1\0\7\120\1\0\1\120\3\0\3\120\1\0\7\120\3\0"+ + "\4\120\2\0\6\120\4\0\15\120\5\0\3\120\1\0\7\120\17\0"+ + "\4\7\32\0\5\7\20\0\2\6\23\0\1\6\13\0\4\7\6\0"+ + "\6\7\1\0\1\120\15\0\1\120\40\0\22\6\36\0\15\7\4\0"+ + "\1\7\3\0\6\7\27\0\1\120\4\0\1\120\2\0\12\120\1\0"+ + "\1\120\3\0\5\120\6\0\1\120\1\0\1\120\1\0\1\120\1\0"+ + "\4\120\1\0\3\120\1\0\7\120\3\0\3\120\5\0\5\120\26\0"+ + "\44\6\u0e81\0\2\120\1\6\31\0\11\6\6\7\1\0\5\120\2\0"+ + "\3\6\2\120\4\0\126\120\2\0\2\7\2\0\3\120\1\0\132\120"+ + "\1\6\4\120\5\0\50\120\4\0\136\120\21\0\30\120\70\0\20\120"+ + "\u0200\0\u19b6\120\112\0\u51a6\120\132\0\u048d\120\u0773\0\u2ba4\120\u215c\0\u012e\120"+ + "\2\0\73\120\225\0\7\120\14\0\5\120\5\0\1\120\1\7\12\120"+ + "\1\0\15\120\1\0\5\120\1\0\1\120\1\0\2\120\1\0\2\120"+ + "\1\0\154\120\41\0\u016b\120\22\0\100\120\2\0\66\120\50\0\14\120"+ + "\1\6\3\0\20\7\20\0\4\7\17\0\2\6\30\0\3\6\31\0"+ + "\1\6\6\0\5\120\1\0\207\120\2\0\1\7\4\0\1\6\13\0"+ + "\12\7\7\0\32\120\4\0\1\6\1\0\32\120\12\0\1\6\131\120"+ + "\3\0\6\120\2\0\6\120\2\0\6\120\2\0\3\120\3\0\2\6"+ + "\3\0\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\3\1\2\2\1\3\2\4\2\3\1\2\1\3"+ + "\1\2\1\5\1\6\35\3\1\7\1\10\1\11\1\12"+ + "\1\13\1\14\6\2\1\15\2\16\1\17\1\1\1\15"+ + "\1\1\2\20\1\21\2\22\1\15\1\23\1\0\3\4"+ + "\1\0\3\4\1\0\35\3\2\24\40\3\1\2\1\25"+ + "\2\15\1\26\1\15\2\23\1\0\1\27\4\4\1\0"+ + "\34\3\1\24\47\3\2\0\2\4\35\3\1\30\30\3"+ + "\2\4\3\3\1\31\6\3\1\24\7\3\1\24\4\3"+ + "\1\30\23\3\2\4\30\3\1\30\5\3\1\30\3\3"+ + "\2\4\33\3\1\32\1\3\2\4\27\3\2\4\1\3"+ + "\1\33\24\3\2\4\20\3\1\0\1\4\11\3\1\0"+ + "\1\4\10\3\1\0\1\4\6\3\1\0\1\4\3\3"+ + "\1\0\1\4\1\3\1\0\1\4\1\0\1\4\1\0"+ + "\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[514]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\121\0\242\0\363\0\u0144\0\u0195\0\u01e6\0\u0237"+ + "\0\u0288\0\u02d9\0\u032a\0\u037b\0\u03cc\0\u041d\0\u046e\0\u04bf"+ + "\0\u0510\0\u0561\0\u0195\0\u0195\0\u05b2\0\u0603\0\u0654\0\u06a5"+ + "\0\u06f6\0\u0747\0\u0798\0\u07e9\0\u083a\0\u088b\0\u08dc\0\u092d"+ + "\0\u097e\0\u09cf\0\u0a20\0\u0a71\0\u0ac2\0\u0b13\0\u0b64\0\u0bb5"+ + "\0\u0c06\0\u0c57\0\u0ca8\0\u0cf9\0\u0d4a\0\u0d9b\0\u0dec\0\u0e3d"+ + "\0\u0e8e\0\u0195\0\u0195\0\u0195\0\u0195\0\u0195\0\u0195\0\u0195"+ + "\0\u0edf\0\u0f30\0\u0f81\0\u0fd2\0\u1023\0\u1074\0\u10c5\0\u0195"+ + "\0\u0195\0\u1116\0\u1167\0\u11b8\0\u0195\0\u1209\0\u0195\0\u0195"+ + "\0\u1209\0\u125a\0\u12ab\0\u12fc\0\u134d\0\u139e\0\u0195\0\u13ef"+ + "\0\u1440\0\u1491\0\u14e2\0\u1533\0\u1584\0\u15d5\0\u1626\0\u1677"+ + "\0\u16c8\0\u1719\0\u176a\0\u17bb\0\u180c\0\u185d\0\u18ae\0\u18ff"+ + "\0\u1950\0\u19a1\0\u19f2\0\u1a43\0\u1a94\0\u1ae5\0\u1b36\0\u1b87"+ + "\0\u1bd8\0\u1c29\0\u1c7a\0\u1ccb\0\u1d1c\0\u1d6d\0\u1dbe\0\u1e0f"+ + "\0\u1e60\0\u032a\0\u1eb1\0\u1f02\0\u1f53\0\u1fa4\0\u1ff5\0\u2046"+ + "\0\u2097\0\u20e8\0\u2139\0\u218a\0\u21db\0\u222c\0\u227d\0\u22ce"+ + "\0\u231f\0\u2370\0\u23c1\0\u2412\0\u2463\0\u24b4\0\u2505\0\u2556"+ + "\0\u25a7\0\u25f8\0\u2649\0\u269a\0\u26eb\0\u273c\0\u278d\0\u27de"+ + "\0\u282f\0\u2880\0\u28d1\0\u2922\0\u0195\0\u2973\0\u29c4\0\u0195"+ + "\0\u0195\0\u2a15\0\u0195\0\u2a66\0\u2ab7\0\u2b08\0\u2b59\0\u2baa"+ + "\0\u2bfb\0\u2c4c\0\u2c9d\0\u2cee\0\u2d3f\0\u2d90\0\u2de1\0\u2e32"+ + "\0\u2e83\0\u2ed4\0\u2f25\0\u2f76\0\u2fc7\0\u3018\0\u3069\0\u30ba"+ + "\0\u310b\0\u315c\0\u31ad\0\u31fe\0\u324f\0\u32a0\0\u32f1\0\u3342"+ + "\0\u3393\0\u33e4\0\u3435\0\u3486\0\u34d7\0\u3528\0\u3579\0\u35ca"+ + "\0\u361b\0\u366c\0\u36bd\0\u370e\0\u375f\0\u37b0\0\u3801\0\u3852"+ + "\0\u38a3\0\u38f4\0\u3945\0\u3996\0\u39e7\0\u3a38\0\u3a89\0\u3ada"+ + "\0\u3b2b\0\u3b7c\0\u3bcd\0\u3c1e\0\u3c6f\0\u3cc0\0\u3d11\0\u3d62"+ + "\0\u3db3\0\u3e04\0\u3e55\0\u3ea6\0\u3ef7\0\u3f48\0\u3f99\0\u3fea"+ + "\0\u403b\0\u408c\0\u40dd\0\u412e\0\u417f\0\u41d0\0\u4221\0\u2ab7"+ + "\0\u4272\0\u42c3\0\u4314\0\u4365\0\u43b6\0\u4407\0\u4458\0\u44a9"+ + "\0\u44fa\0\u454b\0\u459c\0\u45ed\0\u463e\0\u468f\0\u46e0\0\u4731"+ + "\0\u4782\0\u47d3\0\u4824\0\u4875\0\u48c6\0\u4917\0\u4968\0\u49b9"+ + "\0\u4a0a\0\u4a5b\0\u4aac\0\u4afd\0\u4b4e\0\u4b9f\0\u4bf0\0\u032a"+ + "\0\u4c41\0\u4c92\0\u4ce3\0\u4d34\0\u4d85\0\u4dd6\0\u4e27\0\u4e78"+ + "\0\u4ec9\0\u4f1a\0\u4f6b\0\u4fbc\0\u500d\0\u505e\0\u50af\0\u5100"+ + "\0\u5151\0\u51a2\0\u51f3\0\u5244\0\u5295\0\u52e6\0\u5337\0\u5388"+ + "\0\u53d9\0\u542a\0\u547b\0\u54cc\0\u551d\0\u032a\0\u556e\0\u55bf"+ + "\0\u5610\0\u5661\0\u56b2\0\u5703\0\u31fe\0\u5754\0\u57a5\0\u57f6"+ + "\0\u5847\0\u5898\0\u58e9\0\u593a\0\u598b\0\u59dc\0\u5a2d\0\u5a7e"+ + "\0\u5acf\0\u5b20\0\u5b71\0\u5bc2\0\u5c13\0\u5c64\0\u5cb5\0\u5d06"+ + "\0\u5d57\0\u5da8\0\u5df9\0\u5e4a\0\u5e9b\0\u5eec\0\u5f3d\0\u5f8e"+ + "\0\u5fdf\0\u6030\0\u6081\0\u60d2\0\u6123\0\u6174\0\u61c5\0\u6216"+ + "\0\u6267\0\u62b8\0\u6309\0\u635a\0\u63ab\0\u63fc\0\u644d\0\u649e"+ + "\0\u64ef\0\u6540\0\u6591\0\u65e2\0\u6633\0\u6684\0\u66d5\0\u6726"+ + "\0\u6777\0\u67c8\0\u6819\0\u686a\0\u68bb\0\u690c\0\u695d\0\u69ae"+ + "\0\u69ff\0\u6a50\0\u6aa1\0\u6af2\0\u6b43\0\u6b94\0\u6be5\0\u6c36"+ + "\0\u6c87\0\u6cd8\0\u6d29\0\u6d7a\0\u6dcb\0\u6e1c\0\u6e6d\0\u6ebe"+ + "\0\u6f0f\0\u6f60\0\u6fb1\0\u7002\0\u7053\0\u70a4\0\u70f5\0\u7146"+ + "\0\u7197\0\u71e8\0\u7239\0\u728a\0\u72db\0\u732c\0\u737d\0\u73ce"+ + "\0\u741f\0\u7470\0\u74c1\0\u7512\0\u7563\0\u75b4\0\u032a\0\u7605"+ + "\0\u7656\0\u76a7\0\u76f8\0\u7749\0\u779a\0\u77eb\0\u783c\0\u788d"+ + "\0\u78de\0\u792f\0\u7980\0\u79d1\0\u7a22\0\u7a73\0\u7ac4\0\u7b15"+ + "\0\u7b66\0\u7bb7\0\u7c08\0\u7c59\0\u7caa\0\u7cfb\0\u7d4c\0\u7d9d"+ + "\0\u7dee\0\u7e3f\0\u7e90\0\u7ee1\0\u032a\0\u7f32\0\u7f83\0\u7fd4"+ + "\0\u8025\0\u8076\0\u80c7\0\u8118\0\u8169\0\u81ba\0\u820b\0\u825c"+ + "\0\u82ad\0\u82fe\0\u834f\0\u83a0\0\u83f1\0\u8442\0\u8493\0\u84e4"+ + "\0\u8535\0\u8586\0\u85d7\0\u8628\0\u8679\0\u86ca\0\u871b\0\u876c"+ + "\0\u87bd\0\u880e\0\u885f\0\u88b0\0\u8901\0\u8952\0\u89a3\0\u89f4"+ + "\0\u8a45\0\u8a96\0\u8ae7\0\u8b38\0\u8b89\0\u8bda\0\u8c2b\0\u8c7c"+ + "\0\u8ccd\0\u8d1e\0\u8d6f\0\u8dc0\0\u8e11\0\u8e62\0\u8eb3\0\u8f04"+ + "\0\u8f55\0\u8fa6\0\u8ff7\0\u9048\0\u9099\0\u90ea\0\u913b\0\u918c"+ + "\0\u91dd\0\u922e\0\u927f\0\u92d0\0\u9321\0\u9372\0\u93c3\0\u9414"+ + "\0\u9465\0\u94b6\0\u9507\0\u9558\0\u95a9\0\u95fa\0\u964b\0\u969c"+ + "\0\u96ed\0\u973e\0\u978f\0\u97e0\0\u9831\0\u9882\0\u98d3\0\u9924"+ + "\0\u9975\0\u99c6"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[514]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\6\1\10\1\11\1\12\1\13\1\6"+ + "\1\14\1\15\2\13\1\16\3\15\1\17\1\20\1\21"+ + "\1\22\1\23\1\24\1\6\1\25\1\26\1\27\1\30"+ + "\1\31\1\32\1\13\1\33\1\34\1\35\3\13\1\36"+ + "\1\13\1\37\2\13\1\40\1\41\1\42\1\43\1\44"+ + "\1\13\1\45\1\46\1\47\1\50\1\51\1\13\1\52"+ + "\1\53\1\54\1\55\1\13\1\56\1\57\1\60\2\13"+ + "\1\61\1\62\1\63\1\64\1\65\1\66\1\67\1\70"+ + "\1\12\1\71\1\72\1\12\1\70\1\73\1\74\1\75"+ + "\1\6\1\13\1\76\1\77\1\100\21\76\1\101\1\76"+ + "\1\102\72\76\1\103\1\77\1\100\22\103\1\101\1\104"+ + "\72\103\5\105\1\106\111\105\1\107\1\105\5\110\1\111"+ + "\4\110\3\112\3\110\1\112\1\110\1\112\4\110\51\112"+ + "\20\110\1\112\123\0\1\6\121\0\1\10\121\0\1\113"+ + "\1\114\101\0\1\70\120\0\1\70\17\0\13\13\1\0"+ + "\1\13\4\0\51\13\20\0\1\13\10\0\1\115\1\116"+ + "\1\117\1\120\1\0\1\121\1\122\1\121\1\117\1\123"+ + "\1\124\13\0\1\117\1\124\6\0\1\117\1\0\1\120"+ + "\1\117\7\0\1\117\47\0\2\15\1\117\2\0\3\15"+ + "\1\117\1\123\1\124\13\0\1\117\1\124\6\0\1\117"+ + "\2\0\1\117\7\0\1\117\45\0\13\13\1\0\1\13"+ + "\4\0\4\13\1\125\44\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\126\41\13\20\0\1\13"+ + "\10\0\2\123\3\0\3\123\107\0\13\13\1\0\1\13"+ + "\4\0\21\13\1\127\22\13\1\130\4\13\20\0\1\13"+ + "\23\0\1\70\63\0\1\70\17\0\13\13\1\0\1\13"+ + "\4\0\1\13\1\131\47\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\4\13\1\132\1\13\1\133\4\13"+ + "\1\134\35\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\135\7\13\1\136\1\137\1\13\1\140"+ + "\7\13\1\141\22\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\142\7\13\1\143\34\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\144"+ + "\40\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\145\5\13\1\146\1\147\4\13\1\150\34\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\151"+ + "\42\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\152\1\13\1\153\7\13\1\154\27\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\155\7\13"+ + "\1\156\5\13\1\157\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\160\6\13\1\161\1\13"+ + "\1\162\26\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\6\13\1\163\1\13\1\164\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\165\5\13\1\166"+ + "\1\167\5\13\1\170\33\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\171\3\13\1\172\11\13\1\173"+ + "\32\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\174\42\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\175\42\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\14\13\1\176\34\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\177"+ + "\4\13\1\200\35\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\201\1\202\4\13\1\203\34\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\204\42\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\7\13\1\205\1\13\1\206\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\13\1\207\47\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\210\4\13\1\211\3\13\1\212\34\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\213\42\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\214\1\13\1\215\5\13\1\216\32\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\217\50\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\14\13\1\220"+ + "\34\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\221\32\13\20\0\1\13\6\0\6\13\1\222"+ + "\4\13\1\0\1\13\4\0\51\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\11\13\1\223\37\13\20\0"+ + "\1\13\107\0\1\70\1\224\117\0\1\70\1\0\1\12"+ + "\116\0\1\70\4\0\1\70\113\0\1\70\5\0\1\70"+ + "\112\0\1\70\6\0\1\70\2\0\1\76\2\0\21\76"+ + "\1\0\1\76\1\0\72\76\2\0\1\100\116\0\2\225"+ + "\1\0\5\225\1\226\4\225\2\226\1\227\101\225\1\103"+ + "\2\0\22\103\2\0\72\103\2\225\1\0\116\225\4\0"+ + "\1\230\126\0\3\112\3\0\1\112\1\0\1\112\4\0"+ + "\51\112\13\0\1\231\4\0\1\112\1\113\1\232\1\233"+ + "\116\113\5\234\1\235\113\234\10\0\1\115\1\116\1\117"+ + "\2\0\1\121\1\122\1\121\1\117\1\123\1\124\13\0"+ + "\1\117\1\124\6\0\1\117\2\0\1\117\7\0\1\117"+ + "\47\0\2\116\3\0\3\116\1\117\1\123\1\124\14\0"+ + "\1\124\6\0\1\117\2\0\1\117\7\0\1\117\47\0"+ + "\1\236\1\237\2\0\5\237\1\0\1\237\4\0\2\237"+ + "\3\0\1\237\2\0\1\237\6\0\1\237\2\0\1\237"+ + "\5\0\3\237\47\0\1\240\1\116\1\117\2\0\3\240"+ + "\1\117\1\123\1\124\13\0\1\117\1\124\6\0\1\117"+ + "\2\0\1\117\7\0\1\117\47\0\1\121\1\116\1\117"+ + "\2\0\3\121\1\117\1\123\1\124\13\0\1\117\1\124"+ + "\6\0\1\117\2\0\1\117\7\0\1\117\47\0\2\123"+ + "\3\0\3\123\1\117\1\0\1\124\14\0\1\124\6\0"+ + "\1\117\2\0\1\117\7\0\1\117\47\0\2\241\3\0"+ + "\3\241\3\0\1\242\72\0\1\242\10\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\243\10\13\1\244\33\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\245"+ + "\42\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\246\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\44\13\1\247\4\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\2\13\1\250\46\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\251"+ + "\40\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\252\42\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\253\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\254\3\13\1\255\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\256\37\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\6\13\1\257\42\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\23\13\1\260\25\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\15\13\1\261\33\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\262"+ + "\12\13\1\162\2\13\1\253\32\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\4\13\1\263\10\13\1\264"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\265\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\2\13\1\253\1\266\45\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\267\37\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\270"+ + "\50\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\166\50\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\271\37\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\2\13\1\253\46\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\16\13\1\272\32\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\273\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\274\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\26\13\1\162\22\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\275\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\2\13"+ + "\1\276\1\277\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\23\13\1\300\25\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\16\13\1\301\32\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\22\13\1\302"+ + "\26\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\152\41\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\162\44\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\303\42\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\11\13\1\304"+ + "\37\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\305\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\306\6\13\1\307\33\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\13\1\310"+ + "\47\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\311\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\312\5\13\1\313\33\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\314"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\315\42\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\316\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\20\13\1\317\30\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\320\5\13"+ + "\1\321\42\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\322\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\16\13\1\323\32\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\324\41\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\325"+ + "\1\326\13\13\1\327\31\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\35\13\1\330\13\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\331\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\332\1\333\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\334\42\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\15\13\1\335\33\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\36\13\1\336"+ + "\12\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\24\13\1\337\24\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\340\10\13\1\341\30\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\5\13\1\342"+ + "\43\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\4\13\1\343\44\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\344\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\44\13\1\345\4\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\346"+ + "\46\13\20\0\1\13\107\0\1\70\1\12\20\0\1\227"+ + "\4\0\3\227\111\0\1\231\4\0\3\231\103\0\1\233"+ + "\116\0\5\234\1\347\113\234\4\0\1\233\1\350\123\0"+ + "\1\236\1\237\1\117\1\0\5\237\1\0\1\237\4\0"+ + "\2\237\3\0\1\237\1\0\1\117\1\237\6\0\1\237"+ + "\2\0\1\237\5\0\3\237\47\0\2\351\1\117\1\0"+ + "\5\351\1\0\1\351\4\0\2\351\3\0\1\351\1\0"+ + "\1\117\1\351\6\0\1\351\2\0\1\351\5\0\3\351"+ + "\47\0\1\352\1\116\1\117\2\0\3\352\1\117\1\123"+ + "\1\124\13\0\1\117\1\124\6\0\1\117\2\0\1\117"+ + "\7\0\1\117\47\0\2\241\3\0\3\241\1\117\25\0"+ + "\1\117\2\0\1\117\7\0\1\117\47\0\2\241\3\0"+ + "\3\241\107\0\13\13\1\0\1\13\4\0\1\353\50\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\354\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\355\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\356\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\34\13\1\357\14\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\360"+ + "\45\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\361\50\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\7\13\1\362\41\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\162\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\363\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\15\13"+ + "\1\364\33\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\5\13\1\365\43\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\4\13\1\366\44\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\166\40\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\266\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\367\37\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\370\42\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\2\13\1\162\46\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\16\13"+ + "\1\371\32\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\5\13\1\372\43\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\2\13\1\366\1\373\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\264"+ + "\46\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\24\13\1\162\24\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\20\13\1\162\30\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\374\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\375"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\162\41\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\376\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\377\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\257"+ + "\1\u0100\41\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\13\1\314\47\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\u0101\50\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\366\50\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\u0102\50\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\12\13\1\u0103"+ + "\36\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\u0104\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\25\13\1\u0105\23\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\363\41\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\162"+ + "\42\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\u0106\50\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\17\13\1\162\31\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\253\41\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\u0107\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\u0108\40\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\23\13\1\u0109\25\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\2\13\1\u010a\46\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u010b\37\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u010c\44\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\13\1\u010d\47\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u010e\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\u010f\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\u0110\40\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u0111\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u0112\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\15\13\1\u0113\33\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\15\13"+ + "\1\u0114\33\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\u0115\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\4\13\1\355\44\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\17\13\1\u0108\31\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\16\13"+ + "\1\u0116\32\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u0117\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\u0118\41\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\13\1\u0119\47\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\12\13\1\u011a"+ + "\36\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\u011b\1\13\1\u011c\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\u011d\5\13\1\u011e"+ + "\37\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\40\13\1\u011f\10\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\16\13\1\u0120\32\13\20\0\1\13\4\234"+ + "\1\233\1\347\113\234\10\0\2\u0121\1\117\1\0\5\u0121"+ + "\1\0\1\u0121\4\0\2\u0121\3\0\1\u0121\1\0\1\117"+ + "\1\u0121\6\0\1\u0121\2\0\1\u0121\5\0\3\u0121\47\0"+ + "\1\u0122\1\116\1\117\2\0\3\u0122\1\117\1\123\1\124"+ + "\13\0\1\117\1\124\6\0\1\117\2\0\1\117\7\0"+ + "\1\117\45\0\13\13\1\0\1\13\4\0\13\13\1\u0123"+ + "\35\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\14\13\1\u0124\34\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\u0108\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\23\13\1\u0125\25\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\44\13\1\u0126"+ + "\4\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\4\13\1\u0127\44\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\12\13\1\162\36\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\10\13\1\u0128\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u0129"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\u012a\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\14\13\1\u012b\34\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\162\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\u012c"+ + "\46\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\26\13\1\u012d\22\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\u012e\44\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\14\13\1\162\34\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u012f"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u0130\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\25\13\1\253\23\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u0131\50\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u0132\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\u0133\40\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\u0134\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\u0135\41\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\u0136\50\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\u0137"+ + "\40\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\134\50\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\176\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u0138\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\u0139\50\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\2\13\1\u013a"+ + "\46\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\u013b\40\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\u013c\35\13\1\u013d\12\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\316\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\24\13"+ + "\1\u013e\24\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u013f\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\u0140\17\13\1\u0141\24\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\21\13\1\u0142"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\355\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\u0143\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u0144\50\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u0145\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\5\13"+ + "\1\u0146\43\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\u0147\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\41\13\1\u0148\7\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u0149\40\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\u014a"+ + "\50\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\26\13\1\u011e\22\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\335\50\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u014b\33\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\323\50\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\33\13\1\u014c"+ + "\15\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\23\13\1\u014d\25\13\20\0\1\13\10\0\2\u014e\1\117"+ + "\1\0\5\u014e\1\0\1\u014e\4\0\2\u014e\3\0\1\u014e"+ + "\1\0\1\117\1\u014e\6\0\1\u014e\2\0\1\u014e\5\0"+ + "\3\u014e\47\0\1\u014f\1\116\1\117\2\0\3\u014f\1\117"+ + "\1\123\1\124\13\0\1\117\1\124\6\0\1\117\2\0"+ + "\1\117\7\0\1\117\45\0\13\13\1\0\1\13\4\0"+ + "\33\13\1\u0150\15\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\20\13\1\u0151\30\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\u0152\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\u0153\50\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\u012e"+ + "\50\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\162\43\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\u0154\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\4\13\1\u0155\44\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u0156"+ + "\33\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\162\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\u0157\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\17\13\1\264\31\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\11\13\1\u0158"+ + "\37\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\22\13\1\u0159\26\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\20\13\1\u015a\30\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\366\41\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\7\13\1\u015b"+ + "\41\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\24\13\1\253\24\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\5\13\1\u015c\43\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\u015d\50\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u011e\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\31\13"+ + "\1\u015e\6\13\1\u015f\10\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\323\37\13\1\u0160\10\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\5\13\1\u0161"+ + "\43\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\u0162\40\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\u0163\50\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\u0164\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u0165\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\u0166\40\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\34\13\1\u0167\14\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\24\13\1\u0168\24\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\u0169\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\15\13"+ + "\1\u016a\33\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\14\13\1\u016b\34\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u016c\33\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\u016d\42\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u016e\44\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\24\13\1\316\24\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\20\13\1\u016f\30\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\40\13\1\u0170\10\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\23\13"+ + "\1\u0171\25\13\20\0\1\13\10\0\2\u0172\1\117\1\0"+ + "\5\u0172\1\0\1\u0172\4\0\2\u0172\3\0\1\u0172\1\0"+ + "\1\117\1\u0172\6\0\1\u0172\2\0\1\u0172\5\0\3\u0172"+ + "\47\0\1\u0173\1\116\1\117\2\0\3\u0173\1\117\1\123"+ + "\1\124\13\0\1\117\1\124\6\0\1\117\2\0\1\117"+ + "\7\0\1\117\45\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\u0174\37\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u0175\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u0176\33\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\366\43\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\22\13"+ + "\1\u0177\26\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\6\13\1\u0178\42\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u0179\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\16\13\1\253\32\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\5\13"+ + "\1\u017a\43\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u017b\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\u017c\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\13\13\1\162\35\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\u017d"+ + "\45\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u0108\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\u017e\50\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\u017f\42\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\u0180\42\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\u0141\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\42\13\1\u0181\6\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\u0182\41\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\u0183\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\16\13"+ + "\1\u0184\32\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\4\13\1\u0108\44\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\u0185\32\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\30\13\1\u0186\2\13"+ + "\1\u0150\15\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\15\13\1\u0187\33\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\3\13\1\u0188\45\13\20\0\1\13"+ + "\6\0\12\13\1\u0189\1\0\1\13\4\0\47\13\1\u018a"+ + "\1\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\25\13\1\u018b\23\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\15\13\1\u018c\33\13\20\0\1\13\6\0"+ + "\12\13\1\u018d\1\0\1\13\4\0\51\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u018e\40\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\46\13"+ + "\1\u018f\2\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\6\13\1\u0190\42\13\20\0\1\13\10\0\2\u0191"+ + "\1\117\1\0\5\u0191\1\0\1\u0191\4\0\2\u0191\3\0"+ + "\1\u0191\1\0\1\117\1\u0191\6\0\1\u0191\2\0\1\u0191"+ + "\5\0\3\u0191\47\0\1\u0192\1\116\1\117\2\0\3\u0192"+ + "\1\117\1\123\1\124\13\0\1\117\1\124\6\0\1\117"+ + "\2\0\1\117\7\0\1\117\45\0\13\13\1\0\1\13"+ + "\4\0\17\13\1\327\31\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\3\13\1\u0193\45\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\u0194\42\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\23\13"+ + "\1\162\25\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\u0195\37\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\366\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u0196\40\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\5\13"+ + "\1\253\43\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\u0197\37\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\313\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\2\13\1\u0198\46\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\u0199\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\u019a\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\u019b\32\13\20\0\1\13"+ + "\6\0\6\13\1\u019c\4\13\1\0\1\13\4\0\36\13"+ + "\1\u019d\4\13\1\u019e\5\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u019f\33\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\23\13\1\u01a0\25\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\u01a1\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\u01a2\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\27\13\1\u011e\21\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\13\13\1\u018e\35\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\15\13"+ + "\1\u01a3\33\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u01a4\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u01a5\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u01a6\37\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\u01a7\42\13\20\0\1\13\6\0\13\13\1\0\1\u01a8"+ + "\4\0\51\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\4\13\1\u01a9\44\13\20\0\1\13\10\0\2\u01aa"+ + "\1\117\1\0\5\u01aa\1\0\1\u01aa\4\0\2\u01aa\3\0"+ + "\1\u01aa\1\0\1\117\1\u01aa\6\0\1\u01aa\2\0\1\u01aa"+ + "\5\0\3\u01aa\47\0\1\u01ab\1\116\1\117\2\0\3\u01ab"+ + "\1\117\1\123\1\124\13\0\1\117\1\124\6\0\1\117"+ + "\2\0\1\117\7\0\1\117\45\0\13\13\1\0\1\13"+ + "\4\0\15\13\1\u01ac\33\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\u01ad\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\15\13\1\u01ae\33\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\u01af\42\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\264\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\3\13\1\u018e\45\13\20\0\1\13"+ + "\6\0\12\13\1\u01b0\1\0\1\13\4\0\51\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\36\13\1\u01b1"+ + "\12\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\u01b2\40\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\u01b3\1\u01b4\43\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\u01b5\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\14\13"+ + "\1\u01b6\34\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u01b7\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\u01b8\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\34\13\1\u01b9\14\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\15\13\1\u01ba"+ + "\4\13\1\u01bb\26\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\u01bc\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\u01bd\45\13\20\0"+ + "\1\13\6\0\6\13\1\u01be\4\13\1\0\1\13\4\0"+ + "\51\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\u01bf\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\4\13\1\u01c0\44\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\21\13\1\127\27\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\u01c1"+ + "\45\13\20\0\1\13\10\0\2\u01c2\1\117\1\0\5\u01c2"+ + "\1\0\1\u01c2\4\0\2\u01c2\3\0\1\u01c2\1\0\1\117"+ + "\1\u01c2\6\0\1\u01c2\2\0\1\u01c2\5\0\3\u01c2\47\0"+ + "\1\u01c3\1\116\1\117\2\0\3\u01c3\1\117\1\123\1\124"+ + "\13\0\1\117\1\124\6\0\1\117\2\0\1\117\7\0"+ + "\1\117\45\0\13\13\1\0\1\13\4\0\5\13\1\u018e"+ + "\43\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\27\13\1\u017d\21\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\22\13\1\162\26\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\u01c4\42\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\16\13\1\u01c5"+ + "\32\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u01c6\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\24\13\1\u01c7\24\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\5\13\1\u01c8\43\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\u01c9\50\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u01ca\44\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\u01cb\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\u01cc\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\22\13\1\u01cd\26\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\7\13"+ + "\1\u01ce\41\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\22\13\1\u0141\26\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\u01cc\41\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\14\13\1\u01cf\34\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u01d0\44\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u01d1\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\20\13\1\u01d2\30\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u01d3\40\13"+ + "\20\0\1\13\10\0\2\u01d4\1\117\1\0\5\u01d4\1\0"+ + "\1\u01d4\4\0\2\u01d4\3\0\1\u01d4\1\0\1\117\1\u01d4"+ + "\6\0\1\u01d4\2\0\1\u01d4\5\0\3\u01d4\47\0\1\u01d5"+ + "\1\116\1\117\2\0\3\u01d5\1\117\1\123\1\124\13\0"+ + "\1\117\1\124\6\0\1\117\2\0\1\117\7\0\1\117"+ + "\45\0\13\13\1\0\1\13\4\0\16\13\1\u01d6\32\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\23\13"+ + "\1\u01d7\25\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\5\13\1\316\43\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\u01d8\32\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\u01d9\40\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\u016f\45\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\u01da\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\15\13\1\u01db\33\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\17\13\1\u018e\31\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\30\13"+ + "\1\u01dc\20\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\17\13\1\u0141\31\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\u01cc\42\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\4\13\1\u01dd\44\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\u018e\44\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\u0198\50\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\17\13\1\u01de\31\13\20\0\1\13\10\0"+ + "\2\u01df\1\117\1\0\5\u01df\1\0\1\u01df\4\0\2\u01df"+ + "\3\0\1\u01df\1\0\1\117\1\u01df\6\0\1\u01df\2\0"+ + "\1\u01df\5\0\3\u01df\47\0\1\u01e0\1\116\1\117\2\0"+ + "\3\u01e0\1\117\1\123\1\124\13\0\1\117\1\124\6\0"+ + "\1\117\2\0\1\117\7\0\1\117\45\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\u01cc\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\23\13\1\u01e1\25\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\20\13\1\u01e2"+ + "\30\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\2\13\1\u01e3\46\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\u01e4\50\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\u01e5\42\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\6\13\1\u01e6\42\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\u01e7"+ + "\50\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\34\13\1\u01e8\14\13\20\0\1\13\10\0\2\u01e9\1\117"+ + "\1\0\5\u01e9\1\0\1\u01e9\4\0\2\u01e9\3\0\1\u01e9"+ + "\1\0\1\117\1\u01e9\6\0\1\u01e9\2\0\1\u01e9\5\0"+ + "\3\u01e9\47\0\1\u01ea\1\116\1\117\2\0\3\u01ea\1\117"+ + "\1\123\1\124\13\0\1\117\1\124\6\0\1\117\2\0"+ + "\1\117\7\0\1\117\45\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\u01eb\42\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\u01ec\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\2\13\1\u018e\46\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\u01ed"+ + "\31\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u018e\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\16\13\1\u01ee\32\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\13\13\1\u01ef\35\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\23\13\1\u01f0"+ + "\25\13\20\0\1\13\10\0\2\u01f1\1\117\1\0\5\u01f1"+ + "\1\0\1\u01f1\4\0\2\u01f1\3\0\1\u01f1\1\0\1\117"+ + "\1\u01f1\6\0\1\u01f1\2\0\1\u01f1\5\0\3\u01f1\47\0"+ + "\1\u01f2\1\116\1\117\2\0\3\u01f2\1\117\1\123\1\124"+ + "\13\0\1\117\1\124\6\0\1\117\2\0\1\117\7\0"+ + "\1\117\45\0\13\13\1\0\1\13\4\0\4\13\1\u01a0"+ + "\44\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\u0198\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\36\13\1\u019d\12\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\11\13\1\u01f3\37\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\36\13\1\u01f4"+ + "\12\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\u01f5\40\13\20\0\1\13\10\0\2\u01f6\1\117"+ + "\1\0\5\u01f6\1\0\1\u01f6\4\0\2\u01f6\3\0\1\u01f6"+ + "\1\0\1\117\1\u01f6\6\0\1\u01f6\2\0\1\u01f6\5\0"+ + "\3\u01f6\47\0\1\u01f7\1\116\1\117\2\0\3\u01f7\1\117"+ + "\1\123\1\124\13\0\1\117\1\124\6\0\1\117\2\0"+ + "\1\117\7\0\1\117\45\0\13\13\1\0\1\13\4\0"+ + "\17\13\1\u01e3\31\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\15\13\1\u01f8\33\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\4\13\1\u019f\44\13\20\0"+ + "\1\13\10\0\2\u01f9\1\117\1\0\5\u01f9\1\0\1\u01f9"+ + "\4\0\2\u01f9\3\0\1\u01f9\1\0\1\117\1\u01f9\6\0"+ + "\1\u01f9\2\0\1\u01f9\5\0\3\u01f9\47\0\1\u01fa\1\116"+ + "\1\117\2\0\3\u01fa\1\117\1\123\1\124\13\0\1\117"+ + "\1\124\6\0\1\117\2\0\1\117\7\0\1\117\45\0"+ + "\13\13\1\0\1\13\4\0\27\13\1\u016f\21\13\20\0"+ + "\1\13\10\0\2\u01fb\1\117\1\0\5\u01fb\1\0\1\u01fb"+ + "\4\0\2\u01fb\3\0\1\u01fb\1\0\1\117\1\u01fb\6\0"+ + "\1\u01fb\2\0\1\u01fb\5\0\3\u01fb\47\0\1\u01fc\1\116"+ + "\1\117\2\0\3\u01fc\1\117\1\123\1\124\13\0\1\117"+ + "\1\124\6\0\1\117\2\0\1\117\7\0\1\117\47\0"+ + "\2\u01fd\1\117\1\0\5\u01fd\1\0\1\u01fd\4\0\2\u01fd"+ + "\3\0\1\u01fd\1\0\1\117\1\u01fd\6\0\1\u01fd\2\0"+ + "\1\u01fd\5\0\3\u01fd\47\0\1\u01fe\1\116\1\117\2\0"+ + "\3\u01fe\1\117\1\123\1\124\13\0\1\117\1\124\6\0"+ + "\1\117\2\0\1\117\7\0\1\117\51\0\1\117\23\0"+ + "\1\117\72\0\1\u01ff\1\116\1\117\2\0\3\u01ff\1\117"+ + "\1\123\1\124\13\0\1\117\1\124\6\0\1\117\2\0"+ + "\1\117\7\0\1\117\47\0\1\u0200\1\116\1\117\2\0"+ + "\3\u0200\1\117\1\123\1\124\13\0\1\117\1\124\6\0"+ + "\1\117\2\0\1\117\7\0\1\117\47\0\1\u0201\1\116"+ + "\1\117\2\0\3\u0201\1\117\1\123\1\124\13\0\1\117"+ + "\1\124\6\0\1\117\2\0\1\117\7\0\1\117\47\0"+ + "\1\u0202\1\116\1\117\2\0\3\u0202\1\117\1\123\1\124"+ + "\13\0\1\117\1\124\6\0\1\117\2\0\1\117\7\0"+ + "\1\117\47\0\2\116\1\117\2\0\3\116\1\117\1\123"+ + "\1\124\13\0\1\117\1\124\6\0\1\117\2\0\1\117"+ + "\7\0\1\117\37\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[39447]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\14\1\2\11\35\1\7\11\7\1\2\11"+ + "\3\1\1\11\1\1\2\11\3\1\1\0\2\1\1\11"+ + "\1\0\3\1\1\0\100\1\1\11\2\1\2\11\1\1"+ + "\1\11\1\0\5\1\1\0\104\1\2\0\353\1\1\0"+ + "\12\1\1\0\11\1\1\0\7\1\1\0\4\1\1\0"+ + "\2\1\1\0\1\1\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[514]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JavaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public JavaLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public JavaLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1830) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { return token(TokenType.OPERATOR, -PARAN); + } + case 28: break; + case 20: + { return token(TokenType.KEYWORD); + } + case 29: break; + case 4: + { return token(TokenType.NUMBER); + } + case 30: break; + case 18: + { yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } + case 31: break; + case 22: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + case 32: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 33: break; + case 9: + { return token(TokenType.OPERATOR, CURLY); + } + case 34: break; + case 10: + { return token(TokenType.OPERATOR, -CURLY); + } + case 35: break; + case 17: + { yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + case 36: break; + case 13: + { tokenLength += yylength(); + } + case 37: break; + case 14: + { yybegin(YYINITIAL); + } + case 38: break; + case 6: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 39: break; + case 23: + { yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + case 40: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 41: break; + case 24: + { return token(TokenType.TYPE); + } + case 42: break; + case 26: + { return token(TokenType.WARNING); + } + case 43: break; + case 12: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 44: break; + case 7: + { return token(TokenType.OPERATOR, PARAN); + } + case 45: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 46: break; + case 21: + { tokenLength += 2; + } + case 47: break; + case 27: + { return token(TokenType.TYPE2); + } + case 48: break; + case 25: + { return token(TokenType.ERROR); + } + case 49: break; + case 16: + { tokenLength ++; + } + case 50: break; + case 11: + { return token(TokenType.OPERATOR, BRACKET); + } + case 51: break; + case 19: + { return token(TokenType.COMMENT); + } + case 52: break; + case 5: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 53: break; + case 1: + { + } + case 54: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaScriptLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaScriptLexer.java new file mode 100644 index 000000000..fd7104d83 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/JavaScriptLexer.java @@ -0,0 +1,1096 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/javascript.flex + */ +public final class JavaScriptLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int SSTRING = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\104"+ + "\1\24\1\0\1\6\1\104\1\105\1\25\1\72\1\73\1\5\1\107"+ + "\1\100\1\23\1\21\1\4\1\10\1\16\2\15\4\17\2\11\1\71"+ + "\1\100\1\103\1\101\1\102\1\100\1\0\1\62\1\63\1\57\1\14"+ + "\1\22\1\20\2\6\1\53\2\6\1\12\1\64\1\54\1\65\2\6"+ + "\1\56\1\70\1\6\1\55\2\6\1\13\2\6\1\76\1\26\1\77"+ + "\1\104\1\6\1\0\1\32\1\27\1\34\1\44\1\31\1\46\1\51"+ + "\1\37\1\42\1\66\1\33\1\45\1\60\1\41\1\40\1\61\1\6"+ + "\1\30\1\35\1\36\1\43\1\52\1\50\1\67\1\47\1\6\1\74"+ + "\1\106\1\75\1\100\41\7\2\0\4\6\4\0\1\6\2\0\1\7"+ + "\7\0\1\6\4\0\1\6\5\0\27\6\1\0\37\6\1\0\u013f\6"+ + "\31\0\162\6\4\0\14\6\16\0\5\6\11\0\1\6\21\0\130\7"+ + "\5\0\23\7\12\0\1\6\13\0\1\6\1\0\3\6\1\0\1\6"+ + "\1\0\24\6\1\0\54\6\1\0\46\6\1\0\5\6\4\0\202\6"+ + "\1\0\4\7\3\0\105\6\1\0\46\6\2\0\2\6\6\0\20\6"+ + "\41\0\46\6\2\0\1\6\7\0\47\6\11\0\21\7\1\0\27\7"+ + "\1\0\3\7\1\0\1\7\1\0\2\7\1\0\1\7\13\0\33\6"+ + "\5\0\3\6\15\0\4\7\14\0\6\7\13\0\32\6\5\0\13\6"+ + "\16\7\7\0\12\7\4\0\2\6\1\7\143\6\1\0\1\6\10\7"+ + "\1\0\6\7\2\6\2\7\1\0\4\7\2\6\12\7\3\6\2\0"+ + "\1\6\17\0\1\7\1\6\1\7\36\6\33\7\2\0\3\6\60\0"+ + "\46\6\13\7\1\6\u014f\0\3\7\66\6\2\0\1\7\1\6\20\7"+ + "\2\0\1\6\4\7\3\0\12\6\2\7\2\0\12\7\21\0\3\7"+ + "\1\0\10\6\2\0\2\6\2\0\26\6\1\0\7\6\1\0\1\6"+ + "\3\0\4\6\2\0\1\7\1\6\7\7\2\0\2\7\2\0\3\7"+ + "\11\0\1\7\4\0\2\6\1\0\3\6\2\7\2\0\12\7\4\6"+ + "\15\0\3\7\1\0\6\6\4\0\2\6\2\0\26\6\1\0\7\6"+ + "\1\0\2\6\1\0\2\6\1\0\2\6\2\0\1\7\1\0\5\7"+ + "\4\0\2\7\2\0\3\7\13\0\4\6\1\0\1\6\7\0\14\7"+ + "\3\6\14\0\3\7\1\0\11\6\1\0\3\6\1\0\26\6\1\0"+ + "\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\10\7\1\0"+ + "\3\7\1\0\3\7\2\0\1\6\17\0\2\6\2\7\2\0\12\7"+ + "\1\0\1\6\17\0\3\7\1\0\10\6\2\0\2\6\2\0\26\6"+ + "\1\0\7\6\1\0\2\6\1\0\5\6\2\0\1\7\1\6\6\7"+ + "\3\0\2\7\2\0\3\7\10\0\2\7\4\0\2\6\1\0\3\6"+ + "\4\0\12\7\1\0\1\6\20\0\1\7\1\6\1\0\6\6\3\0"+ + "\3\6\1\0\4\6\3\0\2\6\1\0\1\6\1\0\2\6\3\0"+ + "\2\6\3\0\3\6\3\0\10\6\1\0\3\6\4\0\5\7\3\0"+ + "\3\7\1\0\4\7\11\0\1\7\17\0\11\7\11\0\1\6\7\0"+ + "\3\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0\12\6\1\0"+ + "\5\6\4\0\7\7\1\0\3\7\1\0\4\7\7\0\2\7\11\0"+ + "\2\6\4\0\12\7\22\0\2\7\1\0\10\6\1\0\3\6\1\0"+ + "\27\6\1\0\12\6\1\0\5\6\2\0\1\7\1\6\7\7\1\0"+ + "\3\7\1\0\4\7\7\0\2\7\7\0\1\6\1\0\2\6\4\0"+ + "\12\7\22\0\2\7\1\0\10\6\1\0\3\6\1\0\27\6\1\0"+ + "\20\6\4\0\6\7\2\0\3\7\1\0\4\7\11\0\1\7\10\0"+ + "\2\6\4\0\12\7\22\0\2\7\1\0\22\6\3\0\30\6\1\0"+ + "\11\6\1\0\1\6\2\0\7\6\3\0\1\7\4\0\6\7\1\0"+ + "\1\7\1\0\10\7\22\0\2\7\15\0\60\6\1\7\2\6\7\7"+ + "\4\0\10\6\10\7\1\0\12\7\47\0\2\6\1\0\1\6\2\0"+ + "\2\6\1\0\1\6\2\0\1\6\6\0\4\6\1\0\7\6\1\0"+ + "\3\6\1\0\1\6\1\0\1\6\2\0\2\6\1\0\4\6\1\7"+ + "\2\6\6\7\1\0\2\7\1\6\2\0\5\6\1\0\1\6\1\0"+ + "\6\7\2\0\12\7\2\0\2\6\42\0\1\6\27\0\2\7\6\0"+ + "\12\7\13\0\1\7\1\0\1\7\1\0\1\7\4\0\2\7\10\6"+ + "\1\0\42\6\6\0\24\7\1\0\2\7\4\6\4\0\10\7\1\0"+ + "\44\7\11\0\1\7\71\0\42\6\1\0\5\6\1\0\2\6\1\0"+ + "\7\7\3\0\4\7\6\0\12\7\6\0\6\6\4\7\106\0\46\6"+ + "\12\0\51\6\7\0\132\6\5\0\104\6\5\0\122\6\6\0\7\6"+ + "\1\0\77\6\1\0\1\6\1\0\4\6\2\0\7\6\1\0\1\6"+ + "\1\0\4\6\2\0\47\6\1\0\1\6\1\0\4\6\2\0\37\6"+ + "\1\0\1\6\1\0\4\6\2\0\7\6\1\0\1\6\1\0\4\6"+ + "\2\0\7\6\1\0\7\6\1\0\27\6\1\0\37\6\1\0\1\6"+ + "\1\0\4\6\2\0\7\6\1\0\47\6\1\0\23\6\16\0\11\7"+ + "\56\0\125\6\14\0\u026c\6\2\0\10\6\12\0\32\6\5\0\113\6"+ + "\3\0\3\6\17\0\15\6\1\0\4\6\3\7\13\0\22\6\3\7"+ + "\13\0\22\6\2\7\14\0\15\6\1\0\3\6\1\0\2\7\14\0"+ + "\64\6\40\7\3\0\1\6\3\0\2\6\1\7\2\0\12\7\41\0"+ + "\3\7\2\0\12\7\6\0\130\6\10\0\51\6\1\7\126\0\35\6"+ + "\3\0\14\7\4\0\14\7\12\0\12\7\36\6\2\0\5\6\u038b\0"+ + "\154\6\224\0\234\6\4\0\132\6\6\0\26\6\2\0\6\6\2\0"+ + "\46\6\2\0\6\6\2\0\10\6\1\0\1\6\1\0\1\6\1\0"+ + "\1\6\1\0\37\6\2\0\65\6\1\0\7\6\1\0\1\6\3\0"+ + "\3\6\1\0\7\6\3\0\4\6\2\0\6\6\4\0\15\6\5\0"+ + "\3\6\1\0\7\6\17\0\4\7\32\0\5\7\20\0\2\6\23\0"+ + "\1\6\13\0\4\7\6\0\6\7\1\0\1\6\15\0\1\6\40\0"+ + "\22\6\36\0\15\7\4\0\1\7\3\0\6\7\27\0\1\6\4\0"+ + "\1\6\2\0\12\6\1\0\1\6\3\0\5\6\6\0\1\6\1\0"+ + "\1\6\1\0\1\6\1\0\4\6\1\0\3\6\1\0\7\6\3\0"+ + "\3\6\5\0\5\6\26\0\44\6\u0e81\0\3\6\31\0\11\6\6\7"+ + "\1\0\5\6\2\0\5\6\4\0\126\6\2\0\2\7\2\0\3\6"+ + "\1\0\137\6\5\0\50\6\4\0\136\6\21\0\30\6\70\0\20\6"+ + "\u0200\0\u19b6\6\112\0\u51a6\6\132\0\u048d\6\u0773\0\u2ba4\6\u215c\0\u012e\6"+ + "\2\0\73\6\225\0\7\6\14\0\5\6\5\0\1\6\1\7\12\6"+ + "\1\0\15\6\1\0\5\6\1\0\1\6\1\0\2\6\1\0\2\6"+ + "\1\0\154\6\41\0\u016b\6\22\0\100\6\2\0\66\6\50\0\15\6"+ + "\3\0\20\7\20\0\4\7\17\0\2\6\30\0\3\6\31\0\1\6"+ + "\6\0\5\6\1\0\207\6\2\0\1\7\4\0\1\6\13\0\12\7"+ + "\7\0\32\6\4\0\1\6\1\0\32\6\12\0\132\6\3\0\6\6"+ + "\2\0\6\6\2\0\6\6\2\0\3\6\3\0\2\6\3\0\2\6"+ + "\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\2\2\1\3\2\4\1\3\2\2\1\5"+ + "\1\6\27\3\1\2\1\7\1\10\1\11\1\12\1\13"+ + "\1\14\5\2\1\15\2\16\1\17\1\1\1\15\1\20"+ + "\1\21\1\0\1\22\3\4\1\0\3\4\1\0\17\3"+ + "\1\23\23\3\1\2\1\24\2\15\2\21\2\0\4\4"+ + "\1\0\31\3\1\25\10\3\1\15\1\0\2\4\1\22"+ + "\24\3\2\4\21\3\2\4\14\3\2\4\6\3\2\4"+ + "\4\3\2\4\1\3\2\4\1\3\1\0\1\4\1\3"+ + "\1\0\1\4\1\3\1\0\1\4\1\3\1\0\1\4"+ + "\1\3\1\0\1\4\1\3\1\0\1\4\1\0\1\4"+ + "\1\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[254]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\110\0\220\0\330\0\u0120\0\u0168\0\u01b0\0\u01f8"+ + "\0\u0240\0\u0288\0\u02d0\0\u0318\0\u0360\0\u03a8\0\330\0\330"+ + "\0\u03f0\0\u0438\0\u0480\0\u04c8\0\u0510\0\u0558\0\u05a0\0\u05e8"+ + "\0\u0630\0\u0678\0\u06c0\0\u0708\0\u0750\0\u0798\0\u07e0\0\u0828"+ + "\0\u0870\0\u08b8\0\u0900\0\u0948\0\u0990\0\u09d8\0\u0a20\0\330"+ + "\0\330\0\330\0\330\0\330\0\330\0\330\0\u0a68\0\u0ab0"+ + "\0\u0af8\0\u0b40\0\u0b88\0\u0bd0\0\u0c18\0\330\0\330\0\u0c60"+ + "\0\u0ca8\0\330\0\u0cf0\0\u0d38\0\330\0\u0d80\0\u0dc8\0\330"+ + "\0\u0e10\0\u0e58\0\u0ea0\0\u0ee8\0\u0f30\0\u0f78\0\u0fc0\0\u1008"+ + "\0\u1050\0\u1098\0\u10e0\0\u1128\0\u1170\0\u11b8\0\u1200\0\u1248"+ + "\0\u1290\0\u12d8\0\u1320\0\u1368\0\u0240\0\u13b0\0\u13f8\0\u1440"+ + "\0\u1488\0\u14d0\0\u1518\0\u1560\0\u15a8\0\u15f0\0\u1638\0\u1680"+ + "\0\u16c8\0\u1710\0\u1758\0\u17a0\0\u17e8\0\u1830\0\u1878\0\u18c0"+ + "\0\u1908\0\330\0\u1950\0\u1998\0\u19e0\0\330\0\u1a28\0\u1a70"+ + "\0\u1ab8\0\u1b00\0\u1b48\0\u1b90\0\u1bd8\0\u1c20\0\u1c68\0\u1cb0"+ + "\0\u1cf8\0\u1d40\0\u1d88\0\u1dd0\0\u1e18\0\u1e60\0\u1ea8\0\u1ef0"+ + "\0\u1f38\0\u1f80\0\u1fc8\0\u2010\0\u2058\0\u20a0\0\u20e8\0\u2130"+ + "\0\u2178\0\u21c0\0\u2208\0\u2250\0\u2298\0\u22e0\0\u0240\0\u2328"+ + "\0\u2370\0\u23b8\0\u2400\0\u2448\0\u2490\0\u24d8\0\u2520\0\330"+ + "\0\u2568\0\u25b0\0\u25f8\0\u0240\0\u2640\0\u2688\0\u26d0\0\u2718"+ + "\0\u2760\0\u27a8\0\u27f0\0\u2838\0\u2880\0\u28c8\0\u2910\0\u2958"+ + "\0\u29a0\0\u29e8\0\u2a30\0\u2a78\0\u2ac0\0\u2b08\0\u2b50\0\u2b98"+ + "\0\u2be0\0\u2c28\0\u2c70\0\u2cb8\0\u2d00\0\u2d48\0\u2d90\0\u2dd8"+ + "\0\u2e20\0\u2e68\0\u2eb0\0\u2ef8\0\u2f40\0\u2f88\0\u2fd0\0\u3018"+ + "\0\u3060\0\u30a8\0\u30f0\0\u3138\0\u3180\0\u31c8\0\u3210\0\u3258"+ + "\0\u32a0\0\u32e8\0\u3330\0\u3378\0\u33c0\0\u3408\0\u3450\0\u3498"+ + "\0\u34e0\0\u3528\0\u3570\0\u35b8\0\u3600\0\u3648\0\u3690\0\u36d8"+ + "\0\u3720\0\u3768\0\u37b0\0\u37f8\0\u3840\0\u3888\0\u38d0\0\u3918"+ + "\0\u3960\0\u39a8\0\u39f0\0\u3a38\0\u3a80\0\u3ac8\0\u3b10\0\u3b58"+ + "\0\u3ba0\0\u3be8\0\u3c30\0\u3c78\0\u3cc0\0\u3d08\0\u3d50\0\u3d98"+ + "\0\u3de0\0\u3e28\0\u3e70\0\u3eb8\0\u3f00\0\u3f48\0\u3f90\0\u3fd8"+ + "\0\u4020\0\u4068\0\u40b0\0\u40f8\0\u4140\0\u4188"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[254]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\4\1\6\1\7\1\10\1\11\1\4"+ + "\1\12\1\13\2\11\1\14\3\13\1\11\1\15\1\11"+ + "\1\16\1\17\1\20\1\4\1\21\1\22\1\23\2\11"+ + "\1\24\1\25\1\26\2\11\1\27\1\30\1\31\1\32"+ + "\1\11\1\33\1\11\1\34\1\35\1\36\1\37\1\40"+ + "\1\11\1\41\2\11\1\42\1\43\1\44\1\45\1\46"+ + "\2\11\1\47\1\50\1\51\1\52\1\53\1\54\1\55"+ + "\1\56\1\50\1\10\1\57\1\60\1\10\1\61\1\62"+ + "\1\63\1\64\1\65\1\66\21\64\1\67\1\64\1\70"+ + "\61\64\1\71\1\65\1\66\22\71\1\72\1\70\61\71"+ + "\112\0\1\4\110\0\1\6\110\0\1\73\1\74\73\0"+ + "\1\50\107\0\1\50\14\0\13\11\1\0\1\11\4\0"+ + "\42\11\1\75\26\0\1\76\1\77\1\100\1\101\1\100"+ + "\1\102\1\103\1\102\1\100\1\104\1\105\6\0\1\105"+ + "\12\0\3\100\20\0\1\101\30\0\2\13\1\100\1\0"+ + "\1\100\3\13\1\100\1\104\1\105\6\0\1\105\12\0"+ + "\3\100\47\0\13\11\1\0\1\11\4\0\3\11\1\106"+ + "\36\11\1\75\26\0\2\104\3\0\3\104\113\0\1\50"+ + "\55\0\1\50\14\0\13\11\1\0\1\11\4\0\1\11"+ + "\1\107\40\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\2\11\1\110\37\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\6\11\1\111\3\11\1\112\3\11\1\113\4\11"+ + "\1\114\16\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\3\11\1\115\5\11\1\116\30\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\21\11\1\117\20\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\1\11\1\120\6\11\1\121"+ + "\31\11\1\75\24\0\13\11\1\0\1\11\4\0\2\11"+ + "\1\122\11\11\1\123\25\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\6\11\1\124\3\11\1\125\4\11\1\125"+ + "\22\11\1\75\24\0\13\11\1\0\1\11\4\0\12\11"+ + "\1\126\27\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\2\11\1\127\6\11\1\125\30\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\3\11\1\130\5\11\1\131\1\11"+ + "\1\132\1\133\25\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\10\11\1\134\2\11\1\135\26\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\11\11\1\136\30\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\3\11\1\131\36\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\12\11\1\137"+ + "\27\11\1\75\24\0\13\11\1\0\1\11\4\0\3\11"+ + "\1\140\10\11\1\141\25\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\2\11\1\142\37\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\3\11\1\143\36\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\1\11\1\144\40\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\11\11\1\145\30\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\3\11\1\146"+ + "\36\11\1\75\24\0\13\11\1\0\1\11\4\0\1\147"+ + "\41\11\1\75\24\0\13\11\1\0\1\11\4\0\7\11"+ + "\1\150\32\11\1\75\117\0\1\50\1\151\106\0\1\50"+ + "\1\0\1\10\105\0\1\50\3\0\1\50\103\0\1\50"+ + "\4\0\1\50\102\0\1\50\5\0\1\50\1\64\2\0"+ + "\21\64\1\0\1\64\1\0\61\64\2\0\1\66\105\0"+ + "\2\152\1\0\5\152\1\153\4\152\2\153\1\154\70\152"+ + "\1\71\2\0\22\71\2\0\61\71\1\73\1\155\1\156"+ + "\105\73\5\157\1\160\102\157\10\0\1\76\1\77\1\100"+ + "\1\0\1\100\1\102\1\103\1\102\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\51\0\2\77\2\0\1\100"+ + "\3\77\1\100\1\104\1\105\6\0\1\105\12\0\1\100"+ + "\1\0\1\100\51\0\1\161\1\162\2\0\5\162\1\0"+ + "\1\162\4\0\1\162\1\0\2\162\1\0\1\162\7\0"+ + "\1\162\1\0\1\162\10\0\1\162\2\0\2\162\34\0"+ + "\1\163\1\77\1\100\1\0\1\100\3\163\1\100\1\104"+ + "\1\105\6\0\1\105\12\0\3\100\51\0\1\102\1\77"+ + "\1\100\1\0\1\100\3\102\1\100\1\104\1\105\6\0"+ + "\1\105\12\0\3\100\51\0\2\104\2\0\1\100\3\104"+ + "\1\100\1\0\1\105\6\0\1\105\12\0\1\100\1\0"+ + "\1\100\51\0\2\164\3\0\3\164\3\0\1\165\63\0"+ + "\1\165\6\0\13\11\1\0\1\11\4\0\7\11\1\166"+ + "\32\11\1\75\24\0\13\11\1\0\1\11\4\0\2\11"+ + "\1\167\37\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\7\11\1\170\32\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\5\11\1\171\34\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\5\11\1\172\34\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\6\11\1\173\33\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\3\11\1\174\36\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\6\11\1\173\1\175"+ + "\32\11\1\75\24\0\13\11\1\0\1\11\4\0\12\11"+ + "\1\176\27\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\13\11\1\177\26\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\14\11\1\173\3\11\1\125\21\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\13\11\1\200\26\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\21\11\1\125\20\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\16\11\1\201"+ + "\23\11\1\75\24\0\12\11\1\202\1\0\1\11\4\0"+ + "\25\11\1\203\14\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\2\11\1\204\12\11\1\205\24\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\5\11\1\206\10\11\1\207"+ + "\1\210\22\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\16\11\1\113\23\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\1\11\1\125\40\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\12\11\1\211\27\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\12\11\1\212\27\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\13\11\1\213\26\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\7\11\1\214\32\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\7\11\1\215"+ + "\32\11\1\75\24\0\13\11\1\0\1\11\4\0\17\11"+ + "\1\216\22\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\25\11\1\217\14\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\31\11\1\220\10\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\22\11\1\221\17\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\1\11\1\222\40\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\1\11\1\223\40\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\11\11\1\224\30\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\7\11\1\225"+ + "\32\11\1\75\24\0\13\11\1\0\1\11\4\0\37\11"+ + "\1\226\2\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\1\11\1\227\40\11\1\75\117\0\1\50\1\10\15\0"+ + "\1\154\4\0\3\154\100\0\1\230\4\0\3\230\72\0"+ + "\1\156\105\0\5\157\1\231\102\157\4\0\1\156\1\160"+ + "\112\0\1\161\1\162\1\100\1\0\5\162\1\0\1\162"+ + "\4\0\1\162\1\0\2\162\1\0\1\162\7\0\1\162"+ + "\1\100\1\162\10\0\1\162\2\0\2\162\34\0\2\232"+ + "\1\100\1\0\5\232\1\0\1\232\4\0\1\232\1\0"+ + "\2\232\1\0\1\232\7\0\1\232\1\100\1\232\10\0"+ + "\1\232\2\0\2\232\34\0\1\233\1\77\1\100\1\0"+ + "\1\100\3\233\1\100\1\104\1\105\6\0\1\105\12\0"+ + "\3\100\51\0\2\164\2\0\1\100\3\164\1\100\23\0"+ + "\1\100\1\0\1\100\51\0\2\164\3\0\3\164\76\0"+ + "\13\11\1\0\1\11\4\0\2\11\1\234\37\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\3\11\1\235\36\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\14\11\1\236"+ + "\25\11\1\75\24\0\13\11\1\0\1\11\4\0\3\11"+ + "\1\237\36\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\11\11\1\240\30\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\2\11\1\125\37\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\16\11\1\217\23\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\5\11\1\214\34\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\7\11\1\241\32\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\7\11\1\175\32\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\6\11\1\125"+ + "\33\11\1\75\24\0\13\11\1\0\1\11\4\0\16\11"+ + "\1\125\23\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\13\11\1\242\26\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\3\11\1\140\36\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\6\11\1\111\33\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\2\11\1\243\37\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\11\11\1\244\30\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\2\11\1\245\37\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\3\11\1\246"+ + "\36\11\1\75\24\0\13\11\1\0\1\11\4\0\3\11"+ + "\1\247\36\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\5\11\1\250\34\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\16\11\1\173\23\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\10\11\1\125\31\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\11\11\1\125\30\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\13\11\1\251\26\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\1\252\41\11\1\75"+ + "\24\0\13\11\1\0\1\253\4\0\42\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\6\11\1\254\33\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\3\11\1\255\36\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\16\11\1\256"+ + "\23\11\1\75\24\0\13\11\1\0\1\11\4\0\10\11"+ + "\1\234\31\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\2\11\1\257\37\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\13\11\1\260\26\11\1\75\16\0\4\157\1\156"+ + "\1\231\102\157\10\0\2\261\1\100\1\0\5\261\1\0"+ + "\1\261\4\0\1\261\1\0\2\261\1\0\1\261\7\0"+ + "\1\261\1\100\1\261\10\0\1\261\2\0\2\261\34\0"+ + "\1\262\1\77\1\100\1\0\1\100\3\262\1\100\1\104"+ + "\1\105\6\0\1\105\12\0\3\100\47\0\13\11\1\0"+ + "\1\11\4\0\4\11\1\125\35\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\1\11\1\263\40\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\32\11\1\264\7\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\15\11\1\265\24\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\13\11\1\266"+ + "\26\11\1\75\24\0\13\11\1\0\1\11\4\0\12\11"+ + "\1\267\27\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\17\11\1\270\22\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\15\11\1\271\24\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\7\11\1\173\32\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\14\11\1\272\25\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\16\11\1\273\23\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\7\11\1\274\32\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\12\11\1\275"+ + "\27\11\1\75\24\0\13\11\1\0\1\11\4\0\2\11"+ + "\1\276\37\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\40\11\1\277\1\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\2\11\1\300\37\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\20\11\1\234\21\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\2\11\1\301\37\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\5\11\1\302\34\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\12\11\1\303\27\11"+ + "\1\75\26\0\2\304\1\100\1\0\5\304\1\0\1\304"+ + "\4\0\1\304\1\0\2\304\1\0\1\304\7\0\1\304"+ + "\1\100\1\304\10\0\1\304\2\0\2\304\34\0\1\305"+ + "\1\77\1\100\1\0\1\100\3\305\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\47\0\13\11\1\0\1\11"+ + "\4\0\12\11\1\125\27\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\2\11\1\217\37\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\2\11\1\306\37\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\12\11\1\307\27\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\13\11\1\310\26\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\13\11\1\311"+ + "\26\11\1\75\24\0\13\11\1\0\1\11\4\0\2\11"+ + "\1\312\37\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\16\11\1\313\23\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\16\11\1\314\23\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\13\11\1\315\26\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\13\11\1\316\26\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\1\11\1\234\40\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\32\11\1\234\7\11"+ + "\1\75\24\0\12\11\1\317\1\0\1\11\4\0\24\11"+ + "\1\320\15\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\3\11\1\321\36\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\7\11\1\234\32\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\22\11\1\234\17\11\1\75\26\0\2\322"+ + "\1\100\1\0\5\322\1\0\1\322\4\0\1\322\1\0"+ + "\2\322\1\0\1\322\7\0\1\322\1\100\1\322\10\0"+ + "\1\322\2\0\2\322\34\0\1\323\1\77\1\100\1\0"+ + "\1\100\3\323\1\100\1\104\1\105\6\0\1\105\12\0"+ + "\3\100\47\0\13\11\1\0\1\11\4\0\26\11\1\324"+ + "\13\11\1\75\24\0\13\11\1\0\1\11\4\0\14\11"+ + "\1\173\25\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\7\11\1\264\32\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\12\11\1\325\27\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\26\11\1\326\13\11\1\75\24\0\13\11"+ + "\1\0\1\11\4\0\7\11\1\125\32\11\1\75\24\0"+ + "\13\11\1\0\1\11\4\0\20\11\1\125\21\11\1\75"+ + "\24\0\13\11\1\0\1\11\4\0\11\11\1\263\30\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\7\11\1\327"+ + "\32\11\1\75\24\0\13\11\1\0\1\11\4\0\16\11"+ + "\1\330\23\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\12\11\1\331\27\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\12\11\1\234\27\11\1\75\26\0\2\332\1\100"+ + "\1\0\5\332\1\0\1\332\4\0\1\332\1\0\2\332"+ + "\1\0\1\332\7\0\1\332\1\100\1\332\10\0\1\332"+ + "\2\0\2\332\34\0\1\333\1\77\1\100\1\0\1\100"+ + "\3\333\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\47\0\13\11\1\0\1\11\4\0\27\11\1\334\12\11"+ + "\1\75\24\0\13\11\1\0\1\11\4\0\2\11\1\335"+ + "\37\11\1\75\24\0\13\11\1\0\1\11\4\0\27\11"+ + "\1\336\12\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\20\11\1\217\21\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\11\11\1\337\30\11\1\75\24\0\13\11\1\0"+ + "\1\11\4\0\7\11\1\217\32\11\1\75\26\0\2\340"+ + "\1\100\1\0\5\340\1\0\1\340\4\0\1\340\1\0"+ + "\2\340\1\0\1\340\7\0\1\340\1\100\1\340\10\0"+ + "\1\340\2\0\2\340\34\0\1\341\1\77\1\100\1\0"+ + "\1\100\3\341\1\100\1\104\1\105\6\0\1\105\12\0"+ + "\3\100\47\0\13\11\1\0\1\11\4\0\24\11\1\342"+ + "\15\11\1\75\24\0\13\11\1\0\1\11\4\0\15\11"+ + "\1\217\24\11\1\75\24\0\13\11\1\0\1\11\4\0"+ + "\24\11\1\217\15\11\1\75\24\0\13\11\1\0\1\11"+ + "\4\0\3\11\1\331\36\11\1\75\26\0\2\343\1\100"+ + "\1\0\5\343\1\0\1\343\4\0\1\343\1\0\2\343"+ + "\1\0\1\343\7\0\1\343\1\100\1\343\10\0\1\343"+ + "\2\0\2\343\34\0\1\344\1\77\1\100\1\0\1\100"+ + "\3\344\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\47\0\13\11\1\0\1\11\4\0\30\11\1\345\11\11"+ + "\1\75\26\0\2\346\1\100\1\0\5\346\1\0\1\346"+ + "\4\0\1\346\1\0\2\346\1\0\1\346\7\0\1\346"+ + "\1\100\1\346\10\0\1\346\2\0\2\346\34\0\1\347"+ + "\1\77\1\100\1\0\1\100\3\347\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\47\0\13\11\1\0\1\11"+ + "\4\0\11\11\1\350\30\11\1\75\26\0\2\351\1\100"+ + "\1\0\5\351\1\0\1\351\4\0\1\351\1\0\2\351"+ + "\1\0\1\351\7\0\1\351\1\100\1\351\10\0\1\351"+ + "\2\0\2\351\34\0\1\352\1\77\1\100\1\0\1\100"+ + "\3\352\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\47\0\13\11\1\0\1\11\4\0\31\11\1\353\10\11"+ + "\1\75\26\0\2\354\1\100\1\0\5\354\1\0\1\354"+ + "\4\0\1\354\1\0\2\354\1\0\1\354\7\0\1\354"+ + "\1\100\1\354\10\0\1\354\2\0\2\354\34\0\1\355"+ + "\1\77\1\100\1\0\1\100\3\355\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\47\0\13\11\1\0\1\11"+ + "\4\0\32\11\1\356\7\11\1\75\26\0\2\357\1\100"+ + "\1\0\5\357\1\0\1\357\4\0\1\357\1\0\2\357"+ + "\1\0\1\357\7\0\1\357\1\100\1\357\10\0\1\357"+ + "\2\0\2\357\34\0\1\360\1\77\1\100\1\0\1\100"+ + "\3\360\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\47\0\13\11\1\0\1\11\4\0\11\11\1\361\30\11"+ + "\1\75\26\0\2\362\1\100\1\0\5\362\1\0\1\362"+ + "\4\0\1\362\1\0\2\362\1\0\1\362\7\0\1\362"+ + "\1\100\1\362\10\0\1\362\2\0\2\362\34\0\1\363"+ + "\1\77\1\100\1\0\1\100\3\363\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\47\0\13\11\1\0\1\11"+ + "\4\0\12\11\1\364\27\11\1\75\26\0\2\365\1\100"+ + "\1\0\5\365\1\0\1\365\4\0\1\365\1\0\2\365"+ + "\1\0\1\365\7\0\1\365\1\100\1\365\10\0\1\365"+ + "\2\0\2\365\34\0\1\366\1\77\1\100\1\0\1\100"+ + "\3\366\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\47\0\13\11\1\0\1\11\4\0\2\11\1\320\37\11"+ + "\1\75\26\0\2\367\1\100\1\0\5\367\1\0\1\367"+ + "\4\0\1\367\1\0\2\367\1\0\1\367\7\0\1\367"+ + "\1\100\1\367\10\0\1\367\2\0\2\367\34\0\1\370"+ + "\1\77\1\100\1\0\1\100\3\370\1\100\1\104\1\105"+ + "\6\0\1\105\12\0\3\100\51\0\2\371\1\100\1\0"+ + "\5\371\1\0\1\371\4\0\1\371\1\0\2\371\1\0"+ + "\1\371\7\0\1\371\1\100\1\371\10\0\1\371\2\0"+ + "\2\371\34\0\1\372\1\77\1\100\1\0\1\100\3\372"+ + "\1\100\1\104\1\105\6\0\1\105\12\0\3\100\53\0"+ + "\1\100\32\0\1\100\52\0\1\373\1\77\1\100\1\0"+ + "\1\100\3\373\1\100\1\104\1\105\6\0\1\105\12\0"+ + "\3\100\51\0\1\374\1\77\1\100\1\0\1\100\3\374"+ + "\1\100\1\104\1\105\6\0\1\105\12\0\3\100\51\0"+ + "\1\375\1\77\1\100\1\0\1\100\3\375\1\100\1\104"+ + "\1\105\6\0\1\105\12\0\3\100\51\0\1\376\1\77"+ + "\1\100\1\0\1\100\3\376\1\100\1\104\1\105\6\0"+ + "\1\105\12\0\3\100\51\0\2\77\1\100\1\0\1\100"+ + "\3\77\1\100\1\104\1\105\6\0\1\105\12\0\3\100"+ + "\41\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[16848]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\12\1\2\11\27\1\7\11\7\1\2\11"+ + "\2\1\1\11\1\1\1\0\1\11\2\1\1\11\1\0"+ + "\3\1\1\0\44\1\1\11\3\1\1\11\2\0\4\1"+ + "\1\0\42\1\1\11\1\0\114\1\1\0\2\1\1\0"+ + "\2\1\1\0\2\1\1\0\2\1\1\0\2\1\1\0"+ + "\1\1\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[254]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public JavaScriptLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public JavaScriptLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public JavaScriptLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1806) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { return token(TokenType.OPERATOR, -PARAN); + } + case 22: break; + case 19: + { return token(TokenType.KEYWORD); + } + case 23: break; + case 4: + { return token(TokenType.NUMBER); + } + case 24: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 25: break; + case 9: + { return token(TokenType.OPERATOR, CURLY); + } + case 26: break; + case 10: + { return token(TokenType.OPERATOR, -CURLY); + } + case 27: break; + case 6: + { yybegin(SSTRING); + tokenStart = yychar; + tokenLength = 1; + } + case 28: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 29: break; + case 13: + { tokenLength += yylength(); + } + case 30: break; + case 14: + { yybegin(YYINITIAL); + } + case 31: break; + case 16: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 32: break; + case 18: + { return token(TokenType.TYPE); + } + case 33: break; + case 12: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 34: break; + case 7: + { return token(TokenType.OPERATOR, PARAN); + } + case 35: break; + case 21: + { return token(TokenType.KEYWORD2); + } + case 36: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 37: break; + case 20: + { tokenLength += 2; + } + case 38: break; + case 11: + { return token(TokenType.OPERATOR, BRACKET); + } + case 39: break; + case 17: + { return token(TokenType.COMMENT); + } + case 40: break; + case 5: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 41: break; + case 1: + { + } + case 42: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/LuaLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/LuaLexer.java new file mode 100644 index 000000000..71aa5f14d --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/LuaLexer.java @@ -0,0 +1,936 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/lua.flex + */ +public final class LuaLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int COMMENT = 8; + public static final int LONGSTRING = 6; + public static final int STRING2 = 4; + public static final int LINECOMMENT = 10; + public static final int STRING1 = 2; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\10\1\3\1\2\1\0\1\3\1\1\16\10\4\0\1\3\1\0"+ + "\1\20\1\46\1\7\1\46\1\0\1\21\1\51\1\52\1\46\1\45"+ + "\1\46\1\17\1\15\1\46\1\13\11\11\1\46\1\46\1\50\1\5"+ + "\1\50\2\0\4\12\1\16\1\12\24\7\1\4\1\22\1\6\1\46"+ + "\1\7\1\0\1\23\1\26\1\36\1\25\1\30\1\32\1\7\1\42"+ + "\1\34\1\7\1\31\1\35\1\7\1\24\1\33\1\44\1\7\1\27"+ + "\1\43\1\37\1\40\1\7\1\41\1\14\2\7\1\53\1\0\1\54"+ + "\1\47\41\10\2\0\4\7\4\0\1\7\2\0\1\10\7\0\1\7"+ + "\4\0\1\7\5\0\27\7\1\0\37\7\1\0\u013f\7\31\0\162\7"+ + "\4\0\14\7\16\0\5\7\11\0\1\7\21\0\130\10\5\0\23\10"+ + "\12\0\1\7\13\0\1\7\1\0\3\7\1\0\1\7\1\0\24\7"+ + "\1\0\54\7\1\0\46\7\1\0\5\7\4\0\202\7\1\0\4\10"+ + "\3\0\105\7\1\0\46\7\2\0\2\7\6\0\20\7\41\0\46\7"+ + "\2\0\1\7\7\0\47\7\11\0\21\10\1\0\27\10\1\0\3\10"+ + "\1\0\1\10\1\0\2\10\1\0\1\10\13\0\33\7\5\0\3\7"+ + "\15\0\4\10\14\0\6\10\13\0\32\7\5\0\13\7\16\10\7\0"+ + "\12\10\4\0\2\7\1\10\143\7\1\0\1\7\10\10\1\0\6\10"+ + "\2\7\2\10\1\0\4\10\2\7\12\10\3\7\2\0\1\7\17\0"+ + "\1\10\1\7\1\10\36\7\33\10\2\0\3\7\60\0\46\7\13\10"+ + "\1\7\u014f\0\3\10\66\7\2\0\1\10\1\7\20\10\2\0\1\7"+ + "\4\10\3\0\12\7\2\10\2\0\12\10\21\0\3\10\1\0\10\7"+ + "\2\0\2\7\2\0\26\7\1\0\7\7\1\0\1\7\3\0\4\7"+ + "\2\0\1\10\1\7\7\10\2\0\2\10\2\0\3\10\11\0\1\10"+ + "\4\0\2\7\1\0\3\7\2\10\2\0\12\10\4\7\15\0\3\10"+ + "\1\0\6\7\4\0\2\7\2\0\26\7\1\0\7\7\1\0\2\7"+ + "\1\0\2\7\1\0\2\7\2\0\1\10\1\0\5\10\4\0\2\10"+ + "\2\0\3\10\13\0\4\7\1\0\1\7\7\0\14\10\3\7\14\0"+ + "\3\10\1\0\11\7\1\0\3\7\1\0\26\7\1\0\7\7\1\0"+ + "\2\7\1\0\5\7\2\0\1\10\1\7\10\10\1\0\3\10\1\0"+ + "\3\10\2\0\1\7\17\0\2\7\2\10\2\0\12\10\1\0\1\7"+ + "\17\0\3\10\1\0\10\7\2\0\2\7\2\0\26\7\1\0\7\7"+ + "\1\0\2\7\1\0\5\7\2\0\1\10\1\7\6\10\3\0\2\10"+ + "\2\0\3\10\10\0\2\10\4\0\2\7\1\0\3\7\4\0\12\10"+ + "\1\0\1\7\20\0\1\10\1\7\1\0\6\7\3\0\3\7\1\0"+ + "\4\7\3\0\2\7\1\0\1\7\1\0\2\7\3\0\2\7\3\0"+ + "\3\7\3\0\10\7\1\0\3\7\4\0\5\10\3\0\3\10\1\0"+ + "\4\10\11\0\1\10\17\0\11\10\11\0\1\7\7\0\3\10\1\0"+ + "\10\7\1\0\3\7\1\0\27\7\1\0\12\7\1\0\5\7\4\0"+ + "\7\10\1\0\3\10\1\0\4\10\7\0\2\10\11\0\2\7\4\0"+ + "\12\10\22\0\2\10\1\0\10\7\1\0\3\7\1\0\27\7\1\0"+ + "\12\7\1\0\5\7\2\0\1\10\1\7\7\10\1\0\3\10\1\0"+ + "\4\10\7\0\2\10\7\0\1\7\1\0\2\7\4\0\12\10\22\0"+ + "\2\10\1\0\10\7\1\0\3\7\1\0\27\7\1\0\20\7\4\0"+ + "\6\10\2\0\3\10\1\0\4\10\11\0\1\10\10\0\2\7\4\0"+ + "\12\10\22\0\2\10\1\0\22\7\3\0\30\7\1\0\11\7\1\0"+ + "\1\7\2\0\7\7\3\0\1\10\4\0\6\10\1\0\1\10\1\0"+ + "\10\10\22\0\2\10\15\0\60\7\1\10\2\7\7\10\4\0\10\7"+ + "\10\10\1\0\12\10\47\0\2\7\1\0\1\7\2\0\2\7\1\0"+ + "\1\7\2\0\1\7\6\0\4\7\1\0\7\7\1\0\3\7\1\0"+ + "\1\7\1\0\1\7\2\0\2\7\1\0\4\7\1\10\2\7\6\10"+ + "\1\0\2\10\1\7\2\0\5\7\1\0\1\7\1\0\6\10\2\0"+ + "\12\10\2\0\2\7\42\0\1\7\27\0\2\10\6\0\12\10\13\0"+ + "\1\10\1\0\1\10\1\0\1\10\4\0\2\10\10\7\1\0\42\7"+ + "\6\0\24\10\1\0\2\10\4\7\4\0\10\10\1\0\44\10\11\0"+ + "\1\10\71\0\42\7\1\0\5\7\1\0\2\7\1\0\7\10\3\0"+ + "\4\10\6\0\12\10\6\0\6\7\4\10\106\0\46\7\12\0\51\7"+ + "\7\0\132\7\5\0\104\7\5\0\122\7\6\0\7\7\1\0\77\7"+ + "\1\0\1\7\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7"+ + "\2\0\47\7\1\0\1\7\1\0\4\7\2\0\37\7\1\0\1\7"+ + "\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0\7\7"+ + "\1\0\7\7\1\0\27\7\1\0\37\7\1\0\1\7\1\0\4\7"+ + "\2\0\7\7\1\0\47\7\1\0\23\7\16\0\11\10\56\0\125\7"+ + "\14\0\u026c\7\2\0\10\7\12\0\32\7\5\0\113\7\3\0\3\7"+ + "\17\0\15\7\1\0\4\7\3\10\13\0\22\7\3\10\13\0\22\7"+ + "\2\10\14\0\15\7\1\0\3\7\1\0\2\10\14\0\64\7\40\10"+ + "\3\0\1\7\3\0\2\7\1\10\2\0\12\10\41\0\3\10\2\0"+ + "\12\10\6\0\130\7\10\0\51\7\1\10\126\0\35\7\3\0\14\10"+ + "\4\0\14\10\12\0\12\10\36\7\2\0\5\7\u038b\0\154\7\224\0"+ + "\234\7\4\0\132\7\6\0\26\7\2\0\6\7\2\0\46\7\2\0"+ + "\6\7\2\0\10\7\1\0\1\7\1\0\1\7\1\0\1\7\1\0"+ + "\37\7\2\0\65\7\1\0\7\7\1\0\1\7\3\0\3\7\1\0"+ + "\7\7\3\0\4\7\2\0\6\7\4\0\15\7\5\0\3\7\1\0"+ + "\7\7\17\0\4\10\32\0\5\10\20\0\2\7\23\0\1\7\13\0"+ + "\4\10\6\0\6\10\1\0\1\7\15\0\1\7\40\0\22\7\36\0"+ + "\15\10\4\0\1\10\3\0\6\10\27\0\1\7\4\0\1\7\2\0"+ + "\12\7\1\0\1\7\3\0\5\7\6\0\1\7\1\0\1\7\1\0"+ + "\1\7\1\0\4\7\1\0\3\7\1\0\7\7\3\0\3\7\5\0"+ + "\5\7\26\0\44\7\u0e81\0\3\7\31\0\11\7\6\10\1\0\5\7"+ + "\2\0\5\7\4\0\126\7\2\0\2\10\2\0\3\7\1\0\137\7"+ + "\5\0\50\7\4\0\136\7\21\0\30\7\70\0\20\7\u0200\0\u19b6\7"+ + "\112\0\u51a6\7\132\0\u048d\7\u0773\0\u2ba4\7\u215c\0\u012e\7\2\0\73\7"+ + "\225\0\7\7\14\0\5\7\5\0\1\7\1\10\12\7\1\0\15\7"+ + "\1\0\5\7\1\0\1\7\1\0\2\7\1\0\2\7\1\0\154\7"+ + "\41\0\u016b\7\22\0\100\7\2\0\66\7\50\0\15\7\3\0\20\10"+ + "\20\0\4\10\17\0\2\7\30\0\3\7\31\0\1\7\6\0\5\7"+ + "\1\0\207\7\2\0\1\10\4\0\1\7\13\0\12\10\7\0\32\7"+ + "\4\0\1\7\1\0\32\7\12\0\132\7\3\0\6\7\2\0\6\7"+ + "\2\0\6\7\2\0\3\7\3\0\2\7\3\0\2\7\22\0\3\10"+ + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\6\0\3\1\1\2\1\3\1\4\1\5\2\6\2\3"+ + "\1\7\1\10\15\5\1\3\1\1\1\11\1\12\1\13"+ + "\1\14\1\15\2\16\1\17\1\1\1\15\1\20\1\21"+ + "\2\15\1\21\1\22\2\23\1\22\2\24\1\25\1\0"+ + "\1\6\2\0\1\3\1\26\3\5\1\27\6\5\1\30"+ + "\5\5\1\31\1\0\1\32\1\33\1\0\1\6\1\0"+ + "\1\6\3\5\1\34\13\5\1\30\6\5\1\35\1\36"+ + "\1\5"; + + private static int [] zzUnpackAction() { + int [] result = new int[111]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\55\0\132\0\207\0\264\0\341\0\u010e\0\u013b"+ + "\0\u0168\0\u0195\0\u01c2\0\u010e\0\u01ef\0\u021c\0\u0249\0\u0276"+ + "\0\u02a3\0\u010e\0\u010e\0\u02d0\0\u02fd\0\u032a\0\u0357\0\u0384"+ + "\0\u03b1\0\u03de\0\u040b\0\u0438\0\u0465\0\u0492\0\u04bf\0\u04ec"+ + "\0\u010e\0\u01c2\0\u010e\0\u010e\0\u010e\0\u010e\0\u0519\0\u0546"+ + "\0\u010e\0\u010e\0\u0573\0\u05a0\0\u010e\0\u010e\0\u05cd\0\u010e"+ + "\0\u05fa\0\u010e\0\u0627\0\u010e\0\u0654\0\u0681\0\u010e\0\u010e"+ + "\0\u0195\0\u06ae\0\u06db\0\u0708\0\u0735\0\u010e\0\u0762\0\u078f"+ + "\0\u07bc\0\u01ef\0\u07e9\0\u0816\0\u0843\0\u0870\0\u089d\0\u08ca"+ + "\0\u01ef\0\u08f7\0\u0924\0\u0951\0\u097e\0\u09ab\0\u010e\0\u05fa"+ + "\0\u010e\0\u010e\0\u0654\0\u09d8\0\u09d8\0\u0708\0\u0a05\0\u0a32"+ + "\0\u0a5f\0\u01ef\0\u0a8c\0\u0ab9\0\u0ae6\0\u0b13\0\u0b40\0\u0b6d"+ + "\0\u0b9a\0\u0bc7\0\u0bf4\0\u0c21\0\u0c4e\0\u0c7b\0\u0ca8\0\u0cd5"+ + "\0\u0d02\0\u0d2f\0\u0d5c\0\u0d89\0\u01ef\0\u01ef\0\u0db6"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[111]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\7\1\10\1\7\1\11\1\12\1\13\1\14\1\15"+ + "\1\7\1\16\1\15\1\17\1\15\1\20\1\15\1\21"+ + "\1\22\1\23\1\7\1\24\1\25\1\26\1\27\1\30"+ + "\1\31\1\15\1\32\1\33\1\34\1\35\1\15\1\36"+ + "\1\37\1\40\3\15\2\41\1\42\1\13\1\43\1\44"+ + "\1\45\1\46\1\47\1\50\1\51\15\47\1\52\1\47"+ + "\1\53\32\47\1\54\1\50\1\51\16\54\1\55\1\53"+ + "\32\54\1\56\1\57\1\60\3\56\1\61\46\56\1\62"+ + "\1\63\1\64\1\62\1\65\50\62\1\56\1\66\1\67"+ + "\52\56\57\0\1\7\55\0\1\11\55\0\1\70\1\71"+ + "\54\0\1\41\56\0\6\15\1\0\1\15\4\0\22\15"+ + "\21\0\1\16\1\0\1\16\1\0\1\72\1\73\11\0"+ + "\1\73\35\0\1\16\1\0\1\16\1\74\1\72\1\73"+ + "\11\0\1\73\35\0\1\72\1\0\1\72\1\0\1\75"+ + "\56\0\1\76\44\0\6\15\1\0\1\15\4\0\1\15"+ + "\1\77\20\15\17\0\6\15\1\0\1\15\4\0\10\15"+ + "\1\100\1\101\10\15\17\0\6\15\1\0\1\15\4\0"+ + "\10\15\1\102\11\15\17\0\6\15\1\0\1\15\4\0"+ + "\4\15\1\103\15\15\17\0\6\15\1\0\1\15\4\0"+ + "\5\15\1\104\14\15\17\0\6\15\1\0\1\15\4\0"+ + "\1\15\1\105\10\15\1\106\7\15\17\0\6\15\1\0"+ + "\1\15\4\0\1\107\7\15\1\33\4\15\1\110\4\15"+ + "\17\0\6\15\1\0\1\15\4\0\4\15\1\111\15\15"+ + "\17\0\6\15\1\0\1\15\4\0\1\15\1\111\5\15"+ + "\1\111\12\15\17\0\6\15\1\0\1\15\4\0\10\15"+ + "\1\112\11\15\17\0\6\15\1\0\1\15\4\0\4\15"+ + "\1\113\12\15\1\114\2\15\17\0\6\15\1\0\1\15"+ + "\4\0\1\15\1\115\20\15\17\0\6\15\1\0\1\15"+ + "\4\0\17\15\1\116\2\15\10\0\1\47\2\0\15\47"+ + "\1\0\1\47\1\0\32\47\2\0\1\51\52\0\2\117"+ + "\1\0\52\117\1\54\2\0\16\54\2\0\32\54\2\0"+ + "\1\60\57\0\1\120\1\121\50\0\1\64\56\0\1\122"+ + "\1\123\51\0\1\67\63\0\1\72\1\0\1\72\2\0"+ + "\1\73\11\0\1\73\35\0\1\124\1\0\1\124\3\0"+ + "\1\125\25\0\1\125\20\0\3\126\2\0\1\126\4\0"+ + "\1\126\1\0\2\126\1\0\1\126\1\0\1\126\3\0"+ + "\1\126\33\0\1\41\46\0\6\15\1\0\1\15\4\0"+ + "\2\15\1\111\17\15\17\0\6\15\1\0\1\15\4\0"+ + "\14\15\1\111\5\15\17\0\6\15\1\0\1\15\4\0"+ + "\12\15\1\111\7\15\17\0\6\15\1\0\1\15\4\0"+ + "\5\15\1\127\14\15\17\0\6\15\1\0\1\15\4\0"+ + "\14\15\1\130\4\15\1\131\17\0\6\15\1\0\1\15"+ + "\4\0\2\15\1\132\17\15\17\0\6\15\1\0\1\15"+ + "\4\0\20\15\1\133\1\15\17\0\6\15\1\0\1\15"+ + "\4\0\12\15\1\134\7\15\17\0\6\15\1\0\1\15"+ + "\4\0\1\15\1\135\20\15\17\0\6\15\1\0\1\15"+ + "\4\0\13\15\1\136\6\15\17\0\6\15\1\0\1\15"+ + "\4\0\15\15\1\137\4\15\17\0\6\15\1\0\1\15"+ + "\4\0\5\15\1\140\14\15\17\0\6\15\1\0\1\15"+ + "\4\0\14\15\1\141\5\15\17\0\6\15\1\0\1\15"+ + "\4\0\11\15\1\142\10\15\21\0\1\124\1\0\1\124"+ + "\50\0\6\15\1\0\1\15\4\0\1\143\21\15\17\0"+ + "\6\15\1\0\1\15\4\0\15\15\1\144\4\15\17\0"+ + "\6\15\1\0\1\15\4\0\5\15\1\145\14\15\17\0"+ + "\6\15\1\0\1\15\4\0\5\15\1\146\14\15\17\0"+ + "\6\15\1\0\1\15\4\0\20\15\1\137\1\15\17\0"+ + "\6\15\1\0\1\15\4\0\13\15\1\147\6\15\17\0"+ + "\6\15\1\0\1\15\4\0\1\101\21\15\17\0\6\15"+ + "\1\0\1\15\4\0\5\15\1\111\14\15\17\0\6\15"+ + "\1\0\1\15\4\0\1\15\1\102\20\15\17\0\6\15"+ + "\1\0\1\15\4\0\11\15\1\150\10\15\17\0\6\15"+ + "\1\0\1\15\4\0\12\15\1\137\7\15\17\0\6\15"+ + "\1\0\1\15\4\0\6\15\1\111\13\15\17\0\6\15"+ + "\1\0\1\15\4\0\4\15\1\151\15\15\17\0\6\15"+ + "\1\0\1\15\4\0\1\152\21\15\17\0\6\15\1\0"+ + "\1\15\4\0\11\15\1\153\10\15\17\0\6\15\1\0"+ + "\1\15\4\0\14\15\1\154\5\15\17\0\6\15\1\0"+ + "\1\15\4\0\12\15\1\155\7\15\17\0\6\15\1\0"+ + "\1\15\4\0\1\15\1\111\20\15\17\0\6\15\1\0"+ + "\1\15\4\0\14\15\1\156\5\15\17\0\6\15\1\0"+ + "\1\15\4\0\7\15\1\111\12\15\17\0\6\15\1\0"+ + "\1\15\4\0\11\15\1\157\10\15\17\0\6\15\1\0"+ + "\1\15\4\0\10\15\1\140\11\15\10\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[3555]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\6\0\1\11\4\1\1\11\5\1\2\11\15\1\1\11"+ + "\1\1\4\11\2\1\2\11\2\1\2\11\1\1\1\11"+ + "\1\1\1\11\1\1\1\11\2\1\2\11\1\0\1\1"+ + "\2\0\1\1\1\11\20\1\1\11\1\0\2\11\1\0"+ + "\1\1\1\0\32\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[111]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public LuaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte ENDBLOCK = 4; + private static final byte REPEATBLOCK = 5; + + TokenType longType; + int longLen; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public LuaLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public LuaLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1762) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { yybegin(STRING2); + tokenStart = yychar; + tokenLength = 1; + } + case 31: break; + case 10: + { return token(TokenType.OPERATOR, -PARAN); + } + case 32: break; + case 24: + { return token(TokenType.KEYWORD); + } + case 33: break; + case 21: + { longType = TokenType.STRING; + yybegin(LONGSTRING); + tokenStart = yychar; + tokenLength = yylength(); + longLen = tokenLength; + } + case 34: break; + case 6: + { return token(TokenType.NUMBER); + } + case 35: break; + case 16: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 36: break; + case 20: + { yybegin(YYINITIAL); + tokenLength += yylength(); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + case 37: break; + case 3: + { return token(TokenType.OPERATOR); + } + case 38: break; + case 11: + { return token(TokenType.OPERATOR, CURLY); + } + case 39: break; + case 12: + { return token(TokenType.OPERATOR, -CURLY); + } + case 40: break; + case 13: + { tokenLength += yylength(); + } + case 41: break; + case 14: + { yybegin(YYINITIAL); + } + case 42: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 43: break; + case 17: + { tokenLength++; + } + case 44: break; + case 4: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 45: break; + case 9: + { return token(TokenType.OPERATOR, PARAN); + } + case 46: break; + case 5: + { return token(TokenType.IDENTIFIER); + } + case 47: break; + case 7: + { yybegin(STRING1); + tokenStart = yychar; + tokenLength = 1; + } + case 48: break; + case 30: + { return token(TokenType.KEYWORD, REPEATBLOCK); + } + case 49: break; + case 25: + { tokenLength += 2; + } + case 50: break; + case 2: + { return token(TokenType.OPERATOR, BRACKET); + } + case 51: break; + case 26: + { if (longLen == yylength()) { + tokenLength += yylength(); + yybegin(YYINITIAL); + return token(longType, tokenStart, tokenLength); + } else { + tokenLength++; + yypushback(yylength() - 1); + } + } + case 52: break; + case 23: + { return token(TokenType.KEYWORD, ENDBLOCK); + } + case 53: break; + case 19: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + case 54: break; + case 18: + { yybegin(LINECOMMENT); + tokenLength += yylength(); + } + case 55: break; + case 22: + { yybegin(COMMENT); + tokenStart = yychar; + tokenLength = yylength(); + } + case 56: break; + case 29: + { return token(TokenType.KEYWORD, -REPEATBLOCK); + } + case 57: break; + case 28: + { return token(TokenType.KEYWORD, -ENDBLOCK); + } + case 58: break; + case 27: + { longType = TokenType.COMMENT; + yybegin(LONGSTRING); + tokenLength += yylength(); + longLen = yylength(); + } + case 59: break; + case 1: + { + } + case 60: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + switch (zzLexicalState) { + case COMMENT: { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + case 112: break; + case LONGSTRING: { + yybegin(YYINITIAL); + return token(longType, tokenStart, tokenLength); + } + case 113: break; + case STRING2: { + yybegin(YYINITIAL); + return token(TokenType.STRING, tokenStart, tokenLength); + } + case 114: break; + case LINECOMMENT: { + yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength); + } + case 115: break; + case STRING1: { + yybegin(YYINITIAL); + return token(TokenType.STRING, tokenStart, tokenLength); + } + case 116: break; + default: + { + return null; + } + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PropertiesLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PropertiesLexer.java new file mode 100644 index 000000000..3fca3d192 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PropertiesLexer.java @@ -0,0 +1,580 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/properties.flex + */ +public final class PropertiesLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\2\1\4\2\0\1\3\22\0\1\6\2\0\1\1\12\0"+ + "\1\5\1\0\12\5\3\0\1\7\3\0\32\5\4\0\1\5\1\0"+ + "\32\5\uff85\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\1\1\1\2\2\1\2\2\2\0\1\3"; + + private static int [] zzUnpackAction() { + int [] result = new int[10]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\10\0\20\0\30\0\40\0\50\0\10\0\60"+ + "\0\40\0\10"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[10]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\2\1\3\1\2\1\4\1\2\2\5\1\2\10\0"+ + "\3\3\1\6\1\7\3\3\4\0\1\2\5\0\1\10"+ + "\2\0\2\11\1\12\4\0\1\7\5\0\1\10\3\0"+ + "\1\10\1\12"; + + private static int [] zzUnpackTrans() { + int [] result = new int[56]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\4\1\1\11\2\0\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[10]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public PropertiesLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public PropertiesLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public PropertiesLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 44) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 3: + { return token(TokenType.KEYWORD); + } + case 4: break; + case 1: + { /* skip */ + } + case 5: break; + case 2: + { return token(TokenType.COMMENT); + } + case 6: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PythonLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PythonLexer.java new file mode 100644 index 000000000..b4041d6c2 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/PythonLexer.java @@ -0,0 +1,1166 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/python.flex + */ +public final class PythonLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int SQSTRING = 6; + public static final int ML_STRING = 4; + public static final int STRING = 2; + public static final int SQML_STRING = 8; + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\1\77\1\23"+ + "\1\4\1\101\1\72\1\72\1\24\1\62\1\63\1\70\1\22\1\75"+ + "\1\22\1\20\1\71\1\7\1\15\2\14\4\16\2\10\1\75\1\75"+ + "\1\73\1\76\1\74\1\101\1\75\4\13\1\21\1\17\2\5\1\55"+ + "\1\100\1\5\1\11\1\5\1\54\5\5\1\56\3\5\1\12\2\5"+ + "\1\66\1\25\1\67\1\72\1\6\1\75\1\26\1\35\1\37\1\30"+ + "\1\32\1\44\1\51\1\53\1\42\1\61\1\36\1\40\1\50\1\27"+ + "\1\41\1\46\1\5\1\33\1\31\1\34\1\43\1\57\1\52\1\45"+ + "\1\47\1\60\1\64\1\72\1\65\1\75\uff81\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\3\1\1\2\1\3\1\1\2\4\1\3\1\5"+ + "\1\3\1\5\1\6\1\7\31\3\1\10\1\11\1\12"+ + "\1\13\1\14\1\15\5\5\1\1\1\16\1\17\2\20"+ + "\1\21\1\1\3\22\1\17\1\23\1\22\2\2\1\0"+ + "\3\4\1\0\4\4\1\0\2\3\2\0\1\3\1\24"+ + "\40\3\1\24\3\3\1\24\1\25\1\24\1\3\1\24"+ + "\25\3\1\26\2\17\4\0\4\4\1\0\2\3\1\27"+ + "\1\30\2\3\1\24\1\3\1\25\36\3\1\25\24\3"+ + "\1\17\1\31\2\0\2\4\10\3\1\24\27\3\2\0"+ + "\2\4\11\3\1\24\13\3\2\0\2\4\13\3\1\24"+ + "\1\3\2\0\2\4\6\3\1\25\2\4\3\3\2\4"+ + "\1\3\2\4\1\3\1\0\1\4\1\0\1\4\1\0"+ + "\1\4\1\0\1\4\1\0\1\4\1\0\1\4\1\0"+ + "\1\4\1\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[342]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\102\0\204\0\306\0\u0108\0\u014a\0\u018c\0\u01ce"+ + "\0\u0210\0\u0252\0\u0294\0\u02d6\0\u0318\0\u035a\0\u039c\0\u03de"+ + "\0\u0420\0\u0462\0\u04a4\0\u04e6\0\u0528\0\u056a\0\u05ac\0\u05ee"+ + "\0\u0630\0\u0672\0\u06b4\0\u06f6\0\u0738\0\u077a\0\u07bc\0\u07fe"+ + "\0\u0840\0\u0882\0\u08c4\0\u0906\0\u0948\0\u098a\0\u09cc\0\u0a0e"+ + "\0\u0a50\0\u0a92\0\u0ad4\0\u0b16\0\u014a\0\u014a\0\u014a\0\u014a"+ + "\0\u014a\0\u014a\0\u0b58\0\u0b9a\0\u0bdc\0\u0c1e\0\u014a\0\u0420"+ + "\0\u014a\0\u0c60\0\u0ca2\0\u014a\0\u014a\0\u0ce4\0\u0d26\0\u014a"+ + "\0\u0d68\0\u0daa\0\u014a\0\u0dec\0\u0e2e\0\u014a\0\u0e70\0\u0eb2"+ + "\0\u0ef4\0\u014a\0\u0f36\0\u0f78\0\u0fba\0\u0ffc\0\u103e\0\u1080"+ + "\0\u10c2\0\u1104\0\u1146\0\u1188\0\u11ca\0\u120c\0\u124e\0\u1290"+ + "\0\u12d2\0\u1314\0\u1356\0\u1398\0\u13da\0\u141c\0\u145e\0\u14a0"+ + "\0\u14e2\0\u1524\0\u1566\0\u15a8\0\u15ea\0\u162c\0\u166e\0\u16b0"+ + "\0\u16f2\0\u1734\0\u1776\0\u17b8\0\u17fa\0\u183c\0\u187e\0\u18c0"+ + "\0\u1902\0\u1944\0\u1986\0\u19c8\0\u1a0a\0\u1a4c\0\u1a8e\0\u1ad0"+ + "\0\u1b12\0\u1b54\0\u1b96\0\u0252\0\u1bd8\0\u1c1a\0\u0252\0\u1c5c"+ + "\0\u1c9e\0\u1ce0\0\u1d22\0\u1d64\0\u1da6\0\u1de8\0\u1e2a\0\u1e6c"+ + "\0\u1eae\0\u1ef0\0\u1f32\0\u1f74\0\u1fb6\0\u1ff8\0\u203a\0\u207c"+ + "\0\u20be\0\u2100\0\u2142\0\u2184\0\u014a\0\u21c6\0\u2208\0\u224a"+ + "\0\u228c\0\u22ce\0\u2310\0\u2352\0\u2394\0\u23d6\0\u2418\0\u245a"+ + "\0\u249c\0\u24de\0\u014a\0\u014a\0\u2520\0\u2562\0\u25a4\0\u25e6"+ + "\0\u25a4\0\u2628\0\u266a\0\u26ac\0\u26ee\0\u2730\0\u2772\0\u27b4"+ + "\0\u27f6\0\u2838\0\u287a\0\u28bc\0\u28fe\0\u2940\0\u2982\0\u29c4"+ + "\0\u2a06\0\u2a48\0\u2a8a\0\u2acc\0\u2b0e\0\u2b50\0\u2b92\0\u2bd4"+ + "\0\u2c16\0\u2c58\0\u2c9a\0\u2cdc\0\u2d1e\0\u2d60\0\u2da2\0\u2de4"+ + "\0\u2e26\0\u2e68\0\u2eaa\0\u2eec\0\u2f2e\0\u2f70\0\u2fb2\0\u2ff4"+ + "\0\u3036\0\u3078\0\u30ba\0\u30fc\0\u313e\0\u3180\0\u25a4\0\u31c2"+ + "\0\u3204\0\u3246\0\u3288\0\u32ca\0\u014a\0\u014a\0\u330c\0\u334e"+ + "\0\u3390\0\u33d2\0\u3414\0\u3456\0\u3498\0\u34da\0\u351c\0\u355e"+ + "\0\u35a0\0\u35e2\0\u3624\0\u3666\0\u36a8\0\u36ea\0\u372c\0\u376e"+ + "\0\u1a8e\0\u37b0\0\u37f2\0\u3834\0\u3876\0\u38b8\0\u38fa\0\u393c"+ + "\0\u397e\0\u39c0\0\u3a02\0\u3a44\0\u3a86\0\u3ac8\0\u3b0a\0\u3b4c"+ + "\0\u3b8e\0\u3bd0\0\u3c12\0\u3c54\0\u3c96\0\u3cd8\0\u3d1a\0\u3d5c"+ + "\0\u3d9e\0\u3de0\0\u3e22\0\u3e64\0\u3ea6\0\u3ee8\0\u3f2a\0\u3f6c"+ + "\0\u3fae\0\u3ff0\0\u4032\0\u4074\0\u40b6\0\u40f8\0\u413a\0\u417c"+ + "\0\u41be\0\u4200\0\u4242\0\u4284\0\u42c6\0\u4308\0\u434a\0\u438c"+ + "\0\u3f6c\0\u43ce\0\u4410\0\u4452\0\u4494\0\u44d6\0\u4518\0\u455a"+ + "\0\u459c\0\u45de\0\u124e\0\u4620\0\u4662\0\u46a4\0\u46e6\0\u4728"+ + "\0\u476a\0\u47ac\0\u47ee\0\u4830\0\u4872\0\u48b4\0\u014a\0\u48f6"+ + "\0\u4938\0\u497a\0\u49bc\0\u49fe\0\u4a40\0\u4a82\0\u4ac4\0\u4b06"+ + "\0\u4b48\0\u4b8a\0\u4bcc\0\u4c0e\0\u4c50\0\u4c92\0\u4cd4\0\u4d16"+ + "\0\u4d58\0\u4d9a\0\u4ddc\0\u4e1e\0\u4e60\0\u4ea2\0\u4ee4\0\u4f26"+ + "\0\u4f68\0\u4faa\0\u4fec\0\u502e\0\u5070\0\u50b2"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[342]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\6\1\10\1\11\1\12\1\13\1\14"+ + "\1\15\3\12\3\15\1\16\1\17\1\20\1\21\1\22"+ + "\1\23\1\6\1\24\1\25\1\26\1\27\1\30\1\31"+ + "\1\32\1\33\1\12\1\34\1\35\1\36\1\37\1\40"+ + "\1\41\1\42\1\43\1\44\1\45\1\46\1\47\1\50"+ + "\1\51\1\12\1\52\1\53\1\54\1\12\1\55\1\56"+ + "\1\57\1\60\1\61\1\62\1\63\1\64\1\21\1\65"+ + "\1\66\1\67\1\21\1\70\1\12\1\71\1\72\1\73"+ + "\1\74\20\72\1\75\1\72\1\76\55\72\1\77\1\100"+ + "\20\72\1\101\1\72\1\76\54\72\1\102\1\73\1\74"+ + "\21\102\1\103\1\76\55\102\1\77\1\100\21\102\1\104"+ + "\1\76\54\102\104\0\1\6\102\0\1\10\76\0\1\11"+ + "\1\105\1\106\77\11\5\0\13\12\1\0\1\12\4\0"+ + "\34\12\16\0\1\12\7\0\1\107\102\0\1\110\1\111"+ + "\1\112\1\113\1\0\1\114\1\115\1\114\1\116\1\117"+ + "\1\120\10\0\1\120\5\0\1\112\3\0\1\116\1\113"+ + "\43\0\2\15\1\112\2\0\3\15\1\116\1\117\1\120"+ + "\10\0\1\120\5\0\1\112\3\0\1\116\42\0\13\12"+ + "\1\0\1\12\4\0\1\121\33\12\16\0\1\12\10\0"+ + "\2\117\3\0\3\117\70\0\13\12\1\0\1\12\4\0"+ + "\12\12\1\122\21\12\16\0\1\12\77\0\1\67\26\0"+ + "\1\123\102\0\1\124\62\0\13\12\1\0\1\12\4\0"+ + "\1\12\1\125\1\12\1\126\3\12\1\127\10\12\1\130"+ + "\13\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\13\12\1\131\20\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\4\12\1\132\7\12\1\133\17\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\134"+ + "\1\12\1\135\3\12\1\136\1\137\1\12\1\140\16\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\1\12"+ + "\1\141\10\12\1\142\4\12\1\143\11\12\1\144\2\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\1\145"+ + "\3\12\1\146\6\12\1\147\20\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\5\12\1\150\7\12\1\151"+ + "\3\12\1\152\12\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\5\12\1\153\5\12\1\154\1\12\1\155"+ + "\16\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\156\11\12\1\157\1\160\6\12\1\161\2\12\1\162"+ + "\6\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\163\3\12\1\164\6\12\1\165\1\166\17\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\5\12\1\167"+ + "\1\12\1\170\1\12\1\171\6\12\1\172\13\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\12\1\173"+ + "\1\174\1\175\2\12\1\176\7\12\1\177\3\12\1\200"+ + "\11\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\12\1\201\32\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\5\12\1\202\4\12\1\203\1\204\1\205"+ + "\17\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\5\12\1\206\26\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\1\207\4\12\1\210\5\12\1\211\20\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\14\12"+ + "\1\212\17\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\1\213\13\12\1\164\17\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\214\5\12\1\215"+ + "\21\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\14\12\1\216\10\12\1\217\6\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\220\3\12\1\221\27\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\13\12"+ + "\1\222\20\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\5\12\1\223\26\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\1\224\33\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\14\12\1\161\17\12\16\0"+ + "\1\12\71\0\1\21\5\0\1\67\74\0\1\21\4\0"+ + "\1\67\76\0\1\21\1\67\1\0\1\67\77\0\1\21"+ + "\1\0\1\67\3\0\1\72\2\0\20\72\1\0\1\72"+ + "\1\0\54\72\2\0\1\74\77\0\2\225\1\0\4\225"+ + "\1\226\4\225\2\226\1\227\63\225\2\0\1\100\122\0"+ + "\1\230\56\0\1\102\2\0\21\102\2\0\54\102\24\0"+ + "\1\231\57\0\1\106\126\0\1\232\12\0\1\233\46\0"+ + "\1\110\1\111\1\112\2\0\1\114\1\115\1\114\1\116"+ + "\1\117\1\120\10\0\1\120\5\0\1\112\3\0\1\116"+ + "\44\0\2\111\3\0\3\111\1\116\1\117\1\120\10\0"+ + "\1\120\11\0\1\116\44\0\1\234\1\235\2\0\5\235"+ + "\1\0\1\235\4\0\1\235\1\0\1\235\1\0\1\235"+ + "\2\0\1\235\1\0\1\235\4\0\1\235\44\0\1\236"+ + "\1\111\1\112\2\0\3\236\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\44\0\1\114\1\111"+ + "\1\112\2\0\3\114\1\116\1\117\1\120\10\0\1\120"+ + "\5\0\1\112\3\0\1\116\116\0\1\112\16\0\1\112"+ + "\10\0\2\117\3\0\3\117\1\116\1\0\1\120\10\0"+ + "\1\120\11\0\1\116\44\0\2\237\3\0\3\237\3\0"+ + "\1\240\64\0\13\12\1\0\1\12\4\0\12\12\1\241"+ + "\21\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\12\12\1\242\21\12\16\0\1\12\24\0\1\243\102\0"+ + "\1\244\62\0\13\12\1\0\1\12\4\0\2\12\1\177"+ + "\31\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\3\12\1\245\30\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\3\12\1\174\30\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\20\12\1\246\13\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\6\12\1\177"+ + "\25\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\12\12\1\247\3\12\1\177\15\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\5\12\1\174\3\12\1\171"+ + "\17\12\1\250\2\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\6\12\1\251\3\12\1\252\21\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\253\4\12"+ + "\1\174\26\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\14\12\1\254\17\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\5\12\1\255\26\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\20\12\1\176\1\12"+ + "\1\174\11\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\15\12\1\256\16\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\3\12\1\257\10\12\1\252\17\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\4\12"+ + "\1\260\4\12\1\261\22\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\1\262\33\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\12\1\263\12\12\1\264"+ + "\7\12\1\265\7\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\2\12\1\266\3\12\1\267\3\12\1\270"+ + "\5\12\1\162\10\12\1\271\2\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\15\12\1\272\16\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\21\12\1\177"+ + "\12\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\20\12\1\273\13\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\20\12\1\274\13\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\275\27\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\13\12\1\262"+ + "\20\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\16\12\1\276\15\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\12\12\1\277\21\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\300\33\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\1\12\1\301\2\12"+ + "\1\302\15\12\1\303\11\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\20\12\1\174\13\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\5\12\1\174\26\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\22\12"+ + "\1\304\11\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\1\12\1\174\32\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\1\12\1\305\7\12\1\306\22\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\3\12"+ + "\1\171\30\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\2\12\1\174\31\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\33\12\1\307\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\6\12\1\174\25\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\164"+ + "\27\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\6\12\1\310\11\12\1\311\13\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\3\12\1\312\10\12\1\313"+ + "\17\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\4\12\1\162\27\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\20\12\1\314\13\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\14\12\1\315\17\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\13\12\1\316"+ + "\20\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\13\12\1\317\20\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\5\12\1\177\26\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\12\1\320\10\12\1\321"+ + "\21\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\322\33\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\3\12\1\323\30\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\13\12\1\324\1\325\17\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\24\12\1\174"+ + "\7\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\4\12\1\326\27\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\17\12\2\174\13\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\6\12\1\327\25\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\13\12\1\330"+ + "\20\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\6\12\1\331\25\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\14\12\1\332\17\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\3\12\1\333\30\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\12\12\1\161"+ + "\4\12\1\174\14\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\1\12\1\274\4\12\1\334\25\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\15\12\1\274"+ + "\16\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\5\12\1\127\26\12\16\0\1\12\10\0\1\227\4\0"+ + "\3\227\72\0\1\335\4\0\3\335\106\0\1\336\102\0"+ + "\1\336\103\0\1\337\123\0\1\340\40\0\1\234\1\235"+ + "\1\112\1\0\5\235\1\0\1\235\4\0\1\235\1\0"+ + "\1\235\1\0\1\235\2\0\1\235\1\0\1\235\1\112"+ + "\3\0\1\235\44\0\2\341\1\112\1\0\5\341\1\0"+ + "\1\341\4\0\1\341\1\0\1\341\1\0\1\341\2\0"+ + "\1\341\1\0\1\341\1\112\3\0\1\341\44\0\1\342"+ + "\1\111\1\112\2\0\3\342\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\44\0\2\237\3\0"+ + "\3\237\1\116\24\0\1\116\44\0\2\237\3\0\3\237"+ + "\70\0\13\12\1\0\1\12\4\0\3\12\1\274\30\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\14\12"+ + "\1\343\17\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\4\12\1\344\27\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\12\12\1\345\21\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\1\346\33\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\22\12\1\347"+ + "\11\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\16\12\1\177\15\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\6\12\1\350\25\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\11\12\1\274\22\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\6\12\1\351"+ + "\25\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\22\12\1\352\11\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\4\12\1\177\27\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\11\12\1\353\22\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\354"+ + "\27\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\12\12\1\174\21\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\23\12\1\274\10\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\3\12\1\257\30\12\16\0"+ + "\1\12\6\0\1\12\1\355\11\12\1\0\1\12\4\0"+ + "\34\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\15\12\1\254\16\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\15\12\1\356\16\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\13\12\1\357\20\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\360"+ + "\27\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\12\1\361\32\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\12\12\1\274\21\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\174\27\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\362\33\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\16\12"+ + "\1\176\15\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\12\12\1\363\21\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\3\12\1\364\30\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\6\12\1\365\25\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\5\12"+ + "\1\254\26\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\20\12\1\366\13\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\7\12\1\367\24\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\23\12\1\174\10\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\1\370"+ + "\33\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\4\12\1\371\27\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\4\12\1\372\27\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\15\12\1\171\16\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\15\12\1\373"+ + "\16\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\12\1\374\32\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\13\12\1\344\20\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\11\12\1\375\22\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\22\12\1\177"+ + "\7\12\1\376\1\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\1\171\33\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\1\377\33\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\174\1\12\1\176"+ + "\25\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\12\1\263\32\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\3\12\1\177\30\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\20\12\1\u0100\13\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\12\1\131"+ + "\32\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\12\12\1\125\21\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\7\12\1\u0101\24\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\25\12\1\177\6\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\12\12\1\257"+ + "\21\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\346\24\12\1\174\6\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\27\12\1\u0102\4\12\16\0\1\12"+ + "\51\0\1\u0103\77\0\1\u0104\42\0\2\u0105\1\112\1\0"+ + "\5\u0105\1\0\1\u0105\4\0\1\u0105\1\0\1\u0105\1\0"+ + "\1\u0105\2\0\1\u0105\1\0\1\u0105\1\112\3\0\1\u0105"+ + "\44\0\1\u0106\1\111\1\112\2\0\3\u0106\1\116\1\117"+ + "\1\120\10\0\1\120\5\0\1\112\3\0\1\116\42\0"+ + "\13\12\1\0\1\12\4\0\20\12\1\u0107\13\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\5\12\1\131"+ + "\26\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\21\12\1\174\12\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\6\12\1\u0108\25\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\13\12\1\361\20\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\14\12\1\u0109"+ + "\17\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\4\12\1\361\27\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\4\12\1\u010a\27\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\16\12\1\u010b\15\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\20\12\1\131"+ + "\13\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\14\12\1\u010c\17\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\5\12\1\u010d\26\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\361\33\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\5\12\1\u010e\26\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\10\12"+ + "\1\177\23\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\1\u010f\33\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\3\12\1\u0110\30\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\14\12\1\u0111\17\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\12\12\1\u0112"+ + "\1\12\1\273\17\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\2\12\1\u0113\31\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\12\12\1\127\21\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\11\12\1\171"+ + "\22\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\5\12\1\164\26\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\7\12\1\u0114\24\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\3\12\1\u0115\30\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\13\12\1\u0116"+ + "\11\12\1\162\6\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\4\12\1\u0117\27\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\12\12\1\u0118\21\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\u0119"+ + "\27\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\1\u011a\33\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\22\12\1\u011b\11\12\16\0\1\12\33\0\1\u011c"+ + "\110\0\1\u011d\47\0\2\u011e\1\112\1\0\5\u011e\1\0"+ + "\1\u011e\4\0\1\u011e\1\0\1\u011e\1\0\1\u011e\2\0"+ + "\1\u011e\1\0\1\u011e\1\112\3\0\1\u011e\44\0\1\u011f"+ + "\1\111\1\112\2\0\3\u011f\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\42\0\13\12\1\0"+ + "\1\12\4\0\3\12\1\u0120\30\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\6\12\1\162\25\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\11\12\1\u0121"+ + "\22\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\5\12\1\u0122\26\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\14\12\1\273\17\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\12\1\u0123\32\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\12\1\177"+ + "\32\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\3\12\1\351\30\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\7\12\1\273\24\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\22\12\1\u0124\11\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\1\12\1\u0125"+ + "\32\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\4\12\1\u0126\27\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\1\177\33\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\11\12\1\u0127\22\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\6\12\1\u0128\25\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\2\12"+ + "\1\274\31\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\1\12\1\u0129\32\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\12\12\1\150\21\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\5\12\1\u012a\26\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\12\12"+ + "\1\u012b\21\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\20\12\1\u012c\13\12\16\0\1\12\7\0\1\u012d"+ + "\126\0\1\u012e\55\0\2\u012f\1\112\1\0\5\u012f\1\0"+ + "\1\u012f\4\0\1\u012f\1\0\1\u012f\1\0\1\u012f\2\0"+ + "\1\u012f\1\0\1\u012f\1\112\3\0\1\u012f\44\0\1\u0130"+ + "\1\111\1\112\2\0\3\u0130\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\42\0\13\12\1\0"+ + "\1\12\4\0\14\12\1\127\17\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\1\u0131\33\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\20\12\1\311\13\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\4\12"+ + "\1\u0132\27\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\15\12\1\257\16\12\16\0\1\12\6\0\13\12"+ + "\1\0\1\12\4\0\17\12\1\174\14\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\12\12\1\u0133\21\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\1\u0134"+ + "\33\12\16\0\1\12\6\0\13\12\1\0\1\12\4\0"+ + "\3\12\1\u0135\30\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\6\12\1\345\25\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\12\12\1\u0136\21\12\16\0"+ + "\1\12\7\0\1\u0137\127\0\1\u011c\54\0\2\u0138\1\112"+ + "\1\0\5\u0138\1\0\1\u0138\4\0\1\u0138\1\0\1\u0138"+ + "\1\0\1\u0138\2\0\1\u0138\1\0\1\u0138\1\112\3\0"+ + "\1\u0138\44\0\1\u0139\1\111\1\112\2\0\3\u0139\1\116"+ + "\1\117\1\120\10\0\1\120\5\0\1\112\3\0\1\116"+ + "\42\0\13\12\1\0\1\12\4\0\6\12\1\274\25\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\6\12"+ + "\1\u013a\25\12\16\0\1\12\6\0\13\12\1\0\1\12"+ + "\4\0\1\u013b\33\12\16\0\1\12\6\0\13\12\1\0"+ + "\1\12\4\0\1\12\1\254\32\12\16\0\1\12\6\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\171\27\12\16\0"+ + "\1\12\6\0\13\12\1\0\1\12\4\0\4\12\1\u013c"+ + "\27\12\16\0\1\12\10\0\2\u013d\1\112\1\0\5\u013d"+ + "\1\0\1\u013d\4\0\1\u013d\1\0\1\u013d\1\0\1\u013d"+ + "\2\0\1\u013d\1\0\1\u013d\1\112\3\0\1\u013d\44\0"+ + "\1\u013e\1\111\1\112\2\0\3\u013e\1\116\1\117\1\120"+ + "\10\0\1\120\5\0\1\112\3\0\1\116\42\0\13\12"+ + "\1\0\1\12\4\0\25\12\1\347\6\12\16\0\1\12"+ + "\6\0\13\12\1\0\1\12\4\0\3\12\1\127\30\12"+ + "\16\0\1\12\6\0\13\12\1\0\1\12\4\0\22\12"+ + "\1\u013f\11\12\16\0\1\12\10\0\2\u0140\1\112\1\0"+ + "\5\u0140\1\0\1\u0140\4\0\1\u0140\1\0\1\u0140\1\0"+ + "\1\u0140\2\0\1\u0140\1\0\1\u0140\1\112\3\0\1\u0140"+ + "\44\0\1\u0141\1\111\1\112\2\0\3\u0141\1\116\1\117"+ + "\1\120\10\0\1\120\5\0\1\112\3\0\1\116\42\0"+ + "\13\12\1\0\1\12\4\0\4\12\1\u0142\27\12\16\0"+ + "\1\12\10\0\2\u0143\1\112\1\0\5\u0143\1\0\1\u0143"+ + "\4\0\1\u0143\1\0\1\u0143\1\0\1\u0143\2\0\1\u0143"+ + "\1\0\1\u0143\1\112\3\0\1\u0143\44\0\1\u0144\1\111"+ + "\1\112\2\0\3\u0144\1\116\1\117\1\120\10\0\1\120"+ + "\5\0\1\112\3\0\1\116\42\0\13\12\1\0\1\12"+ + "\4\0\1\12\1\255\32\12\16\0\1\12\10\0\2\u0145"+ + "\1\112\1\0\5\u0145\1\0\1\u0145\4\0\1\u0145\1\0"+ + "\1\u0145\1\0\1\u0145\2\0\1\u0145\1\0\1\u0145\1\112"+ + "\3\0\1\u0145\44\0\1\u0146\1\111\1\112\2\0\3\u0146"+ + "\1\116\1\117\1\120\10\0\1\120\5\0\1\112\3\0"+ + "\1\116\44\0\2\u0147\1\112\1\0\5\u0147\1\0\1\u0147"+ + "\4\0\1\u0147\1\0\1\u0147\1\0\1\u0147\2\0\1\u0147"+ + "\1\0\1\u0147\1\112\3\0\1\u0147\44\0\1\u0148\1\111"+ + "\1\112\2\0\3\u0148\1\116\1\117\1\120\10\0\1\120"+ + "\5\0\1\112\3\0\1\116\44\0\2\u0149\1\112\1\0"+ + "\5\u0149\1\0\1\u0149\4\0\1\u0149\1\0\1\u0149\1\0"+ + "\1\u0149\2\0\1\u0149\1\0\1\u0149\1\112\3\0\1\u0149"+ + "\44\0\1\u014a\1\111\1\112\2\0\3\u014a\1\116\1\117"+ + "\1\120\10\0\1\120\5\0\1\112\3\0\1\116\44\0"+ + "\2\u014b\1\112\1\0\5\u014b\1\0\1\u014b\4\0\1\u014b"+ + "\1\0\1\u014b\1\0\1\u014b\2\0\1\u014b\1\0\1\u014b"+ + "\1\112\3\0\1\u014b\44\0\1\u014c\1\111\1\112\2\0"+ + "\3\u014c\1\116\1\117\1\120\10\0\1\120\5\0\1\112"+ + "\3\0\1\116\44\0\2\u014d\1\112\1\0\5\u014d\1\0"+ + "\1\u014d\4\0\1\u014d\1\0\1\u014d\1\0\1\u014d\2\0"+ + "\1\u014d\1\0\1\u014d\1\112\3\0\1\u014d\44\0\1\u014e"+ + "\1\111\1\112\2\0\3\u014e\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\44\0\2\u014f\1\112"+ + "\1\0\5\u014f\1\0\1\u014f\4\0\1\u014f\1\0\1\u014f"+ + "\1\0\1\u014f\2\0\1\u014f\1\0\1\u014f\1\112\3\0"+ + "\1\u014f\44\0\1\u0150\1\111\1\112\2\0\3\u0150\1\116"+ + "\1\117\1\120\10\0\1\120\5\0\1\112\3\0\1\116"+ + "\44\0\2\u0151\1\112\1\0\5\u0151\1\0\1\u0151\4\0"+ + "\1\u0151\1\0\1\u0151\1\0\1\u0151\2\0\1\u0151\1\0"+ + "\1\u0151\1\112\3\0\1\u0151\44\0\1\u0152\1\111\1\112"+ + "\2\0\3\u0152\1\116\1\117\1\120\10\0\1\120\5\0"+ + "\1\112\3\0\1\116\46\0\1\112\26\0\1\112\50\0"+ + "\1\u0153\1\111\1\112\2\0\3\u0153\1\116\1\117\1\120"+ + "\10\0\1\120\5\0\1\112\3\0\1\116\44\0\1\u0154"+ + "\1\111\1\112\2\0\3\u0154\1\116\1\117\1\120\10\0"+ + "\1\120\5\0\1\112\3\0\1\116\44\0\1\u0155\1\111"+ + "\1\112\2\0\3\u0155\1\116\1\117\1\120\10\0\1\120"+ + "\5\0\1\112\3\0\1\116\44\0\1\u0156\1\111\1\112"+ + "\2\0\3\u0156\1\116\1\117\1\120\10\0\1\120\5\0"+ + "\1\112\3\0\1\116\44\0\2\111\1\112\2\0\3\111"+ + "\1\116\1\117\1\120\10\0\1\120\5\0\1\112\3\0"+ + "\1\116\35\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[20724]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\46\1\6\11\4\1\1\11\1\1\1\11"+ + "\2\1\2\11\2\1\1\11\2\1\1\11\2\1\1\11"+ + "\1\0\2\1\1\11\1\0\4\1\1\0\2\1\2\0"+ + "\100\1\1\11\2\1\4\0\4\1\1\0\2\1\2\11"+ + "\70\1\2\11\2\0\42\1\2\0\27\1\2\0\17\1"+ + "\2\0\10\1\1\11\13\1\1\0\1\1\1\0\1\1"+ + "\1\0\1\1\1\0\1\1\1\0\1\1\1\0\1\1"+ + "\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[342]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public PythonLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public PythonLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public PythonLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 174) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 9: + { return token(TokenType.OPERATOR, -PARAN); + } + case 26: break; + case 20: + { return token(TokenType.KEYWORD); + } + case 27: break; + case 19: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 28: break; + case 4: + { return token(TokenType.NUMBER); + } + case 29: break; + case 5: + { return token(TokenType.OPERATOR); + } + case 30: break; + case 10: + { return token(TokenType.OPERATOR, CURLY); + } + case 31: break; + case 11: + { return token(TokenType.OPERATOR, -CURLY); + } + case 32: break; + case 25: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + case 33: break; + case 23: + { yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + case 34: break; + case 15: + { tokenLength += yylength(); + } + case 35: break; + case 16: + { yybegin(YYINITIAL); + } + case 36: break; + case 6: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 37: break; + case 17: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 38: break; + case 21: + { return token(TokenType.TYPE); + } + case 39: break; + case 13: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 40: break; + case 8: + { return token(TokenType.OPERATOR, PARAN); + } + case 41: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 42: break; + case 22: + { tokenLength += 2; + } + case 43: break; + case 14: + { return token(TokenType.ERROR); + } + case 44: break; + case 24: + { yybegin(SQML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + case 45: break; + case 18: + { tokenLength ++; + } + case 46: break; + case 12: + { return token(TokenType.OPERATOR, BRACKET); + } + case 47: break; + case 7: + { yybegin(SQSTRING); + tokenStart = yychar; + tokenLength = 1; + } + case 48: break; + case 2: + { return token(TokenType.COMMENT); + } + case 49: break; + case 1: + { + } + case 50: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/RubyLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/RubyLexer.java new file mode 100644 index 000000000..1703c95b9 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/RubyLexer.java @@ -0,0 +1,947 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/ruby.flex + */ +public final class RubyLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int ML_STRING = 4; + public static final int STRING = 2; + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\1\74\1\75"+ + "\1\4\1\0\1\67\1\67\1\0\1\57\1\60\1\65\1\22\1\72"+ + "\1\22\1\20\1\66\1\7\1\15\2\14\4\16\2\10\1\72\1\72"+ + "\1\70\1\73\1\71\1\77\1\72\1\13\1\24\1\13\1\44\1\25"+ + "\1\17\1\26\1\5\1\27\1\76\1\5\1\11\1\5\1\30\11\5"+ + "\1\12\2\5\1\63\1\23\1\64\1\67\1\6\1\72\1\35\1\52"+ + "\1\51\1\47\1\21\1\41\1\56\1\43\1\37\1\76\1\53\1\40"+ + "\1\54\1\31\1\45\1\46\1\5\1\34\1\32\1\36\1\33\1\5"+ + "\1\42\1\55\1\50\1\5\1\61\1\67\1\62\1\72\uff81\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\3\1\1\2\1\3\1\1\2\4\1\5\1\3"+ + "\1\5\21\3\1\6\1\7\1\10\1\11\1\12\1\13"+ + "\5\5\1\1\1\14\1\15\2\16\1\1\1\17\2\20"+ + "\1\1\2\2\1\21\1\0\3\4\1\0\4\4\1\0"+ + "\20\3\1\22\1\23\12\3\1\0\1\24\2\15\3\0"+ + "\4\4\1\0\1\3\1\25\20\3\1\23\6\3\1\26"+ + "\1\15\1\27\2\0\2\4\15\3\1\0\2\4\1\3"+ + "\1\0\2\4\1\0\2\4\1\30\6\4\1\0\1\4"+ + "\1\0\1\4\1\0\1\4\1\0\1\4\1\0\1\4"+ + "\1\0\1\4\1\0\1\4\1\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[187]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\100\0\200\0\300\0\u0100\0\u0140\0\u0180\0\u01c0"+ + "\0\u0200\0\u0240\0\u0280\0\u02c0\0\u0300\0\u0340\0\u0380\0\u03c0"+ + "\0\u0400\0\u0440\0\u0480\0\u04c0\0\u0500\0\u0540\0\u0580\0\u05c0"+ + "\0\u0600\0\u0640\0\u0680\0\u06c0\0\u0700\0\u0740\0\u0780\0\300"+ + "\0\300\0\300\0\300\0\300\0\300\0\u07c0\0\u0800\0\u0840"+ + "\0\u0880\0\300\0\u0340\0\u08c0\0\u0900\0\u0940\0\300\0\u0980"+ + "\0\300\0\u09c0\0\300\0\u0a00\0\u0a40\0\300\0\300\0\u0a80"+ + "\0\u0ac0\0\u0b00\0\300\0\u0b40\0\u0b80\0\u0bc0\0\u0c00\0\u0c40"+ + "\0\u0c80\0\u0cc0\0\u0d00\0\u0d40\0\u0d80\0\u0dc0\0\u0e00\0\u0e40"+ + "\0\u0e80\0\u0ec0\0\u0f00\0\u0f40\0\u0f80\0\u0fc0\0\u1000\0\u1040"+ + "\0\u1080\0\u01c0\0\u01c0\0\u10c0\0\u1100\0\u1140\0\u1180\0\u11c0"+ + "\0\u1200\0\u1240\0\u1280\0\u12c0\0\u1300\0\u1340\0\300\0\u1380"+ + "\0\u13c0\0\u1400\0\u1440\0\u1480\0\u14c0\0\u1500\0\u1540\0\u1580"+ + "\0\u15c0\0\u1600\0\u01c0\0\u1640\0\u1680\0\u16c0\0\u1700\0\u1740"+ + "\0\u1780\0\u17c0\0\u1800\0\u1840\0\u1880\0\u18c0\0\u1900\0\u1940"+ + "\0\u1980\0\u19c0\0\u1a00\0\u1a40\0\u1a80\0\u1ac0\0\u1b00\0\u1b40"+ + "\0\u1b80\0\u1bc0\0\300\0\300\0\300\0\u1c00\0\u1c40\0\u1c80"+ + "\0\u1cc0\0\u1d00\0\u1d40\0\u1d80\0\u1dc0\0\u1e00\0\u1e40\0\u1e80"+ + "\0\u1ec0\0\u1f00\0\u1f40\0\u1f80\0\u1fc0\0\u2000\0\u2040\0\u2080"+ + "\0\u20c0\0\u2100\0\u2140\0\u2180\0\u21c0\0\u2200\0\u2240\0\u2280"+ + "\0\300\0\u22c0\0\u2300\0\u2340\0\u2380\0\u23c0\0\u2400\0\u2440"+ + "\0\u2480\0\u24c0\0\u2500\0\u2540\0\u2580\0\u25c0\0\u2600\0\u2640"+ + "\0\u2680\0\u26c0\0\u2700\0\u2740\0\u2780\0\u27c0\0\u2800\0\u2840"+ + "\0\u2880\0\u28c0\0\u2900"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[187]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\4\1\6\1\7\1\10\1\11\1\12"+ + "\1\13\3\10\3\13\1\10\1\14\1\15\1\16\1\4"+ + "\1\17\1\20\3\10\1\21\1\22\1\23\1\24\1\25"+ + "\1\26\1\27\1\10\1\30\1\31\2\10\1\32\1\10"+ + "\1\33\1\34\1\35\1\36\1\10\1\37\2\10\1\40"+ + "\1\41\1\42\1\43\1\44\1\45\1\46\1\47\1\16"+ + "\1\50\1\51\1\52\1\16\1\53\1\54\1\10\1\4"+ + "\1\55\1\56\1\57\20\55\1\60\51\55\1\61\3\55"+ + "\1\62\1\63\20\55\1\60\51\55\1\64\2\55\102\0"+ + "\1\4\100\0\1\6\74\0\1\7\1\65\1\66\75\7"+ + "\5\0\13\10\1\0\1\10\2\0\33\10\17\0\1\10"+ + "\1\67\6\0\1\70\100\0\1\71\1\72\1\73\1\74"+ + "\1\0\1\75\1\76\1\75\1\77\1\100\1\101\3\0"+ + "\1\101\12\0\1\73\1\77\13\0\1\74\31\0\2\13"+ + "\1\73\2\0\3\13\1\77\1\100\1\101\3\0\1\101"+ + "\12\0\1\73\1\77\45\0\2\100\3\0\3\100\1\0"+ + "\1\52\64\0\13\10\1\0\1\10\2\0\5\10\1\102"+ + "\6\10\1\103\16\10\17\0\1\10\1\67\73\0\1\52"+ + "\11\0\13\10\1\0\1\10\2\0\1\10\1\104\31\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\4\10\1\105\26\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\106\2\0\13\10\1\107\5\10\1\110\11\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\111\2\0"+ + "\7\10\1\112\23\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\5\10\1\113\25\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\114\2\0\33\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\5\10"+ + "\1\115\1\116\5\10\1\117\16\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\10\10\1\120\6\10"+ + "\1\121\13\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\5\10\1\122\7\10\1\123\15\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\11\10"+ + "\1\124\7\10\1\125\11\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\17\10\1\126\13\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\10\10"+ + "\1\122\22\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\127\2\0\21\10\1\123\11\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\13\10\1\130\17\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\11\10\1\131\2\10\1\132\16\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\133\2\0\10\10\1\134\22\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\21\10\1\135\11\10\17\0\1\10\1\67\65\0\1\16"+ + "\5\0\1\52\72\0\1\16\4\0\1\52\74\0\1\16"+ + "\1\52\1\0\1\52\75\0\1\16\1\0\1\52\101\0"+ + "\1\136\2\0\1\55\2\0\20\55\1\0\51\55\1\0"+ + "\2\55\2\0\1\57\75\0\2\137\1\0\4\137\1\140"+ + "\4\137\2\140\1\141\61\137\2\0\1\63\172\0\1\142"+ + "\4\0\1\66\106\0\1\143\5\0\1\144\67\0\1\71"+ + "\1\72\1\73\2\0\1\75\1\76\1\75\1\77\1\100"+ + "\1\101\3\0\1\101\12\0\1\73\1\77\45\0\2\72"+ + "\3\0\3\72\1\77\1\100\1\101\3\0\1\101\13\0"+ + "\1\77\45\0\1\145\1\146\2\0\5\146\1\0\1\146"+ + "\2\0\2\146\7\0\1\146\3\0\1\146\2\0\1\146"+ + "\2\0\1\146\1\0\2\146\34\0\1\147\1\72\1\73"+ + "\2\0\3\147\1\77\1\100\1\101\3\0\1\101\12\0"+ + "\1\73\1\77\45\0\1\75\1\72\1\73\2\0\3\75"+ + "\1\77\1\100\1\101\3\0\1\101\12\0\1\73\1\77"+ + "\134\0\1\73\10\0\2\100\3\0\3\100\1\77\1\0"+ + "\1\101\3\0\1\101\13\0\1\77\45\0\2\150\3\0"+ + "\3\150\3\0\1\151\62\0\13\10\1\0\1\10\2\0"+ + "\6\10\1\152\14\10\1\153\7\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\6\10\1\154\24\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\2\10\1\155\30\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\20\10\1\122\12\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\10\2\0\31\10\1\110"+ + "\1\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\14\10\1\122\16\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\12\10\1\122\20\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\14\10"+ + "\1\156\16\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\22\10\1\157\10\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\12\10\1\160\1\10"+ + "\1\161\6\10\1\162\7\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\6\10\1\163\3\10\1\164"+ + "\10\10\1\165\7\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\23\10\1\122\7\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\10\2\0\6\10\1\166"+ + "\24\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\13\10\1\167\17\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\7\10\1\170\23\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\171\2\0\33\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\14\10\1\172\16\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\10\10\1\123\22\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\171\2\0\13\10\1\173"+ + "\17\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\15\10\1\174\15\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\175\2\0\33\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\6\10\1\176\24\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\11\10\1\177\21\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\32\10\1\200\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\201\2\0\33\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\10\2\0\23\10\1\202"+ + "\7\10\17\0\1\10\1\67\75\0\1\203\11\0\1\141"+ + "\4\0\3\141\70\0\1\204\4\0\3\204\156\0\1\205"+ + "\31\0\1\206\77\0\1\207\57\0\1\145\1\146\1\73"+ + "\1\0\5\146\1\0\1\146\2\0\2\146\7\0\1\146"+ + "\2\0\1\73\1\146\2\0\1\146\2\0\1\146\1\0"+ + "\2\146\34\0\2\210\1\73\1\0\5\210\1\0\1\210"+ + "\2\0\2\210\7\0\1\210\2\0\1\73\1\210\2\0"+ + "\1\210\2\0\1\210\1\0\2\210\34\0\1\211\1\72"+ + "\1\73\2\0\3\211\1\77\1\100\1\101\3\0\1\101"+ + "\12\0\1\73\1\77\45\0\2\150\3\0\3\150\1\77"+ + "\21\0\1\77\45\0\2\150\3\0\3\150\66\0\13\10"+ + "\1\0\1\10\2\0\7\10\1\212\23\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\122\2\0\13\10\1\156"+ + "\17\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\3\10\1\213\27\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\15\10\1\122\15\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\32\2\0\33\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\13\10\1\214\17\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\215\2\0\33\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\156\2\0\33\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\25\10\1\120\5\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\7\10\1\216\1\217\22\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\21\10\1\122\11\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\220\2\0\33\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\11\10\1\221\21\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\122\2\0\33\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\5\10\1\122\25\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\6\10"+ + "\1\170\24\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\14\10\1\176\16\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\13\10\1\222\17\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\14\10\1\115\16\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\123\2\0\33\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\6\10\1\223\24\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\13\10"+ + "\1\224\17\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\11\10\1\225\21\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\7\10\1\226\23\10"+ + "\17\0\1\10\1\67\30\0\1\227\60\0\1\227\75\0"+ + "\2\230\1\73\1\0\5\230\1\0\1\230\2\0\2\230"+ + "\7\0\1\230\2\0\1\73\1\230\2\0\1\230\2\0"+ + "\1\230\1\0\2\230\34\0\1\231\1\72\1\73\2\0"+ + "\3\231\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\43\0\13\10\1\0\1\10\2\0\10\10\1\170"+ + "\22\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\4\10\1\122\26\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\14\10\1\123\16\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\6\10"+ + "\1\221\24\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\10\10\1\171\22\10\17\0\1\10\1\67"+ + "\5\0\13\10\1\0\1\10\2\0\24\10\1\122\6\10"+ + "\17\0\1\10\1\67\5\0\13\10\1\0\1\10\2\0"+ + "\10\10\1\110\22\10\17\0\1\10\1\67\5\0\13\10"+ + "\1\0\1\10\2\0\6\10\1\122\24\10\17\0\1\10"+ + "\1\67\5\0\13\10\1\0\1\10\2\0\5\10\1\232"+ + "\25\10\17\0\1\10\1\67\5\0\13\10\1\0\1\10"+ + "\2\0\6\10\1\123\24\10\17\0\1\10\1\67\5\0"+ + "\13\10\1\0\1\10\2\0\5\10\1\123\25\10\17\0"+ + "\1\10\1\67\5\0\13\10\1\0\1\10\2\0\27\10"+ + "\1\122\3\10\17\0\1\10\1\67\5\0\13\10\1\0"+ + "\1\10\2\0\14\10\1\170\16\10\17\0\1\10\1\67"+ + "\25\0\1\233\61\0\2\234\1\73\1\0\5\234\1\0"+ + "\1\234\2\0\2\234\7\0\1\234\2\0\1\73\1\234"+ + "\2\0\1\234\2\0\1\234\1\0\2\234\34\0\1\235"+ + "\1\72\1\73\2\0\3\235\1\77\1\100\1\101\3\0"+ + "\1\101\12\0\1\73\1\77\43\0\13\10\1\0\1\115"+ + "\2\0\33\10\17\0\1\10\1\67\6\0\1\236\100\0"+ + "\2\237\1\73\1\0\5\237\1\0\1\237\2\0\2\237"+ + "\7\0\1\237\2\0\1\73\1\237\2\0\1\237\2\0"+ + "\1\237\1\0\2\237\34\0\1\240\1\72\1\73\2\0"+ + "\3\240\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\44\0\1\241\100\0\2\242\1\73\1\0\5\242"+ + "\1\0\1\242\2\0\2\242\7\0\1\242\2\0\1\73"+ + "\1\242\2\0\1\242\2\0\1\242\1\0\2\242\34\0"+ + "\1\243\1\72\1\73\2\0\3\243\1\77\1\100\1\101"+ + "\3\0\1\101\12\0\1\73\1\77\45\0\2\244\1\73"+ + "\1\0\5\244\1\0\1\244\2\0\2\244\7\0\1\244"+ + "\2\0\1\73\1\244\2\0\1\244\2\0\1\244\1\0"+ + "\2\244\34\0\1\245\1\72\1\73\2\0\3\245\1\77"+ + "\1\100\1\101\3\0\1\101\12\0\1\73\1\77\45\0"+ + "\2\246\1\73\1\0\5\246\1\0\1\246\2\0\2\246"+ + "\7\0\1\246\2\0\1\73\1\246\2\0\1\246\2\0"+ + "\1\246\1\0\2\246\34\0\1\247\1\72\1\73\2\0"+ + "\3\247\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\45\0\2\250\1\73\1\0\5\250\1\0\1\250"+ + "\2\0\2\250\7\0\1\250\2\0\1\73\1\250\2\0"+ + "\1\250\2\0\1\250\1\0\2\250\34\0\1\251\1\72"+ + "\1\73\2\0\3\251\1\77\1\100\1\101\3\0\1\101"+ + "\12\0\1\73\1\77\45\0\2\252\1\73\1\0\5\252"+ + "\1\0\1\252\2\0\2\252\7\0\1\252\2\0\1\73"+ + "\1\252\2\0\1\252\2\0\1\252\1\0\2\252\34\0"+ + "\1\253\1\72\1\73\2\0\3\253\1\77\1\100\1\101"+ + "\3\0\1\101\12\0\1\73\1\77\45\0\2\254\1\73"+ + "\1\0\5\254\1\0\1\254\2\0\2\254\7\0\1\254"+ + "\2\0\1\73\1\254\2\0\1\254\2\0\1\254\1\0"+ + "\2\254\34\0\1\255\1\72\1\73\2\0\3\255\1\77"+ + "\1\100\1\101\3\0\1\101\12\0\1\73\1\77\45\0"+ + "\2\256\1\73\1\0\5\256\1\0\1\256\2\0\2\256"+ + "\7\0\1\256\2\0\1\73\1\256\2\0\1\256\2\0"+ + "\1\256\1\0\2\256\34\0\1\257\1\72\1\73\2\0"+ + "\3\257\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\45\0\2\260\1\73\1\0\5\260\1\0\1\260"+ + "\2\0\2\260\7\0\1\260\2\0\1\73\1\260\2\0"+ + "\1\260\2\0\1\260\1\0\2\260\34\0\1\261\1\72"+ + "\1\73\2\0\3\261\1\77\1\100\1\101\3\0\1\101"+ + "\12\0\1\73\1\77\45\0\2\262\1\73\1\0\5\262"+ + "\1\0\1\262\2\0\2\262\7\0\1\262\2\0\1\73"+ + "\1\262\2\0\1\262\2\0\1\262\1\0\2\262\34\0"+ + "\1\263\1\72\1\73\2\0\3\263\1\77\1\100\1\101"+ + "\3\0\1\101\12\0\1\73\1\77\45\0\2\264\1\73"+ + "\1\0\5\264\1\0\1\264\2\0\2\264\7\0\1\264"+ + "\2\0\1\73\1\264\2\0\1\264\2\0\1\264\1\0"+ + "\2\264\34\0\1\265\1\72\1\73\2\0\3\265\1\77"+ + "\1\100\1\101\3\0\1\101\12\0\1\73\1\77\45\0"+ + "\2\266\1\73\1\0\5\266\1\0\1\266\2\0\2\266"+ + "\7\0\1\266\2\0\1\73\1\266\2\0\1\266\2\0"+ + "\1\266\1\0\2\266\34\0\1\267\1\72\1\73\2\0"+ + "\3\267\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\47\0\1\73\26\0\1\73\46\0\1\270\1\72"+ + "\1\73\2\0\3\270\1\77\1\100\1\101\3\0\1\101"+ + "\12\0\1\73\1\77\45\0\1\271\1\72\1\73\2\0"+ + "\3\271\1\77\1\100\1\101\3\0\1\101\12\0\1\73"+ + "\1\77\45\0\1\272\1\72\1\73\2\0\3\272\1\77"+ + "\1\100\1\101\3\0\1\101\12\0\1\73\1\77\45\0"+ + "\1\273\1\72\1\73\2\0\3\273\1\77\1\100\1\101"+ + "\3\0\1\101\12\0\1\73\1\77\45\0\2\72\1\73"+ + "\2\0\3\72\1\77\1\100\1\101\3\0\1\101\12\0"+ + "\1\73\1\77\36\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[10560]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\33\1\6\11\4\1\1\11\4\1\1\11"+ + "\1\1\1\11\1\1\1\11\2\1\2\11\1\0\2\1"+ + "\1\11\1\0\4\1\1\0\34\1\1\0\1\11\2\1"+ + "\3\0\4\1\1\0\31\1\3\11\2\0\17\1\1\0"+ + "\3\1\1\0\2\1\1\0\2\1\1\11\6\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[187]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public RubyLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + private static final byte WORD = 4; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public RubyLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public RubyLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 178) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 7: + { return token(TokenType.OPERATOR, -PARAN); + } + case 25: break; + case 18: + { return token(TokenType.KEYWORD); + } + case 26: break; + case 4: + { return token(TokenType.NUMBER); + } + case 27: break; + case 5: + { return token(TokenType.OPERATOR); + } + case 28: break; + case 8: + { return token(TokenType.OPERATOR, CURLY); + } + case 29: break; + case 9: + { return token(TokenType.OPERATOR, -CURLY); + } + case 30: break; + case 23: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 3); + } + case 31: break; + case 21: + { return token(TokenType.KEYWORD, -WORD); + } + case 32: break; + case 22: + { yybegin(ML_STRING); + tokenStart = yychar; + tokenLength = 3; + } + case 33: break; + case 13: + { tokenLength += yylength(); + } + case 34: break; + case 14: + { yybegin(YYINITIAL); + } + case 35: break; + case 12: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 36: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 37: break; + case 24: + { return token(TokenType.TYPE); + } + case 38: break; + case 11: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 39: break; + case 19: + { return token(TokenType.KEYWORD, WORD); + } + case 40: break; + case 6: + { return token(TokenType.OPERATOR, PARAN); + } + case 41: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 42: break; + case 20: + { tokenLength += 2; + } + case 43: break; + case 17: + { return token(TokenType.TYPE2); + } + case 44: break; + case 16: + { tokenLength ++; + } + case 45: break; + case 10: + { return token(TokenType.OPERATOR, BRACKET); + } + case 46: break; + case 2: + { return token(TokenType.COMMENT); + } + case 47: break; + case 1: + { + } + case 48: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ScalaLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ScalaLexer.java new file mode 100644 index 000000000..732c74c6f --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/ScalaLexer.java @@ -0,0 +1,1223 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/scala.flex + */ +public final class ScalaLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING = 2; + public static final int JDOC_TAG = 8; + public static final int JDOC = 6; + public static final int YYINITIAL = 0; + public static final int CHARLITERAL = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\7\1\3\1\2\1\0\1\3\1\1\16\7\4\0\1\3\1\110"+ + "\1\24\1\0\1\6\1\110\1\112\1\25\1\76\1\77\1\5\1\114"+ + "\1\104\1\23\1\21\1\4\1\10\1\16\2\15\4\17\2\11\1\111"+ + "\1\104\1\107\1\105\1\106\1\104\1\115\1\56\1\61\1\62\1\14"+ + "\1\22\1\20\1\75\1\116\1\63\2\116\1\12\1\116\1\66\1\64"+ + "\1\67\1\116\1\73\1\55\1\71\1\116\1\65\1\74\1\13\2\116"+ + "\1\102\1\26\1\103\1\110\1\6\1\0\1\40\1\51\1\41\1\27"+ + "\1\30\1\31\1\43\1\44\1\32\1\60\1\42\1\46\1\33\1\45"+ + "\1\35\1\34\1\70\1\36\1\47\1\37\1\52\1\54\1\50\1\57"+ + "\1\53\1\72\1\100\1\113\1\101\1\104\41\7\2\0\4\6\4\0"+ + "\1\116\2\0\1\7\7\0\1\116\4\0\1\116\5\0\27\116\1\0"+ + "\37\116\1\0\u013f\116\31\0\162\116\4\0\14\116\16\0\5\116\11\0"+ + "\1\116\21\0\130\7\5\0\23\7\12\0\1\116\13\0\1\116\1\0"+ + "\3\116\1\0\1\116\1\0\24\116\1\0\54\116\1\0\46\116\1\0"+ + "\5\116\4\0\202\116\1\0\4\7\3\0\105\116\1\0\46\116\2\0"+ + "\2\116\6\0\20\116\41\0\46\116\2\0\1\116\7\0\47\116\11\0"+ + "\21\7\1\0\27\7\1\0\3\7\1\0\1\7\1\0\2\7\1\0"+ + "\1\7\13\0\33\116\5\0\3\116\15\0\4\7\14\0\6\7\13\0"+ + "\32\116\5\0\13\116\16\7\7\0\12\7\4\0\2\116\1\7\143\116"+ + "\1\0\1\116\10\7\1\0\6\7\2\116\2\7\1\0\4\7\2\116"+ + "\12\7\3\116\2\0\1\116\17\0\1\7\1\116\1\7\36\116\33\7"+ + "\2\0\3\116\60\0\46\116\13\7\1\116\u014f\0\3\7\66\116\2\0"+ + "\1\7\1\116\20\7\2\0\1\116\4\7\3\0\12\116\2\7\2\0"+ + "\12\7\21\0\3\7\1\0\10\116\2\0\2\116\2\0\26\116\1\0"+ + "\7\116\1\0\1\116\3\0\4\116\2\0\1\7\1\116\7\7\2\0"+ + "\2\7\2\0\3\7\11\0\1\7\4\0\2\116\1\0\3\116\2\7"+ + "\2\0\12\7\2\116\2\6\15\0\3\7\1\0\6\116\4\0\2\116"+ + "\2\0\26\116\1\0\7\116\1\0\2\116\1\0\2\116\1\0\2\116"+ + "\2\0\1\7\1\0\5\7\4\0\2\7\2\0\3\7\13\0\4\116"+ + "\1\0\1\116\7\0\14\7\3\116\14\0\3\7\1\0\11\116\1\0"+ + "\3\116\1\0\26\116\1\0\7\116\1\0\2\116\1\0\5\116\2\0"+ + "\1\7\1\116\10\7\1\0\3\7\1\0\3\7\2\0\1\116\17\0"+ + "\2\116\2\7\2\0\12\7\1\0\1\6\17\0\3\7\1\0\10\116"+ + "\2\0\2\116\2\0\26\116\1\0\7\116\1\0\2\116\1\0\5\116"+ + "\2\0\1\7\1\116\6\7\3\0\2\7\2\0\3\7\10\0\2\7"+ + "\4\0\2\116\1\0\3\116\4\0\12\7\1\0\1\116\20\0\1\7"+ + "\1\116\1\0\6\116\3\0\3\116\1\0\4\116\3\0\2\116\1\0"+ + "\1\116\1\0\2\116\3\0\2\116\3\0\3\116\3\0\10\116\1\0"+ + "\3\116\4\0\5\7\3\0\3\7\1\0\4\7\11\0\1\7\17\0"+ + "\11\7\11\0\1\6\7\0\3\7\1\0\10\116\1\0\3\116\1\0"+ + "\27\116\1\0\12\116\1\0\5\116\4\0\7\7\1\0\3\7\1\0"+ + "\4\7\7\0\2\7\11\0\2\116\4\0\12\7\22\0\2\7\1\0"+ + "\10\116\1\0\3\116\1\0\27\116\1\0\12\116\1\0\5\116\2\0"+ + "\1\7\1\116\7\7\1\0\3\7\1\0\4\7\7\0\2\7\7\0"+ + "\1\116\1\0\2\116\4\0\12\7\22\0\2\7\1\0\10\116\1\0"+ + "\3\116\1\0\27\116\1\0\20\116\4\0\6\7\2\0\3\7\1\0"+ + "\4\7\11\0\1\7\10\0\2\116\4\0\12\7\22\0\2\7\1\0"+ + "\22\116\3\0\30\116\1\0\11\116\1\0\1\116\2\0\7\116\3\0"+ + "\1\7\4\0\6\7\1\0\1\7\1\0\10\7\22\0\2\7\15\0"+ + "\60\116\1\7\2\116\7\7\4\0\1\6\7\116\10\7\1\0\12\7"+ + "\47\0\2\116\1\0\1\116\2\0\2\116\1\0\1\116\2\0\1\116"+ + "\6\0\4\116\1\0\7\116\1\0\3\116\1\0\1\116\1\0\1\116"+ + "\2\0\2\116\1\0\4\116\1\7\2\116\6\7\1\0\2\7\1\116"+ + "\2\0\5\116\1\0\1\116\1\0\6\7\2\0\12\7\2\0\2\116"+ + "\42\0\1\116\27\0\2\7\6\0\12\7\13\0\1\7\1\0\1\7"+ + "\1\0\1\7\4\0\2\7\10\116\1\0\42\116\6\0\24\7\1\0"+ + "\2\7\4\116\4\0\10\7\1\0\44\7\11\0\1\7\71\0\42\116"+ + "\1\0\5\116\1\0\2\116\1\0\7\7\3\0\4\7\6\0\12\7"+ + "\6\0\6\116\4\7\106\0\46\116\12\0\51\116\7\0\132\116\5\0"+ + "\104\116\5\0\122\116\6\0\7\116\1\0\77\116\1\0\1\116\1\0"+ + "\4\116\2\0\7\116\1\0\1\116\1\0\4\116\2\0\47\116\1\0"+ + "\1\116\1\0\4\116\2\0\37\116\1\0\1\116\1\0\4\116\2\0"+ + "\7\116\1\0\1\116\1\0\4\116\2\0\7\116\1\0\7\116\1\0"+ + "\27\116\1\0\37\116\1\0\1\116\1\0\4\116\2\0\7\116\1\0"+ + "\47\116\1\0\23\116\16\0\11\7\56\0\125\116\14\0\u026c\116\2\0"+ + "\10\116\12\0\32\116\5\0\113\116\3\0\3\6\17\0\15\116\1\0"+ + "\4\116\3\7\13\0\22\116\3\7\13\0\22\116\2\7\14\0\15\116"+ + "\1\0\3\116\1\0\2\7\14\0\64\116\40\7\3\0\1\116\3\0"+ + "\1\6\1\116\1\7\2\0\12\7\41\0\3\7\2\0\12\7\6\0"+ + "\130\116\10\0\51\116\1\7\126\0\35\116\3\0\14\7\4\0\14\7"+ + "\12\0\12\7\36\116\2\0\5\116\u038b\0\154\116\224\0\234\116\4\0"+ + "\132\116\6\0\26\116\2\0\6\116\2\0\46\116\2\0\6\116\2\0"+ + "\10\116\1\0\1\116\1\0\1\116\1\0\1\116\1\0\37\116\2\0"+ + "\65\116\1\0\7\116\1\0\1\116\3\0\3\116\1\0\7\116\3\0"+ + "\4\116\2\0\6\116\4\0\15\116\5\0\3\116\1\0\7\116\17\0"+ + "\4\7\32\0\5\7\20\0\2\6\23\0\1\6\13\0\4\7\6\0"+ + "\6\7\1\0\1\116\15\0\1\116\40\0\22\6\36\0\15\7\4\0"+ + "\1\7\3\0\6\7\27\0\1\116\4\0\1\116\2\0\12\116\1\0"+ + "\1\116\3\0\5\116\6\0\1\116\1\0\1\116\1\0\1\116\1\0"+ + "\4\116\1\0\3\116\1\0\7\116\3\0\3\116\5\0\5\116\26\0"+ + "\44\6\u0e81\0\2\116\1\6\31\0\11\6\6\7\1\0\5\116\2\0"+ + "\3\6\2\116\4\0\126\116\2\0\2\7\2\0\3\116\1\0\132\116"+ + "\1\6\4\116\5\0\50\116\4\0\136\116\21\0\30\116\70\0\20\116"+ + "\u0200\0\u19b6\116\112\0\u51a6\116\132\0\u048d\116\u0773\0\u2ba4\116\u215c\0\u012e\116"+ + "\2\0\73\116\225\0\7\116\14\0\5\116\5\0\1\116\1\7\12\116"+ + "\1\0\15\116\1\0\5\116\1\0\1\116\1\0\2\116\1\0\2\116"+ + "\1\0\154\116\41\0\u016b\116\22\0\100\116\2\0\66\116\50\0\14\116"+ + "\1\6\3\0\20\7\20\0\4\7\17\0\2\6\30\0\3\6\31\0"+ + "\1\6\6\0\5\116\1\0\207\116\2\0\1\7\4\0\1\6\13\0"+ + "\12\7\7\0\32\116\4\0\1\6\1\0\32\116\12\0\1\6\131\116"+ + "\3\0\6\116\2\0\6\116\2\0\6\116\2\0\3\116\3\0\2\6"+ + "\3\0\2\6\22\0\3\7\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\3\1\2\2\1\3\2\4\2\3\1\2\1\3"+ + "\1\2\1\5\1\6\36\3\1\7\1\10\1\11\1\12"+ + "\1\13\1\14\6\2\1\15\2\16\1\17\1\1\1\15"+ + "\1\1\2\20\1\21\2\22\1\15\1\23\1\0\3\4"+ + "\1\0\3\4\1\0\4\3\1\24\6\3\1\24\51\3"+ + "\1\2\1\25\2\15\1\26\1\15\2\23\1\0\1\27"+ + "\4\4\1\0\55\3\2\0\2\4\25\3\1\30\13\3"+ + "\2\4\1\31\1\3\1\24\17\3\2\4\5\3\1\24"+ + "\4\3\2\4\1\32\3\3\1\33\2\4\2\3\2\4"+ + "\3\3\2\4\2\3\1\0\1\4\1\0\1\4\1\0"+ + "\1\4\1\0\1\4\1\0\1\4\1\0\1\4\1\0"+ + "\1\4\1\0\5\4"; + + private static int [] zzUnpackAction() { + int [] result = new int[307]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\117\0\236\0\355\0\u013c\0\u018b\0\u01da\0\u0229"+ + "\0\u0278\0\u02c7\0\u0316\0\u0365\0\u03b4\0\u0403\0\u0452\0\u04a1"+ + "\0\u04f0\0\u053f\0\u018b\0\u018b\0\u058e\0\u05dd\0\u062c\0\u067b"+ + "\0\u06ca\0\u0719\0\u0768\0\u07b7\0\u0806\0\u0855\0\u08a4\0\u08f3"+ + "\0\u0942\0\u0991\0\u09e0\0\u0a2f\0\u0a7e\0\u0acd\0\u0b1c\0\u0b6b"+ + "\0\u0bba\0\u0c09\0\u0c58\0\u0ca7\0\u0cf6\0\u0d45\0\u0d94\0\u0de3"+ + "\0\u0e32\0\u0e81\0\u018b\0\u018b\0\u018b\0\u018b\0\u018b\0\u018b"+ + "\0\u018b\0\u0ed0\0\u0f1f\0\u0f6e\0\u0fbd\0\u100c\0\u105b\0\u10aa"+ + "\0\u018b\0\u018b\0\u10f9\0\u1148\0\u1197\0\u018b\0\u11e6\0\u018b"+ + "\0\u018b\0\u11e6\0\u1235\0\u1284\0\u12d3\0\u1322\0\u1371\0\u018b"+ + "\0\u13c0\0\u140f\0\u145e\0\u14ad\0\u14fc\0\u154b\0\u159a\0\u15e9"+ + "\0\u1638\0\u1687\0\u16d6\0\u1725\0\u1774\0\u17c3\0\u1812\0\u1861"+ + "\0\u0316\0\u18b0\0\u18ff\0\u194e\0\u199d\0\u19ec\0\u1a3b\0\u1a8a"+ + "\0\u1ad9\0\u1b28\0\u1b77\0\u1bc6\0\u1c15\0\u1c64\0\u1cb3\0\u1d02"+ + "\0\u1d51\0\u1da0\0\u1def\0\u1e3e\0\u1e8d\0\u1edc\0\u1f2b\0\u1f7a"+ + "\0\u1fc9\0\u2018\0\u2067\0\u20b6\0\u2105\0\u2154\0\u21a3\0\u21f2"+ + "\0\u2241\0\u2290\0\u22df\0\u232e\0\u237d\0\u23cc\0\u241b\0\u246a"+ + "\0\u24b9\0\u2508\0\u2557\0\u018b\0\u25a6\0\u25f5\0\u018b\0\u018b"+ + "\0\u2644\0\u018b\0\u2693\0\u26e2\0\u2731\0\u2780\0\u27cf\0\u281e"+ + "\0\u286d\0\u28bc\0\u290b\0\u295a\0\u29a9\0\u29f8\0\u2a47\0\u2a96"+ + "\0\u2ae5\0\u2b34\0\u2b83\0\u2bd2\0\u2c21\0\u2c70\0\u2cbf\0\u2d0e"+ + "\0\u2d5d\0\u2dac\0\u2dfb\0\u2e4a\0\u2e99\0\u2ee8\0\u2f37\0\u2f86"+ + "\0\u2fd5\0\u3024\0\u3073\0\u30c2\0\u3111\0\u3160\0\u31af\0\u31fe"+ + "\0\u324d\0\u329c\0\u32eb\0\u333a\0\u3389\0\u33d8\0\u3427\0\u3476"+ + "\0\u34c5\0\u3514\0\u3563\0\u35b2\0\u3601\0\u3650\0\u369f\0\u26e2"+ + "\0\u36ee\0\u373d\0\u378c\0\u37db\0\u382a\0\u3879\0\u38c8\0\u3917"+ + "\0\u3966\0\u39b5\0\u3a04\0\u3a53\0\u3aa2\0\u3af1\0\u3b40\0\u3b8f"+ + "\0\u3bde\0\u3c2d\0\u3c7c\0\u3ccb\0\u3d1a\0\u3d69\0\u3db8\0\u0316"+ + "\0\u3e07\0\u3e56\0\u3ea5\0\u3ef4\0\u3f43\0\u3f92\0\u3fe1\0\u4030"+ + "\0\u407f\0\u40ce\0\u411d\0\u416c\0\u41bb\0\u0316\0\u420a\0\u4259"+ + "\0\u42a8\0\u42f7\0\u4346\0\u4395\0\u43e4\0\u4433\0\u4482\0\u44d1"+ + "\0\u4520\0\u456f\0\u45be\0\u460d\0\u465c\0\u46ab\0\u46fa\0\u4749"+ + "\0\u4798\0\u47e7\0\u4836\0\u4885\0\u48d4\0\u4923\0\u4972\0\u49c1"+ + "\0\u4a10\0\u4a5f\0\u4aae\0\u4afd\0\u4b4c\0\u0316\0\u4b9b\0\u4bea"+ + "\0\u4c39\0\u0316\0\u4c88\0\u4cd7\0\u4d26\0\u4d75\0\u4dc4\0\u4e13"+ + "\0\u4e62\0\u4eb1\0\u4f00\0\u4f4f\0\u4f9e\0\u4fed\0\u503c\0\u508b"+ + "\0\u50da\0\u5129\0\u5178\0\u51c7\0\u5216\0\u5265\0\u52b4\0\u5303"+ + "\0\u5352\0\u53a1\0\u53f0\0\u543f\0\u548e\0\u54dd\0\u552c\0\u557b"+ + "\0\u55ca\0\u5619\0\u5668"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[307]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\6\1\7\1\6\1\10\1\11\1\12\1\13\1\6"+ + "\1\14\1\15\2\13\1\16\3\15\1\17\1\20\1\21"+ + "\1\22\1\23\1\24\1\6\1\25\1\26\1\27\1\30"+ + "\1\13\1\31\1\32\1\33\1\34\1\35\1\36\3\13"+ + "\1\37\1\40\1\41\1\42\1\43\1\44\1\45\1\46"+ + "\1\47\1\50\2\13\1\51\1\52\1\53\1\54\1\55"+ + "\1\56\1\57\1\13\1\60\1\13\1\61\1\62\1\13"+ + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\12"+ + "\1\72\1\73\1\12\1\71\1\74\1\75\1\76\1\6"+ + "\1\13\1\77\1\100\1\101\21\77\1\102\1\77\1\103"+ + "\70\77\1\104\1\100\1\101\22\104\1\102\1\105\70\104"+ + "\5\106\1\107\107\106\1\110\1\106\5\111\1\112\4\111"+ + "\3\113\3\111\1\113\1\111\1\113\4\111\47\113\20\111"+ + "\1\113\121\0\1\6\117\0\1\10\117\0\1\114\1\115"+ + "\77\0\1\71\116\0\1\71\17\0\13\13\1\0\1\13"+ + "\4\0\47\13\20\0\1\13\10\0\1\116\1\117\1\120"+ + "\1\121\1\120\1\122\1\123\1\122\1\120\1\124\1\125"+ + "\4\0\1\120\1\125\1\120\14\0\1\120\10\0\1\121"+ + "\47\0\2\15\1\120\1\0\1\120\3\15\1\120\1\124"+ + "\1\125\4\0\1\120\1\125\1\120\14\0\1\120\56\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\126\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\127"+ + "\27\13\20\0\1\13\10\0\2\124\3\0\3\124\105\0"+ + "\13\13\1\0\1\13\4\0\44\13\1\130\2\13\20\0"+ + "\1\13\23\0\1\71\61\0\1\71\17\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\131\4\13\1\132\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\133"+ + "\10\13\1\134\16\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\135\2\13\1\136\2\13\1\137"+ + "\5\13\1\140\27\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\2\13\1\141\1\13\1\142\11\13\1\143"+ + "\30\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\144\1\13\1\145\35\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\22\13\1\146\2\13\1\147"+ + "\21\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\13\1\150\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\151\5\13\1\152\6\13\1\153"+ + "\22\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\22\13\1\154\24\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\155\3\13\1\156\31\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\23\13\1\157"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\160\40\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\161\13\13\1\162\5\13\1\163"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\164\11\13\1\165\31\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\166\15\13\1\167"+ + "\22\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\170\30\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\3\13\1\171\43\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\11\13\1\172\35\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\13\1\173"+ + "\6\13\1\174\4\13\1\175\31\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\176\37\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\6\13\1\177"+ + "\15\13\1\200\22\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\201\6\13\1\202\1\13\1\203"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\204\30\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\22\13\1\146\24\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\205\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\23\13\1\206"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\207\35\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\15\13\1\210\31\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\23\13\1\211\23\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\27\13\1\212"+ + "\17\13\20\0\1\13\105\0\1\71\1\213\115\0\1\71"+ + "\1\0\1\12\114\0\1\71\4\0\1\71\111\0\1\71"+ + "\5\0\1\71\110\0\1\71\6\0\1\71\2\0\1\77"+ + "\2\0\21\77\1\0\1\77\1\0\70\77\2\0\1\101"+ + "\114\0\2\214\1\0\5\214\1\215\4\214\2\215\1\216"+ + "\77\214\1\104\2\0\22\104\2\0\70\104\2\214\1\0"+ + "\114\214\4\0\1\217\124\0\3\113\3\0\1\113\1\0"+ + "\1\113\4\0\47\113\13\0\1\220\4\0\1\113\1\114"+ + "\1\221\1\222\114\114\5\223\1\224\111\223\10\0\1\116"+ + "\1\117\1\120\1\0\1\120\1\122\1\123\1\122\1\120"+ + "\1\124\1\125\4\0\1\120\1\125\1\120\14\0\1\120"+ + "\60\0\2\117\2\0\1\120\3\117\1\120\1\124\1\125"+ + "\4\0\1\120\1\125\1\120\75\0\1\225\1\226\2\0"+ + "\5\226\1\0\1\226\4\0\3\226\6\0\2\226\7\0"+ + "\1\226\4\0\1\226\2\0\2\226\44\0\1\227\1\117"+ + "\1\120\1\0\1\120\3\227\1\120\1\124\1\125\4\0"+ + "\1\120\1\125\1\120\14\0\1\120\60\0\1\122\1\117"+ + "\1\120\1\0\1\120\3\122\1\120\1\124\1\125\4\0"+ + "\1\120\1\125\1\120\14\0\1\120\60\0\2\124\2\0"+ + "\1\120\3\124\1\120\1\0\1\125\4\0\1\120\1\125"+ + "\1\120\75\0\2\230\3\0\3\230\3\0\1\231\70\0"+ + "\1\231\10\0\13\13\1\0\1\13\4\0\23\13\1\232"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\6\13\1\233\40\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\44\13\1\234\2\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\2\13\1\141\44\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\23\13\1\235"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\20\13\1\236\26\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\237\36\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\16\13\1\240\30\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\7\13\1\141"+ + "\37\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\17\13\1\133\27\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\6\13\1\241\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\5\13\1\162\41\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\141"+ + "\36\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\3\13\1\242\2\13\1\243\40\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\12\13\1\244\34\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\31\13\1\245"+ + "\15\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\13\1\246\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\10\13\1\247\36\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\23\13\1\236\1\141\22\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\13"+ + "\1\250\1\13\1\251\3\13\1\252\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\236\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\20\13"+ + "\1\253\26\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\254\36\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\136\35\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\17\13\1\255\27\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\16\13"+ + "\1\256\30\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\257\35\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\260\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\5\13\1\261\41\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\10\13"+ + "\1\262\36\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\3\13\1\263\43\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\264\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\10\13\1\236\36\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\3\13"+ + "\1\143\43\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\1\13\1\265\45\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\141\7\13\1\141\27\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\7\13"+ + "\1\266\37\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\7\13\1\267\37\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\6\13\1\270\40\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\271\37\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\272\40\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\10\13\1\273\36\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\4\13\1\274\42\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\275\35\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\6\13"+ + "\1\276\2\13\1\277\35\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\300\36\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\301\43\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\4\13"+ + "\1\302\42\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\12\13\1\303\34\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\7\13\1\304\37\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\16\13\1\305\30\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\44\13"+ + "\1\306\2\13\20\0\1\13\105\0\1\71\1\12\20\0"+ + "\1\216\4\0\3\216\107\0\1\220\4\0\3\220\101\0"+ + "\1\222\114\0\5\223\1\307\111\223\4\0\1\222\1\310"+ + "\121\0\1\225\1\226\1\120\1\0\5\226\1\0\1\226"+ + "\4\0\3\226\6\0\2\226\4\0\1\120\2\0\1\226"+ + "\4\0\1\226\2\0\2\226\44\0\2\311\1\120\1\0"+ + "\5\311\1\0\1\311\4\0\3\311\6\0\2\311\4\0"+ + "\1\120\2\0\1\311\4\0\1\311\2\0\2\311\44\0"+ + "\1\312\1\117\1\120\1\0\1\120\3\312\1\120\1\124"+ + "\1\125\4\0\1\120\1\125\1\120\14\0\1\120\60\0"+ + "\2\230\2\0\1\120\3\230\1\120\6\0\1\120\1\0"+ + "\1\120\75\0\2\230\3\0\3\230\105\0\13\13\1\0"+ + "\1\13\4\0\22\13\1\313\24\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\11\13\1\314\35\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\35\13\1\315"+ + "\11\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\22\13\1\263\24\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\141\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\13\1\316\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\11\13\1\317"+ + "\35\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\11\13\1\143\35\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\16\13\1\320\6\13\1\321\21\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\322"+ + "\36\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\13\13\1\323\33\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\324\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\325\37\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\23\13\1\326"+ + "\23\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\141\30\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\20\13\1\141\26\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\6\13\1\327\40\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\10\13\1\330"+ + "\36\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\12\13\1\262\34\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\17\13\1\141\27\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\14\13\1\141\32\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\331"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\143\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\136\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\15\13\1\141\31\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\236"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\17\13\1\332\27\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\17\13\1\333\27\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\3\13\1\334\43\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\3\13\1\335"+ + "\43\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\314\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\336\35\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\17\13\1\337\27\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\13\1\340"+ + "\45\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\5\13\1\341\41\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\342\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\16\13\1\343\30\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\20\13\1\344"+ + "\26\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\1\13\1\345\45\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\340\46\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\22\13\1\346\24\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\13\13\1\347\33\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\13"+ + "\1\350\4\13\1\351\40\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\16\13\1\352\30\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\37\13\1\353\7\13"+ + "\20\0\1\13\4\223\1\222\1\307\111\223\10\0\2\354"+ + "\1\120\1\0\5\354\1\0\1\354\4\0\3\354\6\0"+ + "\2\354\4\0\1\120\2\0\1\354\4\0\1\354\2\0"+ + "\2\354\44\0\1\355\1\117\1\120\1\0\1\120\3\355"+ + "\1\120\1\124\1\125\4\0\1\120\1\125\1\120\14\0"+ + "\1\120\56\0\13\13\1\0\1\13\4\0\17\13\1\273"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\340\36\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\44\13\1\356\2\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\16\13\1\357\30\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\360"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\361\36\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\11\13\1\167\35\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\13\1\362\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\11\13\1\363"+ + "\35\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\12\13\1\314\34\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\7\13\1\364\37\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\7\13\1\250\37\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\21\13\1\141"+ + "\25\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\7\13\1\365\37\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\13\1\333\45\13\20\0\1\13\6\0"+ + "\13\13\1\0\1\13\4\0\1\13\1\366\45\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\1\141\46\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\367\35\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\370\30\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\24\13\1\141\22\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\13\1\371\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\372\35\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\11\13\1\373\14\13\1\374\20\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\1\13\1\352\45\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\20\13"+ + "\1\340\26\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\14\13\1\346\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\13\1\375\45\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\376\35\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\301\35\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\21\13\1\352\25\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\11\13\1\232\35\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\34\13\1\377\12\13"+ + "\20\0\1\13\10\0\2\u0100\1\120\1\0\5\u0100\1\0"+ + "\1\u0100\4\0\3\u0100\6\0\2\u0100\4\0\1\120\2\0"+ + "\1\u0100\4\0\1\u0100\2\0\2\u0100\44\0\1\u0101\1\117"+ + "\1\120\1\0\1\120\3\u0101\1\120\1\124\1\125\4\0"+ + "\1\120\1\125\1\120\14\0\1\120\56\0\13\13\1\0"+ + "\1\13\4\0\1\251\46\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\17\13\1\336\27\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\17\13\1\u0102\27\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\12\13"+ + "\1\u0103\34\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\14\13\1\236\32\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\3\13\1\u0104\43\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u0105\35\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\11\13"+ + "\1\250\35\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\17\13\1\u0106\27\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\14\13\1\u0107\32\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\11\13\1\u0108\35\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\7\13"+ + "\1\352\37\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\12\13\1\u0109\34\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\1\13\1\u010a\45\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\7\13\1\340\37\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\14\13"+ + "\1\273\32\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\37\13\1\u010b\7\13\20\0\1\13\10\0\2\u010c"+ + "\1\120\1\0\5\u010c\1\0\1\u010c\4\0\3\u010c\6\0"+ + "\2\u010c\4\0\1\120\2\0\1\u010c\4\0\1\u010c\2\0"+ + "\2\u010c\44\0\1\u010d\1\117\1\120\1\0\1\120\3\u010d"+ + "\1\120\1\124\1\125\4\0\1\120\1\125\1\120\14\0"+ + "\1\120\56\0\13\13\1\0\1\13\4\0\16\13\1\u010e"+ + "\30\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\10\13\1\331\36\13\20\0\1\13\6\0\13\13\1\0"+ + "\1\13\4\0\1\236\46\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\12\13\1\143\34\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\3\13\1\u010f\43\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\32\13"+ + "\1\u0110\14\13\20\0\1\13\6\0\13\13\1\0\1\13"+ + "\4\0\16\13\1\340\30\13\20\0\1\13\6\0\13\13"+ + "\1\0\1\13\4\0\10\13\1\346\36\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\41\13\1\u0111\5\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\46\13"+ + "\1\u0112\20\0\1\13\10\0\2\u0113\1\120\1\0\5\u0113"+ + "\1\0\1\u0113\4\0\3\u0113\6\0\2\u0113\4\0\1\120"+ + "\2\0\1\u0113\4\0\1\u0113\2\0\2\u0113\44\0\1\u0114"+ + "\1\117\1\120\1\0\1\120\3\u0114\1\120\1\124\1\125"+ + "\4\0\1\120\1\125\1\120\14\0\1\120\56\0\13\13"+ + "\1\0\1\13\4\0\43\13\1\352\3\13\20\0\1\13"+ + "\6\0\13\13\1\0\1\13\4\0\23\13\1\u0115\23\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\23\13"+ + "\1\u0116\23\13\20\0\1\13\10\0\2\u0117\1\120\1\0"+ + "\5\u0117\1\0\1\u0117\4\0\3\u0117\6\0\2\u0117\4\0"+ + "\1\120\2\0\1\u0117\4\0\1\u0117\2\0\2\u0117\44\0"+ + "\1\u0118\1\117\1\120\1\0\1\120\3\u0118\1\120\1\124"+ + "\1\125\4\0\1\120\1\125\1\120\14\0\1\120\56\0"+ + "\13\13\1\0\1\13\4\0\2\13\1\u0119\1\u011a\43\13"+ + "\20\0\1\13\6\0\13\13\1\0\1\13\4\0\1\13"+ + "\1\u011b\45\13\20\0\1\13\10\0\2\u011c\1\120\1\0"+ + "\5\u011c\1\0\1\u011c\4\0\3\u011c\6\0\2\u011c\4\0"+ + "\1\120\2\0\1\u011c\4\0\1\u011c\2\0\2\u011c\44\0"+ + "\1\u011d\1\117\1\120\1\0\1\120\3\u011d\1\120\1\124"+ + "\1\125\4\0\1\120\1\125\1\120\14\0\1\120\56\0"+ + "\13\13\1\0\1\13\4\0\2\13\1\346\44\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\17\13\1\u011e"+ + "\27\13\20\0\1\13\6\0\13\13\1\0\1\13\4\0"+ + "\16\13\1\u011f\30\13\20\0\1\13\10\0\2\u0120\1\120"+ + "\1\0\5\u0120\1\0\1\u0120\4\0\3\u0120\6\0\2\u0120"+ + "\4\0\1\120\2\0\1\u0120\4\0\1\u0120\2\0\2\u0120"+ + "\44\0\1\u0121\1\117\1\120\1\0\1\120\3\u0121\1\120"+ + "\1\124\1\125\4\0\1\120\1\125\1\120\14\0\1\120"+ + "\56\0\13\13\1\0\1\13\4\0\1\346\46\13\20\0"+ + "\1\13\6\0\13\13\1\0\1\13\4\0\12\13\1\273"+ + "\34\13\20\0\1\13\10\0\2\u0122\1\120\1\0\5\u0122"+ + "\1\0\1\u0122\4\0\3\u0122\6\0\2\u0122\4\0\1\120"+ + "\2\0\1\u0122\4\0\1\u0122\2\0\2\u0122\44\0\1\u0123"+ + "\1\117\1\120\1\0\1\120\3\u0123\1\120\1\124\1\125"+ + "\4\0\1\120\1\125\1\120\14\0\1\120\60\0\2\u0124"+ + "\1\120\1\0\5\u0124\1\0\1\u0124\4\0\3\u0124\6\0"+ + "\2\u0124\4\0\1\120\2\0\1\u0124\4\0\1\u0124\2\0"+ + "\2\u0124\44\0\1\u0125\1\117\1\120\1\0\1\120\3\u0125"+ + "\1\120\1\124\1\125\4\0\1\120\1\125\1\120\14\0"+ + "\1\120\60\0\2\u0126\1\120\1\0\5\u0126\1\0\1\u0126"+ + "\4\0\3\u0126\6\0\2\u0126\4\0\1\120\2\0\1\u0126"+ + "\4\0\1\u0126\2\0\2\u0126\44\0\1\u0127\1\117\1\120"+ + "\1\0\1\120\3\u0127\1\120\1\124\1\125\4\0\1\120"+ + "\1\125\1\120\14\0\1\120\60\0\2\u0128\1\120\1\0"+ + "\5\u0128\1\0\1\u0128\4\0\3\u0128\6\0\2\u0128\4\0"+ + "\1\120\2\0\1\u0128\4\0\1\u0128\2\0\2\u0128\44\0"+ + "\1\u0129\1\117\1\120\1\0\1\120\3\u0129\1\120\1\124"+ + "\1\125\4\0\1\120\1\125\1\120\14\0\1\120\60\0"+ + "\2\u012a\1\120\1\0\5\u012a\1\0\1\u012a\4\0\3\u012a"+ + "\6\0\2\u012a\4\0\1\120\2\0\1\u012a\4\0\1\u012a"+ + "\2\0\2\u012a\44\0\1\u012b\1\117\1\120\1\0\1\120"+ + "\3\u012b\1\120\1\124\1\125\4\0\1\120\1\125\1\120"+ + "\14\0\1\120\60\0\2\u012c\1\120\1\0\5\u012c\1\0"+ + "\1\u012c\4\0\3\u012c\6\0\2\u012c\4\0\1\120\2\0"+ + "\1\u012c\4\0\1\u012c\2\0\2\u012c\44\0\1\u012d\1\117"+ + "\1\120\1\0\1\120\3\u012d\1\120\1\124\1\125\4\0"+ + "\1\120\1\125\1\120\14\0\1\120\60\0\2\u012e\1\120"+ + "\1\0\5\u012e\1\0\1\u012e\4\0\3\u012e\6\0\2\u012e"+ + "\4\0\1\120\2\0\1\u012e\4\0\1\u012e\2\0\2\u012e"+ + "\44\0\1\u012f\1\117\1\120\1\0\1\120\3\u012f\1\120"+ + "\1\124\1\125\4\0\1\120\1\125\1\120\14\0\1\120"+ + "\62\0\1\120\33\0\1\120\60\0\1\u0130\1\117\1\120"+ + "\1\0\1\120\3\u0130\1\120\1\124\1\125\4\0\1\120"+ + "\1\125\1\120\14\0\1\120\60\0\1\u0131\1\117\1\120"+ + "\1\0\1\120\3\u0131\1\120\1\124\1\125\4\0\1\120"+ + "\1\125\1\120\14\0\1\120\60\0\1\u0132\1\117\1\120"+ + "\1\0\1\120\3\u0132\1\120\1\124\1\125\4\0\1\120"+ + "\1\125\1\120\14\0\1\120\60\0\1\u0133\1\117\1\120"+ + "\1\0\1\120\3\u0133\1\120\1\124\1\125\4\0\1\120"+ + "\1\125\1\120\14\0\1\120\60\0\2\117\1\120\1\0"+ + "\1\120\3\117\1\120\1\124\1\125\4\0\1\120\1\125"+ + "\1\120\14\0\1\120\50\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[22199]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\14\1\2\11\36\1\7\11\7\1\2\11"+ + "\3\1\1\11\1\1\2\11\3\1\1\0\2\1\1\11"+ + "\1\0\3\1\1\0\66\1\1\11\2\1\2\11\1\1"+ + "\1\11\1\0\5\1\1\0\55\1\2\0\127\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\1\0\1\1\1\0"+ + "\1\1\1\0\1\1\1\0\1\1\1\0\5\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[307]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public ScalaLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public ScalaLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public ScalaLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1830) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { return token(TokenType.OPERATOR, -PARAN); + } + case 28: break; + case 20: + { return token(TokenType.KEYWORD); + } + case 29: break; + case 4: + { return token(TokenType.NUMBER); + } + case 30: break; + case 18: + { yybegin(JDOC); + // length also includes the trailing quote + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT2, start, len); + } + case 31: break; + case 22: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT, tokenStart, tokenLength + 2); + } + case 32: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 33: break; + case 9: + { return token(TokenType.OPERATOR, CURLY); + } + case 34: break; + case 10: + { return token(TokenType.OPERATOR, -CURLY); + } + case 35: break; + case 17: + { yybegin(JDOC_TAG); + int start = tokenStart; + tokenStart = yychar; + int len = tokenLength; + tokenLength = 1; + return token(TokenType.COMMENT, start, len); + } + case 36: break; + case 13: + { tokenLength += yylength(); + } + case 37: break; + case 14: + { yybegin(YYINITIAL); + } + case 38: break; + case 6: + { yybegin(CHARLITERAL); + tokenStart = yychar; + tokenLength = 1; + } + case 39: break; + case 23: + { yybegin(JDOC); + tokenStart = yychar; + tokenLength = 3; + } + case 40: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 41: break; + case 24: + { return token(TokenType.TYPE); + } + case 42: break; + case 27: + { return token(TokenType.WARNING); + } + case 43: break; + case 12: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 44: break; + case 7: + { return token(TokenType.OPERATOR, PARAN); + } + case 45: break; + case 26: + { return token(TokenType.KEYWORD2); + } + case 46: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 47: break; + case 21: + { tokenLength += 2; + } + case 48: break; + case 25: + { return token(TokenType.ERROR); + } + case 49: break; + case 16: + { tokenLength ++; + } + case 50: break; + case 11: + { return token(TokenType.OPERATOR, BRACKET); + } + case 51: break; + case 19: + { return token(TokenType.COMMENT); + } + case 52: break; + case 5: + { yybegin(STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 53: break; + case 1: + { + } + case 54: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/SqlLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/SqlLexer.java new file mode 100644 index 000000000..247543305 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/SqlLexer.java @@ -0,0 +1,1336 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/sql.flex + */ +public final class SqlLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int DQ_STRING = 2; + public static final int SQ_STRING = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\10\1\3\1\2\1\0\1\3\1\1\16\10\4\0\1\27\1\56"+ + "\1\17\1\0\1\7\2\0\1\20\1\56\1\56\1\5\1\16\1\56"+ + "\1\6\1\14\1\4\1\11\1\12\1\55\1\12\1\51\3\12\1\51"+ + "\1\12\1\56\1\56\1\56\1\56\1\56\1\56\1\56\1\22\1\43"+ + "\1\33\1\23\1\15\1\13\1\44\1\45\1\42\1\52\1\47\1\24"+ + "\1\41\1\34\1\25\1\46\1\54\1\30\1\32\1\35\1\40\1\31"+ + "\1\26\1\50\1\36\1\37\1\56\1\21\1\56\1\0\1\53\1\0"+ + "\1\22\1\43\1\33\1\23\1\15\1\13\1\44\1\45\1\42\1\52"+ + "\1\47\1\24\1\41\1\34\1\25\1\46\1\54\1\30\1\32\1\35"+ + "\1\40\1\31\1\26\1\50\1\36\1\37\1\56\1\0\1\56\1\56"+ + "\41\10\2\0\4\7\4\0\1\7\2\0\1\10\7\0\1\7\4\0"+ + "\1\7\5\0\27\7\1\0\37\7\1\0\u013f\7\31\0\162\7\4\0"+ + "\14\7\16\0\5\7\11\0\1\7\21\0\130\10\5\0\23\10\12\0"+ + "\1\7\13\0\1\7\1\0\3\7\1\0\1\7\1\0\24\7\1\0"+ + "\54\7\1\0\46\7\1\0\5\7\4\0\202\7\1\0\4\10\3\0"+ + "\105\7\1\0\46\7\2\0\2\7\6\0\20\7\41\0\46\7\2\0"+ + "\1\7\7\0\47\7\11\0\21\10\1\0\27\10\1\0\3\10\1\0"+ + "\1\10\1\0\2\10\1\0\1\10\13\0\33\7\5\0\3\7\15\0"+ + "\4\10\14\0\6\10\13\0\32\7\5\0\13\7\16\10\7\0\12\10"+ + "\4\0\2\7\1\10\143\7\1\0\1\7\10\10\1\0\6\10\2\7"+ + "\2\10\1\0\4\10\2\7\12\10\3\7\2\0\1\7\17\0\1\10"+ + "\1\7\1\10\36\7\33\10\2\0\3\7\60\0\46\7\13\10\1\7"+ + "\u014f\0\3\10\66\7\2\0\1\10\1\7\20\10\2\0\1\7\4\10"+ + "\3\0\12\7\2\10\2\0\12\10\21\0\3\10\1\0\10\7\2\0"+ + "\2\7\2\0\26\7\1\0\7\7\1\0\1\7\3\0\4\7\2\0"+ + "\1\10\1\7\7\10\2\0\2\10\2\0\3\10\11\0\1\10\4\0"+ + "\2\7\1\0\3\7\2\10\2\0\12\10\4\7\15\0\3\10\1\0"+ + "\6\7\4\0\2\7\2\0\26\7\1\0\7\7\1\0\2\7\1\0"+ + "\2\7\1\0\2\7\2\0\1\10\1\0\5\10\4\0\2\10\2\0"+ + "\3\10\13\0\4\7\1\0\1\7\7\0\14\10\3\7\14\0\3\10"+ + "\1\0\11\7\1\0\3\7\1\0\26\7\1\0\7\7\1\0\2\7"+ + "\1\0\5\7\2\0\1\10\1\7\10\10\1\0\3\10\1\0\3\10"+ + "\2\0\1\7\17\0\2\7\2\10\2\0\12\10\1\0\1\7\17\0"+ + "\3\10\1\0\10\7\2\0\2\7\2\0\26\7\1\0\7\7\1\0"+ + "\2\7\1\0\5\7\2\0\1\10\1\7\6\10\3\0\2\10\2\0"+ + "\3\10\10\0\2\10\4\0\2\7\1\0\3\7\4\0\12\10\1\0"+ + "\1\7\20\0\1\10\1\7\1\0\6\7\3\0\3\7\1\0\4\7"+ + "\3\0\2\7\1\0\1\7\1\0\2\7\3\0\2\7\3\0\3\7"+ + "\3\0\10\7\1\0\3\7\4\0\5\10\3\0\3\10\1\0\4\10"+ + "\11\0\1\10\17\0\11\10\11\0\1\7\7\0\3\10\1\0\10\7"+ + "\1\0\3\7\1\0\27\7\1\0\12\7\1\0\5\7\4\0\7\10"+ + "\1\0\3\10\1\0\4\10\7\0\2\10\11\0\2\7\4\0\12\10"+ + "\22\0\2\10\1\0\10\7\1\0\3\7\1\0\27\7\1\0\12\7"+ + "\1\0\5\7\2\0\1\10\1\7\7\10\1\0\3\10\1\0\4\10"+ + "\7\0\2\10\7\0\1\7\1\0\2\7\4\0\12\10\22\0\2\10"+ + "\1\0\10\7\1\0\3\7\1\0\27\7\1\0\20\7\4\0\6\10"+ + "\2\0\3\10\1\0\4\10\11\0\1\10\10\0\2\7\4\0\12\10"+ + "\22\0\2\10\1\0\22\7\3\0\30\7\1\0\11\7\1\0\1\7"+ + "\2\0\7\7\3\0\1\10\4\0\6\10\1\0\1\10\1\0\10\10"+ + "\22\0\2\10\15\0\60\7\1\10\2\7\7\10\4\0\10\7\10\10"+ + "\1\0\12\10\47\0\2\7\1\0\1\7\2\0\2\7\1\0\1\7"+ + "\2\0\1\7\6\0\4\7\1\0\7\7\1\0\3\7\1\0\1\7"+ + "\1\0\1\7\2\0\2\7\1\0\4\7\1\10\2\7\6\10\1\0"+ + "\2\10\1\7\2\0\5\7\1\0\1\7\1\0\6\10\2\0\12\10"+ + "\2\0\2\7\42\0\1\7\27\0\2\10\6\0\12\10\13\0\1\10"+ + "\1\0\1\10\1\0\1\10\4\0\2\10\10\7\1\0\42\7\6\0"+ + "\24\10\1\0\2\10\4\7\4\0\10\10\1\0\44\10\11\0\1\10"+ + "\71\0\42\7\1\0\5\7\1\0\2\7\1\0\7\10\3\0\4\10"+ + "\6\0\12\10\6\0\6\7\4\10\106\0\46\7\12\0\51\7\7\0"+ + "\132\7\5\0\104\7\5\0\122\7\6\0\7\7\1\0\77\7\1\0"+ + "\1\7\1\0\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0"+ + "\47\7\1\0\1\7\1\0\4\7\2\0\37\7\1\0\1\7\1\0"+ + "\4\7\2\0\7\7\1\0\1\7\1\0\4\7\2\0\7\7\1\0"+ + "\7\7\1\0\27\7\1\0\37\7\1\0\1\7\1\0\4\7\2\0"+ + "\7\7\1\0\47\7\1\0\23\7\16\0\11\10\56\0\125\7\14\0"+ + "\u026c\7\2\0\10\7\12\0\32\7\5\0\113\7\3\0\3\7\17\0"+ + "\15\7\1\0\4\7\3\10\13\0\22\7\3\10\13\0\22\7\2\10"+ + "\14\0\15\7\1\0\3\7\1\0\2\10\14\0\64\7\40\10\3\0"+ + "\1\7\3\0\2\7\1\10\2\0\12\10\41\0\3\10\2\0\12\10"+ + "\6\0\130\7\10\0\51\7\1\10\126\0\35\7\3\0\14\10\4\0"+ + "\14\10\12\0\12\10\36\7\2\0\5\7\u038b\0\154\7\224\0\234\7"+ + "\4\0\132\7\6\0\26\7\2\0\6\7\2\0\46\7\2\0\6\7"+ + "\2\0\10\7\1\0\1\7\1\0\1\7\1\0\1\7\1\0\37\7"+ + "\2\0\65\7\1\0\7\7\1\0\1\7\3\0\3\7\1\0\7\7"+ + "\3\0\4\7\2\0\6\7\4\0\15\7\5\0\3\7\1\0\7\7"+ + "\17\0\4\10\32\0\5\10\20\0\2\7\23\0\1\7\13\0\4\10"+ + "\6\0\6\10\1\0\1\7\15\0\1\7\40\0\22\7\36\0\15\10"+ + "\4\0\1\10\3\0\6\10\27\0\1\7\4\0\1\7\2\0\12\7"+ + "\1\0\1\7\3\0\5\7\6\0\1\7\1\0\1\7\1\0\1\7"+ + "\1\0\4\7\1\0\3\7\1\0\7\7\3\0\3\7\5\0\5\7"+ + "\26\0\44\7\u0e81\0\3\7\31\0\11\7\6\10\1\0\5\7\2\0"+ + "\5\7\4\0\126\7\2\0\2\10\2\0\3\7\1\0\137\7\5\0"+ + "\50\7\4\0\136\7\21\0\30\7\70\0\20\7\u0200\0\u19b6\7\112\0"+ + "\u51a6\7\132\0\u048d\7\u0773\0\u2ba4\7\u215c\0\u012e\7\2\0\73\7\225\0"+ + "\7\7\14\0\5\7\5\0\1\7\1\10\12\7\1\0\15\7\1\0"+ + "\5\7\1\0\1\7\1\0\2\7\1\0\2\7\1\0\154\7\41\0"+ + "\u016b\7\22\0\100\7\2\0\66\7\50\0\15\7\3\0\20\10\20\0"+ + "\4\10\17\0\2\7\30\0\3\7\31\0\1\7\6\0\5\7\1\0"+ + "\207\7\2\0\1\10\4\0\1\7\13\0\12\10\7\0\32\7\4\0"+ + "\1\7\1\0\32\7\12\0\132\7\3\0\6\7\2\0\6\7\2\0"+ + "\6\7\2\0\3\7\3\0\2\7\3\0\2\7\22\0\3\10\4\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\1\1\1\2\2\1\1\3\2\4\1\3\1\5"+ + "\1\3\1\6\1\7\26\3\1\5\1\10\2\11\1\12"+ + "\1\1\1\10\1\12\1\0\1\13\1\0\1\4\2\0"+ + "\15\3\1\14\13\3\2\14\40\3\1\14\13\3\2\14"+ + "\20\3\1\15\2\0\2\13\2\0\2\3\1\14\12\3"+ + "\1\14\6\3\1\14\16\3\1\14\37\3\1\14\25\3"+ + "\1\14\7\3\1\14\1\0\4\3\1\14\22\3\1\14"+ + "\1\0\1\13\4\3\1\14\12\3\1\14\51\3\1\14"+ + "\17\3\1\0\16\3\1\14\43\3\1\14\5\3\1\0"+ + "\13\3\1\0\5\3\1\14\12\3\1\0\5\3\1\0"+ + "\5\3\1\14\2\3\1\0\1\3\1\0\1\14\1\3"+ + "\1\0\1\3\1\14\1\3\1\0\1\3\3\0\1\3"+ + "\16\0\1\14\10\0"; + + private static int [] zzUnpackAction() { + int [] result = new int[484]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\57\0\136\0\215\0\274\0\353\0\u011a\0\u0149"+ + "\0\u0178\0\u01a7\0\u01d6\0\u0205\0\u0234\0\215\0\215\0\u0263"+ + "\0\u0292\0\u02c1\0\u02f0\0\u031f\0\u034e\0\u037d\0\u03ac\0\u03db"+ + "\0\u040a\0\u0439\0\u0468\0\u0497\0\u04c6\0\u04f5\0\u0524\0\u0553"+ + "\0\u0582\0\u05b1\0\u05e0\0\u060f\0\u063e\0\215\0\u066d\0\u069c"+ + "\0\215\0\u06cb\0\u06fa\0\u0729\0\u0758\0\u0787\0\u07b6\0\u0178"+ + "\0\215\0\u07e5\0\u0814\0\u0843\0\u0872\0\u08a1\0\u08d0\0\u08ff"+ + "\0\u092e\0\u095d\0\u098c\0\u09bb\0\u09ea\0\u0a19\0\u0a48\0\u0a77"+ + "\0\u0aa6\0\u0ad5\0\u0b04\0\u0b33\0\u0b62\0\u0b91\0\u0bc0\0\u0bef"+ + "\0\u0c1e\0\u0c4d\0\u0c7c\0\u0cab\0\u0cda\0\u0149\0\u0d09\0\u0d38"+ + "\0\u0d67\0\u0d96\0\u0dc5\0\u0df4\0\u0e23\0\u0e52\0\u0e81\0\u0eb0"+ + "\0\u0edf\0\u0f0e\0\u0f3d\0\u0f6c\0\u0f9b\0\u0fca\0\u0ff9\0\u1028"+ + "\0\u1057\0\u1086\0\u10b5\0\u10e4\0\u1113\0\u1142\0\u1171\0\u11a0"+ + "\0\u11cf\0\u11fe\0\u122d\0\u125c\0\u128b\0\u12ba\0\u12e9\0\u1318"+ + "\0\u1347\0\u1376\0\u13a5\0\u13d4\0\u1403\0\u1432\0\u1461\0\u1490"+ + "\0\u14bf\0\u14ee\0\u151d\0\u154c\0\u157b\0\u15aa\0\u15d9\0\u1608"+ + "\0\u1637\0\u1666\0\u1695\0\u16c4\0\u16f3\0\u1722\0\u1751\0\u1780"+ + "\0\u17af\0\u17de\0\u180d\0\u183c\0\215\0\u186b\0\u189a\0\u18c9"+ + "\0\215\0\u18f8\0\u1927\0\u1956\0\u1985\0\u19b4\0\u19e3\0\u1a12"+ + "\0\u1a41\0\u1a70\0\u1a9f\0\u1ace\0\u1afd\0\u1b2c\0\u1b5b\0\u1b8a"+ + "\0\u1bb9\0\u1be8\0\u1c17\0\u1c46\0\u1c75\0\u1ca4\0\u1cd3\0\u1d02"+ + "\0\u1d31\0\u1d60\0\u1d8f\0\u1dbe\0\u1ded\0\u1e1c\0\u1e4b\0\u1e7a"+ + "\0\u1ea9\0\u1ed8\0\u1f07\0\u1f36\0\u1f65\0\u1f94\0\u1fc3\0\u1ff2"+ + "\0\u2021\0\u2050\0\u207f\0\u20ae\0\u20dd\0\u210c\0\u213b\0\u216a"+ + "\0\u2199\0\u21c8\0\u21f7\0\u2226\0\u2255\0\u2284\0\u22b3\0\u22e2"+ + "\0\u2311\0\u2340\0\u236f\0\u239e\0\u23cd\0\u23fc\0\u242b\0\u245a"+ + "\0\u2489\0\u24b8\0\u24e7\0\u2516\0\u2545\0\u2574\0\u25a3\0\u25d2"+ + "\0\u2601\0\u2630\0\u265f\0\u268e\0\u26bd\0\u26ec\0\u271b\0\u274a"+ + "\0\u2779\0\u27a8\0\u27d7\0\u2806\0\u2835\0\u2864\0\u2893\0\u28c2"+ + "\0\u28f1\0\u2920\0\u294f\0\u297e\0\u180d\0\u29ad\0\u29dc\0\u2a0b"+ + "\0\u2a3a\0\u2a69\0\u2a98\0\u2ac7\0\u2af6\0\u2b25\0\u2b54\0\u2b83"+ + "\0\u2bb2\0\u2be1\0\u2c10\0\u2c3f\0\u2c6e\0\u2c9d\0\u2ccc\0\u2cfb"+ + "\0\u2d2a\0\u2d59\0\u2d88\0\u2db7\0\u2de6\0\u2e15\0\u2e44\0\u2e73"+ + "\0\u2ea2\0\u2ed1\0\u2f00\0\u2f2f\0\u2f5e\0\u2f8d\0\u2fbc\0\u186b"+ + "\0\u2feb\0\u301a\0\u3049\0\u3078\0\u30a7\0\u30d6\0\u3105\0\u3134"+ + "\0\u3163\0\u3192\0\u31c1\0\u31f0\0\u321f\0\u324e\0\u327d\0\u32ac"+ + "\0\u32db\0\u330a\0\u3339\0\u3368\0\u3397\0\u33c6\0\u2f8d\0\u33f5"+ + "\0\u3424\0\u3453\0\u3482\0\u34b1\0\u34e0\0\u350f\0\u353e\0\u356d"+ + "\0\u359c\0\u35cb\0\u35fa\0\u3629\0\u3658\0\u3687\0\u36b6\0\u36e5"+ + "\0\u3714\0\u3743\0\u3772\0\u37a1\0\u37d0\0\u37ff\0\u382e\0\u385d"+ + "\0\u388c\0\u38bb\0\u38ea\0\u3919\0\u3948\0\u3977\0\u39a6\0\u39d5"+ + "\0\u3a04\0\u3a33\0\u3a62\0\u0cda\0\u3a91\0\u3ac0\0\u3aef\0\u3b1e"+ + "\0\u3b4d\0\u3b7c\0\u3bab\0\u3bda\0\u3c09\0\u3c38\0\u3c67\0\u3c96"+ + "\0\u3cc5\0\u3cf4\0\u3d23\0\u3d52\0\u3d81\0\u3db0\0\u3ddf\0\u3e0e"+ + "\0\u3e3d\0\u3e6c\0\u3e9b\0\u3eca\0\u3ef9\0\u3f28\0\u3f57\0\u3f86"+ + "\0\u3fb5\0\u3fe4\0\u4013\0\u4042\0\u4071\0\u40a0\0\u40cf\0\u40fe"+ + "\0\u412d\0\u415c\0\u418b\0\u41ba\0\u41e9\0\u4218\0\u4247\0\u4276"+ + "\0\u42a5\0\u42d4\0\u4303\0\u4332\0\u4361\0\u4390\0\u43bf\0\u43ee"+ + "\0\u441d\0\u444c\0\u447b\0\u44aa\0\u44d9\0\u4508\0\u4537\0\u4566"+ + "\0\u4595\0\u45c4\0\u45f3\0\u4622\0\u4651\0\u4680\0\u46af\0\u46de"+ + "\0\u470d\0\u473c\0\u476b\0\u479a\0\u47c9\0\u47f8\0\u4827\0\u4856"+ + "\0\u4885\0\u48b4\0\u48e3\0\u4912\0\u4941\0\u4970\0\u499f\0\u49ce"+ + "\0\u49fd\0\u4a2c\0\u4a5b\0\u4a8a\0\u4ab9\0\u4ae8\0\u4b17\0\u4b46"+ + "\0\u4b75\0\u4ba4\0\u4bd3\0\u4c02\0\u0aa6\0\u4c31\0\u4c60\0\u4c8f"+ + "\0\u4cbe\0\u4ced\0\u4d1c\0\u4d4b\0\u4d7a\0\u4da9\0\u4dd8\0\u4e07"+ + "\0\u4e36\0\u4e65\0\u4e94\0\u4ec3\0\u4ef2\0\u4f21\0\u4f50\0\u4f7f"+ + "\0\u4fae\0\u4fdd\0\u500c\0\u503b\0\u506a\0\u5099\0\u50c8\0\u50f7"+ + "\0\u5126\0\u5155\0\u5184\0\u51b3\0\u51e2\0\u5211\0\u5240\0\u526f"+ + "\0\u529e\0\u52cd\0\u52fc\0\u532b\0\u535a\0\u5389\0\u53b8\0\u53e7"+ + "\0\u5416\0\u5445\0\u5474\0\215\0\u54a3\0\u54d2\0\u5501\0\u5530"+ + "\0\u555f\0\u558e\0\u55bd\0\u55ec"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[484]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\3\5\1\6\1\4\1\7\1\10\1\4\1\11"+ + "\1\12\1\13\1\14\1\15\1\4\1\16\1\17\1\4"+ + "\1\20\1\21\1\22\1\23\1\24\1\5\1\25\1\26"+ + "\1\27\1\30\1\31\1\32\1\10\1\33\1\34\1\35"+ + "\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\12"+ + "\1\45\2\10\1\12\1\46\1\47\1\50\1\51\14\47"+ + "\1\52\1\47\1\53\35\47\1\54\1\50\1\51\15\54"+ + "\1\55\1\53\35\54\60\0\3\5\23\0\1\5\34\0"+ + "\1\56\57\0\1\57\57\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\26\10\12\0\2\60\1\61\1\62\1\63"+ + "\33\0\1\60\3\0\1\60\12\0\2\12\1\61\1\62"+ + "\1\63\33\0\1\12\3\0\1\12\10\0\5\10\1\0"+ + "\1\64\4\0\1\65\1\10\1\66\1\67\1\10\1\0"+ + "\1\70\7\10\1\71\15\10\12\0\2\62\36\0\1\62"+ + "\3\0\1\62\10\0\5\10\1\0\1\10\4\0\1\72"+ + "\1\10\1\73\2\10\1\0\2\10\1\74\1\10\1\75"+ + "\13\10\1\76\5\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\10\1\77\1\100\2\10\1\0\2\10\1\101\1\10"+ + "\1\102\3\10\1\103\15\10\10\0\5\10\1\0\1\104"+ + "\4\0\1\105\2\10\1\106\1\10\1\0\1\107\7\10"+ + "\1\110\1\10\1\111\13\10\10\0\5\10\1\0\1\112"+ + "\4\0\3\10\1\113\1\10\1\0\12\10\1\114\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\115"+ + "\3\10\1\116\1\117\2\10\1\120\5\10\1\121\7\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\122"+ + "\11\10\1\123\2\10\1\124\10\10\10\0\5\10\1\0"+ + "\1\125\4\0\1\126\1\10\1\127\1\130\1\10\1\0"+ + "\12\10\1\131\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\132\4\10\1\0\26\10\10\0\5\10\1\0\1\133"+ + "\4\0\3\10\1\134\1\10\1\0\3\10\1\135\1\10"+ + "\1\136\1\137\2\10\1\140\1\141\2\10\1\142\1\143"+ + "\5\10\1\144\1\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\145\2\10\1\146\1\10\1\0\1\147\7\10\1\150"+ + "\4\10\1\151\10\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\152\2\10\1\153\1\10\1\0\10\10\1\154\15\10"+ + "\10\0\5\10\1\0\1\155\4\0\1\156\2\10\1\157"+ + "\1\10\1\0\1\160\5\10\1\161\6\10\1\162\10\10"+ + "\10\0\5\10\1\0\1\163\4\0\5\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\2\10"+ + "\1\164\1\10\1\165\11\10\1\166\7\10\10\0\5\10"+ + "\1\0\1\167\4\0\1\170\2\10\1\171\1\10\1\0"+ + "\12\10\1\172\13\10\10\0\4\10\1\116\1\0\1\10"+ + "\4\0\5\10\1\0\2\10\1\173\1\10\1\174\1\175"+ + "\6\10\1\176\11\10\10\0\5\10\1\0\1\177\4\0"+ + "\2\10\1\200\1\123\1\10\1\0\6\10\1\116\1\10"+ + "\1\201\1\10\1\202\13\10\10\0\5\10\1\0\1\10"+ + "\4\0\2\10\1\203\2\10\1\0\1\204\25\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\205\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\1\206\1\10\1\207"+ + "\2\10\1\0\1\210\7\10\1\167\15\10\10\0\5\10"+ + "\1\0\1\211\4\0\5\10\1\0\12\10\1\212\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\3\10\1\213\1\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\3\10"+ + "\1\214\1\10\1\0\26\10\1\0\1\47\2\0\14\47"+ + "\1\0\1\47\1\0\35\47\2\0\1\51\73\0\1\215"+ + "\37\0\2\215\1\0\54\215\1\54\2\0\15\54\2\0"+ + "\35\54\20\0\1\215\36\0\5\216\1\217\51\216\1\57"+ + "\1\220\1\221\54\57\11\0\2\62\1\61\1\0\1\63"+ + "\33\0\1\62\3\0\1\62\7\0\1\222\2\0\2\223"+ + "\3\0\1\222\32\0\1\223\3\0\1\223\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\5\10\1\72\20\10"+ + "\10\0\5\10\1\0\1\10\4\0\2\10\1\224\2\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\3\10"+ + "\1\225\1\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\226\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\3\10\1\227\1\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\230\2\10\1\0"+ + "\4\10\1\231\21\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\3\10\1\232\22\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\233\23\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\3\10\1\234"+ + "\22\10\10\0\5\10\1\0\1\10\4\0\1\10\1\116"+ + "\3\10\1\0\3\10\1\235\22\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\236\6\10\1\237"+ + "\3\10\1\240\7\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\10\1\116\3\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\2\10\1\241\2\10\1\0\5\10\1\242"+ + "\20\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\3\10\1\116\22\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\243\1\116\3\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\5\10\1\244\20\10\10\0"+ + "\4\10\1\245\1\0\1\10\4\0\2\10\1\246\2\10"+ + "\1\0\2\10\1\247\1\250\1\10\1\251\20\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\5\10\1\252"+ + "\20\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\10\10\1\253\15\10\10\0\5\10\1\0\1\10\4\0"+ + "\3\10\1\254\1\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\255\4\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\1\10\1\116\1\256"+ + "\23\10\10\0\4\10\1\257\1\0\1\10\4\0\1\260"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\77\2\10\1\254\1\10\1\0\3\10\1\261\1\262"+ + "\21\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\4\10\1\263\4\10\1\264\5\10\1\265\6\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\10\1\242\3\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\15\10\1\266\10\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\5\10\1\267\20\10\10\0\5\10\1\0"+ + "\1\270\4\0\5\10\1\0\5\10\1\271\20\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\12\10\1\272"+ + "\13\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\5\10\1\232\20\10\10\0\5\10\1\0\1\273\4\0"+ + "\5\10\1\0\12\10\1\274\13\10\10\0\4\10\1\275"+ + "\1\0\1\10\4\0\1\276\1\10\1\277\2\10\1\0"+ + "\1\10\1\300\1\301\1\10\1\302\1\303\6\10\1\304"+ + "\1\10\1\305\5\10\1\306\1\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\224\13\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\12\10\1\307"+ + "\13\10\10\0\5\10\1\0\1\10\4\0\2\10\1\310"+ + "\1\10\1\311\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\14\10\1\312\11\10\10\0\5\10"+ + "\1\0\1\10\4\0\2\10\1\313\2\10\1\0\1\314"+ + "\25\10\10\0\5\10\1\0\1\10\4\0\2\10\1\315"+ + "\2\10\1\0\4\10\1\316\1\116\10\10\1\317\5\10"+ + "\1\320\1\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\4\10\1\302\21\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\15\10\1\321\10\10\10\0\5\10"+ + "\1\0\1\10\4\0\1\322\4\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\2\10\1\166"+ + "\23\10\10\0\5\10\1\0\1\10\4\0\1\323\4\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\7\10\1\265\16\10\10\0\5\10\1\0\1\10"+ + "\4\0\3\10\1\324\1\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\325\4\0\1\326\4\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\327\2\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\2\10\1\255"+ + "\2\10\1\0\2\10\1\330\1\331\22\10\10\0\5\10"+ + "\1\0\1\10\4\0\2\10\1\332\2\10\1\0\4\10"+ + "\1\333\4\10\1\334\14\10\10\0\5\10\1\0\1\335"+ + "\4\0\3\10\1\336\1\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\1\337\25\10\10\0"+ + "\5\10\1\0\1\340\4\0\1\341\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\342\20\10\10\0\5\10\1\0\1\10\4\0\3\10"+ + "\1\343\1\10\1\0\3\10\1\344\1\10\1\116\20\10"+ + "\10\0\5\10\1\0\1\10\4\0\2\10\1\255\2\10"+ + "\1\0\11\10\1\345\14\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\346\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\13\10\1\347\12\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\23\10\1\350"+ + "\2\10\10\0\5\10\1\0\1\10\4\0\1\351\4\10"+ + "\1\0\10\10\1\352\1\10\1\353\13\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\16\10\1\265\7\10"+ + "\10\0\5\10\1\0\1\270\4\0\5\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\354"+ + "\25\10\10\0\5\10\1\0\1\355\4\0\1\356\4\10"+ + "\1\0\12\10\1\357\13\10\10\0\5\10\1\0\1\10"+ + "\4\0\1\10\1\360\1\361\2\10\1\0\2\10\1\362"+ + "\7\10\1\363\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\10\1\335\3\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\1\356\25\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\5\10\1\72\12\10"+ + "\1\364\5\10\10\0\5\10\1\0\1\10\4\0\1\10"+ + "\1\365\3\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\4\10\1\364\21\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\366\26\10\10\0\4\10"+ + "\1\367\1\0\1\10\4\0\1\10\1\370\1\10\1\371"+ + "\1\10\1\0\2\10\1\372\1\10\1\242\1\373\20\10"+ + "\10\0\5\10\1\0\1\374\4\0\5\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\4\10"+ + "\1\375\21\10\10\0\4\10\1\375\1\0\1\10\4\0"+ + "\5\10\1\0\5\10\1\376\6\10\1\214\11\10\10\0"+ + "\5\10\1\0\1\10\4\0\3\10\1\377\1\10\1\0"+ + "\26\10\10\0\4\10\1\u0100\1\0\1\10\4\0\5\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\4\10\1\u0101\7\10\1\u0102\11\10\10\0\5\10"+ + "\1\0\1\10\4\0\3\10\1\u0103\1\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\1\u0104\2\10\1\u0105"+ + "\1\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\1\10\1\u0106\24\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\u0107\10\10\1\u0108"+ + "\11\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\2\10\1\u0109\23\10\10\0\5\10\1\0\1\u010a\4\0"+ + "\1\u010b\2\10\1\u010c\1\10\1\0\12\10\1\u010d\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\6\10"+ + "\1\u010e\17\10\10\0\5\10\1\0\1\10\4\0\2\10"+ + "\1\255\2\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\116\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\270\13\10\1\0"+ + "\5\216\1\u010f\55\216\1\u0110\1\u010f\51\216\2\0\1\221"+ + "\65\0\2\223\36\0\1\223\3\0\1\223\12\0\2\223"+ + "\1\61\35\0\1\223\3\0\1\223\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\265\23\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\u0111\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\u0112\4\0\5\10\1\0\3\10"+ + "\1\265\22\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\11\10\1\116\14\10\10\0\5\10\1\0\1\10"+ + "\4\0\2\10\1\u0113\2\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\3\10\1\u0114\22\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\15\10"+ + "\1\116\10\10\10\0\5\10\1\0\1\u0115\4\0\5\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\1\u0116"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\2\10\1\u0117\2\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\u0118\4\0\5\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\u0119\2\10\1\116"+ + "\20\10\10\0\5\10\1\0\1\10\4\0\2\10\1\u011a"+ + "\2\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\3\10\1\u011b\1\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\213\4\0\5\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\2\10\1\u011c\2\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\3\10\1\u011d\1\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\1\u011e\4\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\272\4\0\1\u011f"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\3\10\1\u0120\22\10\10\0\5\10\1\0"+ + "\1\10\4\0\2\10\1\u0121\1\u0122\1\10\1\0\12\10"+ + "\1\u0123\13\10\10\0\5\10\1\0\1\u0124\4\0\5\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\116\4\0\1\u0125"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\13\10\1\274\12\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\16\10\1\116\7\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\116\2\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\5\10\1\u0126\20\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\5\10\1\116\20\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\10\1\u0106\3\10\1\0\1\10\1\265"+ + "\24\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\17\10\1\116\6\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\14\10\1\116\11\10\10\0\5\10\1\0"+ + "\1\u0127\4\0\5\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\257\13\10\10\0"+ + "\5\10\1\0\1\116\4\0\5\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\u0128\4\0\5\10\1\0\26\10\10\0"+ + "\4\10\1\367\1\0\1\213\4\0\5\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\4\10"+ + "\1\116\21\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\12\10\1\u0129\13\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\5\10\1\265\20\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\1\265\3\10\1\116"+ + "\21\10\10\0\5\10\1\0\1\10\4\0\2\10\1\265"+ + "\2\10\1\0\26\10\10\0\5\10\1\0\1\u012a\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\10\1\u010e\1\116\2\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\u012b\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\3\10\1\307\1\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\u012c\20\10\10\0\5\10\1\0\1\10\4\0\1\u012d"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\10\10\1\u012e\15\10\10\0\5\10\1\0"+ + "\1\u012f\4\0\5\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\u0130\4\0\2\10\1\u0131\2\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\10\10\1\u0132"+ + "\15\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\17\10\1\265\6\10\10\0\5\10\1\0\1\10\4\0"+ + "\2\10\1\u0133\2\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\u0134\1\10\1\u0135"+ + "\20\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\15\10\1\257\10\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\10\10\1\263\15\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\u0136\2\10\1\u0106"+ + "\4\10\1\u0137\12\10\10\0\5\10\1\0\1\u0138\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\2\10\1\u0139\23\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\u013a\4\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\10\10\1\u013b\15\10"+ + "\10\0\5\10\1\0\1\u013c\4\0\5\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\u013d"+ + "\25\10\10\0\5\10\1\0\1\10\4\0\2\10\1\u013e"+ + "\2\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\4\10\1\116\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\3\10\1\u013f\22\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\5\10\1\u0140\20\10"+ + "\10\0\5\10\1\0\1\u0141\4\0\4\10\1\u0142\1\0"+ + "\2\10\1\u0143\23\10\10\0\5\10\1\0\1\116\4\0"+ + "\5\10\1\0\3\10\1\u0144\22\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\15\10\1\265\10\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\335\2\10\1\0"+ + "\10\10\1\u0145\15\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\10\1\u0146\3\10\1\0\1\10\1\u0147\1\u0148\2\10"+ + "\1\u0149\20\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\11\10\1\264\14\10\10\0\5\10\1\0\1\10"+ + "\4\0\1\272\4\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\u0127\23\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\2\10\1\44"+ + "\23\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\3\10\1\261\22\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\1\u014a\3\10\1\356\21\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\10\10\1\u014b\15\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\u014c"+ + "\25\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\6\10\1\u014d\17\10\10\0\5\10\1\0\1\u014e\4\0"+ + "\5\10\1\0\13\10\1\242\12\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\11\10\1\u014f\14\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\u0150\2\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\1\10\1\335"+ + "\3\10\1\0\3\10\1\u0151\22\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\u0152\13\10\10\0"+ + "\5\10\1\0\1\116\4\0\5\10\1\0\4\10\1\u0153"+ + "\21\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\14\10\1\u0154\11\10\10\0\5\10\1\0\1\10\4\0"+ + "\3\10\1\u0155\1\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\14\10\1\265\11\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\4\10\1\262"+ + "\21\10\10\0\5\10\1\0\1\10\4\0\3\10\1\116"+ + "\1\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\3\10\1\340\1\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\u0156\13\10\10\0"+ + "\5\10\1\0\1\10\4\0\3\10\1\270\1\10\1\0"+ + "\24\10\1\u0157\1\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\1\10\1\u0158\24\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\u0159\13\10\31\0"+ + "\1\u015a\35\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\274\13\10\10\0\5\10\1\0\1\u015b\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\10\10\1\257\15\10\10\0\5\10\1\0"+ + "\1\u015c\4\0\5\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\u015d\4\0\3\10\1\116\1\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\1\335\25\10"+ + "\10\0\5\10\1\0\1\10\4\0\3\10\1\u015e\1\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\4\10"+ + "\1\u015f\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\13\10\1\116\12\10\10\0\4\10\1\u0160"+ + "\1\0\1\10\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\1\u0161\4\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\12\10\1\u0104"+ + "\13\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\13\10\1\u0162\12\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\4\10\1\257\21\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\10\10\1\254\15\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\12\10\1\357"+ + "\13\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\17\10\1\u0163\6\10\10\0\5\10\1\0\1\u0164\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\23\10\1\u0165\2\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\u0166\22\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\14\10\1\u0167"+ + "\11\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\3\10\1\u0168\22\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\11\10\1\u0101\14\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\116\23\10\1\0"+ + "\4\216\1\221\1\u010f\51\216\7\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\5\10\1\u0169\20\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\12\10\1\u016a\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\u016b\20\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\5\10\1\u016c\20\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\12\10\1\u016d\13\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\16\10\1\u016e\7\10"+ + "\10\0\5\10\1\0\1\10\4\0\3\10\1\u016f\1\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\16\10\1\u0114\7\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\5\10\1\u0127\20\10\10\0\5\10"+ + "\1\0\1\10\4\0\1\214\4\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\4\10\1\u0170\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\6\10"+ + "\1\141\17\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\11\10\1\u0171\14\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\10\10\1\u0172\15\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\6\10\1\u016e\17\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\u0173"+ + "\25\10\10\0\5\10\1\0\1\10\4\0\1\u015e\4\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\1\10"+ + "\1\265\3\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\11\10\1\110\14\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\1\u0174\25\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\13\10\1\u0175"+ + "\12\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\u0176\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\1\u0127\25\10\10\0\5\10\1\0\1\10"+ + "\4\0\3\10\1\u0177\1\10\1\0\11\10\1\u0178\14\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\u0179"+ + "\25\10\10\0\5\10\1\0\1\10\4\0\1\224\4\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\1\u017a\25\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\11\10\1\265\14\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\1\270\25\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\20\10\1\254\5\10"+ + "\10\0\5\10\1\0\1\10\4\0\1\257\4\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\1\u017b\4\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\12\10\1\u015e\13\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\13\10\1\u017c\12\10\10\0\5\10"+ + "\1\0\1\10\4\0\3\10\1\u017d\1\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\6\10"+ + "\1\161\17\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\15\10\1\u017e\10\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\12\10\1\u017f\13\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\3\10\1\257\22\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\12\10"+ + "\1\u0180\13\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\1\u0181\25\10\10\0\5\10\1\0\1\u0182\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\11\10\1\u0183\14\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\5\10\1\u0106\20\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\u0102\2\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\u0184\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\12\10\1\110\13\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\20\10\1\u0185\5\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\u0186\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\335\20\10\10\0\5\10\1\0\1\10\4\0\1\u0122"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\11\10\1\270\14\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\12\10\1\u0114\13\10\10\0"+ + "\5\10\1\0\1\u0187\4\0\5\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\5\10\1\u0188"+ + "\20\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\u0189\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\u018a\4\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\110\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\3\10\1\274\22\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\1\u018b\25\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\12\10"+ + "\1\u018c\13\10\10\0\5\10\1\0\1\u018d\4\0\5\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\15\10\1\u018e\10\10\10\0\5\10\1\0\1\10"+ + "\4\0\2\10\1\u0106\2\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\3\10\1\335\22\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\14\10"+ + "\1\242\11\10\10\0\4\10\1\u018f\1\0\1\10\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\14\10\1\u0190\11\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\10\10\1\265\15\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\u0191\4\10\1\0\26\10"+ + "\10\0\4\10\1\u0192\1\0\1\10\4\0\5\10\1\0"+ + "\26\10\16\0\1\u0193\50\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\20\10\1\116\5\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\1\257\3\10\1\316\21\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\1\u0194"+ + "\13\10\1\242\11\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\1\265\25\10\10\0\5\10\1\0\1\162"+ + "\4\0\5\10\1\0\26\10\10\0\5\10\1\0\1\u0195"+ + "\4\0\5\10\1\0\26\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\u0196\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\u0197\4\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\1\u0198\4\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\2\10\1\u0178"+ + "\23\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\u0199\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\12\10\1\u019a\13\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\11\10\1\u019b\14\10\10\0"+ + "\5\10\1\0\1\u019c\4\0\5\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\21\10\1\116"+ + "\4\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\14\10\1\270\11\10\10\0\5\10\1\0\1\u019d\4\0"+ + "\5\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\12\10\1\u019e\13\10\10\0\4\10\1\116"+ + "\1\0\1\10\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\77\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\2\10\1\u016e\23\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\u019f\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\1\u01a0\4\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\2\10\1\257"+ + "\2\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\12\10\1\u01a1\13\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\11\10\1\u01a2\14\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\u01a3\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\4\10"+ + "\1\u01a4\21\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\4\10\1\u01a5\21\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\12\10\1\141\13\10\10\0\5\10"+ + "\1\0\1\u01a6\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\12\10\1\u0138\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\3\10"+ + "\1\265\22\10\10\0\5\10\1\0\1\10\4\0\1\340"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\10\10\1\u0104\15\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\u01a7\4\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\4\10\1\u0101\21\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\u01a8\20\10\10\0\5\10\1\0\1\10\4\0\1\u01a9"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\4\10\1\u017b\21\10\10\0\5\10\1\0"+ + "\1\10\4\0\1\u010e\4\10\1\0\26\10\10\0\4\10"+ + "\1\u018b\1\0\1\10\4\0\5\10\1\0\26\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\3\10\1\236"+ + "\22\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\1\u01aa\25\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\1\257\25\10\10\0\5\10\1\0\1\10\4\0"+ + "\1\u0104\4\10\1\0\1\u01ab\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\4\10\1\u0157\21\10\10\0"+ + "\5\10\1\0\1\10\4\0\5\10\1\0\3\10\1\u01ac"+ + "\22\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\12\10\1\u01ad\13\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\4\10\1\u01ae\21\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\u01af\23\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\213\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\12\10"+ + "\1\212\13\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\4\10\1\u016e\21\10\10\0\5\10\1\0\1\10"+ + "\4\0\2\10\1\u0157\2\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\12\10\1\263\13\10"+ + "\14\0\1\u01b0\52\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\1\10\1\110\24\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\u01b1\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\6\10\1\116\17\10\10\0"+ + "\5\10\1\0\1\10\4\0\2\10\1\u01b2\2\10\1\0"+ + "\26\10\10\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\14\10\1\u01b3\11\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\4\10\1\u01b4\21\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\2\10\1\u016c\23\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\116\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\1\10\1\u01b5\3\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\20\10\1\257\5\10\10\0\5\10\1\0\1\10"+ + "\4\0\3\10\1\270\1\10\1\0\26\10\31\0\1\u01b6"+ + "\35\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\u018b\20\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\13\10\1\265\12\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\12\10\1\u01b7\13\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\2\10\1\u01b8\23\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\3\10"+ + "\1\u01b9\22\10\10\0\5\10\1\0\1\10\4\0\1\u01ba"+ + "\4\10\1\0\26\10\10\0\5\10\1\0\1\10\4\0"+ + "\5\10\1\0\4\10\1\u01bb\21\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\1\u01bc\25\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\12\10\1\u01bd\13\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\44\20\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\4\10\1\u0106\21\10\10\0\5\10\1\0\1\10"+ + "\4\0\1\u0102\4\10\1\0\26\10\10\0\5\10\1\0"+ + "\1\10\4\0\5\10\1\0\5\10\1\242\20\10\10\0"+ + "\5\10\1\0\1\10\4\0\1\u01be\4\10\1\0\26\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\16\10"+ + "\1\u0131\7\10\30\0\1\u01bf\36\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\16\10\1\u01c0\7\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\u01c1\26\10\10\0\5\10"+ + "\1\0\1\u01c2\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\5\10\1\u01c3\20\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\10\10"+ + "\1\u015e\15\10\16\0\1\u01c4\50\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\4\10\1\u01c5\21\10\10\0\5\10"+ + "\1\0\1\u010e\4\0\5\10\1\0\26\10\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\5\10\1\u01c6\20\10"+ + "\10\0\5\10\1\0\1\10\4\0\2\10\1\u01c7\2\10"+ + "\1\0\26\10\10\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\3\10\1\263\22\10\10\0\5\10\1\0\1\10"+ + "\4\0\1\u018a\4\10\1\0\25\10\1\116\10\0\5\10"+ + "\1\0\1\10\4\0\5\10\1\0\1\10\1\265\24\10"+ + "\10\0\5\10\1\0\1\10\4\0\5\10\1\0\5\10"+ + "\1\u016e\20\10\34\0\1\u01c8\32\0\5\10\1\0\1\10"+ + "\4\0\3\10\1\u01c9\1\10\1\0\26\10\36\0\1\u01ca"+ + "\30\0\5\10\1\0\1\10\4\0\5\10\1\u01cb\26\10"+ + "\10\0\5\10\1\0\1\u0154\4\0\5\10\1\0\26\10"+ + "\32\0\1\u01cc\34\0\5\10\1\0\1\10\4\0\5\10"+ + "\1\0\12\10\1\u01cd\13\10\10\0\5\10\1\0\1\10"+ + "\4\0\5\10\1\0\1\142\25\10\10\0\5\10\1\0"+ + "\1\10\4\0\2\10\1\u0196\2\10\1\0\26\10\41\0"+ + "\1\u01ce\25\0\5\10\1\0\1\10\4\0\3\10\1\255"+ + "\1\10\1\0\26\10\16\0\1\u01cf\104\0\1\u01d0\30\0"+ + "\1\u01d1\50\0\5\10\1\0\1\10\4\0\5\10\1\0"+ + "\2\10\1\u01a0\23\10\31\0\1\u01d2\67\0\1\u01d3\42\0"+ + "\1\u01d4\61\0\1\u01d5\60\0\1\u01d6\72\0\1\u01d7\33\0"+ + "\1\u01d8\65\0\1\u01d9\51\0\1\u01da\56\0\1\u01db\67\0"+ + "\1\u01dc\35\0\1\u01dd\71\0\1\u01dc\56\0\1\u01de\55\0"+ + "\1\u01df\51\0\1\u01e0\66\0\1\u01e1\54\0\1\u01d8\61\0"+ + "\1\u01e2\45\0\1\u01e3\70\0\1\u01e4\54\0\1\u01dc\24\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[22043]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\11\1\2\11\26\1\1\11\2\1\1\11"+ + "\4\1\1\0\1\1\1\0\1\11\2\0\131\1\1\11"+ + "\2\0\1\1\1\11\2\0\142\1\1\0\30\1\1\0"+ + "\112\1\1\0\70\1\1\0\13\1\1\0\20\1\1\0"+ + "\5\1\1\0\10\1\1\0\1\1\1\0\2\1\1\0"+ + "\3\1\1\0\1\1\3\0\1\1\16\0\1\11\10\0"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[484]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Default constructor is needed as we will always call the yyreset + */ + public SqlLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public SqlLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public SqlLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1820) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 12: + { return token(TokenType.KEYWORD); + } + case 14: break; + case 7: + { yybegin(SQ_STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 15: break; + case 5: + { return token(TokenType.OPERATOR); + } + case 16: break; + case 13: + { tokenLength += 2; + } + case 17: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 18: break; + case 11: + { return token(TokenType.COMMENT); + } + case 19: break; + case 10: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 20: break; + case 9: + { yybegin(YYINITIAL); + } + case 21: break; + case 4: + { return token(TokenType.NUMBER); + } + case 22: break; + case 6: + { yybegin(DQ_STRING); + tokenStart = yychar; + tokenLength = 1; + } + case 23: break; + case 2: + { /* skip */ + } + case 24: break; + case 1: + { + } + case 25: break; + case 8: + { tokenLength += yylength(); + } + case 26: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/TALLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/TALLexer.java new file mode 100644 index 000000000..9418cc098 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/TALLexer.java @@ -0,0 +1,821 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/tal.flex + */ +public final class TALLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\1\4\1\33"+ + "\2\0\1\15\1\0\1\34\1\46\1\47\1\51\1\51\1\51\1\5"+ + "\1\51\1\51\1\10\1\17\1\41\1\16\4\20\2\11\1\55\1\51"+ + "\1\54\1\52\1\53\1\44\1\0\1\31\1\14\1\23\1\21\1\22"+ + "\1\32\1\27\1\40\1\24\2\6\1\13\1\6\1\25\1\42\1\45"+ + "\1\6\1\30\1\36\1\26\1\37\1\6\1\43\1\12\1\50\1\6"+ + "\1\51\1\35\1\51\1\7\1\6\1\0\1\31\1\14\1\23\1\21"+ + "\1\22\1\32\1\27\1\40\1\24\2\6\1\13\1\6\1\25\1\42"+ + "\1\45\1\6\1\30\1\36\1\26\1\37\1\6\1\43\1\12\1\50"+ + "\1\6\1\51\1\0\1\51\uff82\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\1\0\3\1\2\2\1\3\2\4\2\3\1\1\4\3"+ + "\2\1\2\3\5\2\1\0\3\5\4\0\3\3\2\4"+ + "\1\3\1\6\5\3\4\0\3\3\2\0\3\4\1\0"+ + "\3\3\1\4\1\3\1\7\4\3\1\10\1\0\3\3"+ + "\2\0\1\4\1\0\2\3\1\7\1\4\1\3\1\0"+ + "\10\3\2\0\1\4\1\0\1\3\1\4\1\3\1\0"+ + "\5\3\1\0\1\6\1\4\1\0\1\3\1\4\1\3"+ + "\1\0\1\3\1\6\1\0\1\4\1\0\1\4\1\3"+ + "\1\7\1\3\1\0\1\4\1\0\1\4\2\3\1\4"+ + "\1\0\1\4\1\3\1\4\1\0\1\4\1\3\2\0"+ + "\1\4\1\3\2\0\1\4\1\3\2\0\1\4\1\3"+ + "\2\0\1\4\1\3\2\0\1\4\1\3\2\0\1\3"+ + "\2\0\1\3\2\0\1\4\3\0"; + + private static int [] zzUnpackAction() { + int [] result = new int[167]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\56\0\134\0\212\0\270\0\346\0\u0114\0\u0142"+ + "\0\u0170\0\u019e\0\u01cc\0\u01fa\0\u0228\0\u0256\0\u0284\0\u02b2"+ + "\0\u02e0\0\u030e\0\u033c\0\u036a\0\u0398\0\56\0\u03c6\0\u03f4"+ + "\0\u0422\0\270\0\u0450\0\56\0\u047e\0\u04ac\0\u04da\0\u0508"+ + "\0\u0536\0\u0564\0\u0592\0\u05c0\0\u05ee\0\u061c\0\u064a\0\u0114"+ + "\0\u0678\0\u06a6\0\u06d4\0\u0702\0\u0730\0\u075e\0\u078c\0\u07ba"+ + "\0\u07e8\0\u0816\0\u0844\0\u0872\0\u08a0\0\u08ce\0\56\0\u08fc"+ + "\0\u092a\0\u0958\0\u0986\0\u09b4\0\u09e2\0\u0a10\0\u0a3e\0\u0a6c"+ + "\0\u0a9a\0\u0ac8\0\u0af6\0\u0b24\0\56\0\u0b52\0\u0b80\0\u0bae"+ + "\0\u0bdc\0\u0c0a\0\u0c38\0\u0c66\0\u0c94\0\u0cc2\0\u0cf0\0\u0114"+ + "\0\u0d1e\0\u0d4c\0\u0d7a\0\u0da8\0\u0dd6\0\u0e04\0\u0e32\0\u0e60"+ + "\0\u0e8e\0\u0ebc\0\u0eea\0\u0f18\0\u0f46\0\u0f74\0\u0fa2\0\u0fd0"+ + "\0\u0ffe\0\u102c\0\u105a\0\u1088\0\u10b6\0\u10e4\0\u1112\0\u1140"+ + "\0\u116e\0\56\0\u119c\0\u11ca\0\u11f8\0\u1226\0\u1254\0\u1282"+ + "\0\u12b0\0\u12de\0\u130c\0\u133a\0\u1368\0\u1396\0\u13c4\0\56"+ + "\0\u13f2\0\u1420\0\u144e\0\u147c\0\u14aa\0\u14d8\0\u1506\0\u1534"+ + "\0\u1562\0\u1590\0\u15be\0\u15ec\0\u161a\0\u1648\0\u1676\0\u16a4"+ + "\0\u16d2\0\u1700\0\u172e\0\u175c\0\u178a\0\u17b8\0\u17e6\0\u1814"+ + "\0\u1842\0\u1870\0\u189e\0\u18cc\0\u18fa\0\u1928\0\u1956\0\u1984"+ + "\0\u19b2\0\u19e0\0\u1a0e\0\u1a3c\0\u1a6a\0\u1a98\0\u1ac6\0\u1af4"+ + "\0\u1b22\0\u1b50\0\u1b7e\0\u0114\0\u1bac\0\u1bda\0\u1c08"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[167]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\2\1\3\1\2\1\4\1\5\1\6\1\7\1\2"+ + "\1\10\1\11\1\7\1\12\1\13\1\14\3\11\1\15"+ + "\1\16\1\7\1\17\5\7\1\20\1\21\1\22\1\2"+ + "\1\23\2\7\1\11\1\7\1\24\1\25\1\7\2\26"+ + "\1\7\2\26\1\27\1\30\1\31\60\0\1\2\56\0"+ + "\1\4\52\0\1\32\1\33\1\34\1\32\1\34\51\32"+ + "\5\0\1\35\56\0\7\7\1\0\15\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\15\0\1\36\1\0\1\37"+ + "\3\0\1\40\1\41\1\40\20\0\1\40\24\0\2\11"+ + "\4\0\3\11\20\0\1\11\22\0\7\7\1\0\6\7"+ + "\1\42\6\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\13\0\7\7\1\0\4\7\1\43\10\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\44\15\0\1\45\5\0\2\46"+ + "\1\45\20\0\1\46\22\0\7\7\1\0\4\7\1\47"+ + "\10\7\3\0\4\7\1\50\1\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\7\7\1\51\5\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\7\7\1\52\5\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\5\7\1\53\1\7\1\0\6\7\1\54"+ + "\6\7\3\0\4\7\1\55\1\7\1\0\1\7\2\0"+ + "\1\7\5\0\1\56\2\0\30\56\1\0\1\56\1\0"+ + "\20\56\1\57\2\0\31\57\2\0\14\57\1\60\2\57"+ + "\1\61\6\0\7\7\1\0\10\7\1\62\4\7\3\0"+ + "\2\7\1\63\3\7\1\0\1\7\2\0\1\7\13\0"+ + "\7\7\1\0\15\7\3\0\2\7\1\64\3\7\1\0"+ + "\1\7\2\0\1\7\43\0\1\65\6\0\1\66\63\0"+ + "\1\26\55\0\2\26\53\0\1\26\5\0\1\34\53\0"+ + "\1\35\1\33\1\34\53\35\10\0\1\36\2\0\1\67"+ + "\2\0\1\40\1\41\1\40\20\0\1\40\24\0\1\70"+ + "\1\71\2\0\1\71\1\0\6\71\5\0\2\71\6\0"+ + "\1\71\24\0\1\72\2\0\1\67\2\0\3\72\20\0"+ + "\1\72\24\0\1\40\2\0\1\67\2\0\3\40\20\0"+ + "\1\40\22\0\7\7\1\0\10\7\1\73\4\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\11\7\1\74\3\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\10\7\1\75\4\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\15\0\1\76\5\0"+ + "\3\76\20\0\1\76\24\0\1\45\5\0\3\45\20\0"+ + "\1\45\22\0\7\7\1\0\5\7\1\77\7\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\3\7\1\50\11\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\10\7\1\100\4\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\15\7\3\0\4\7\1\101\1\7\1\0\1\7\2\0"+ + "\1\7\13\0\4\7\1\102\1\103\1\7\1\0\4\7"+ + "\1\104\10\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\13\0\7\7\1\0\12\7\1\50\2\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\5\0\1\56\2\0\30\56"+ + "\1\105\1\56\1\0\20\56\34\0\1\105\55\0\1\105"+ + "\20\0\1\106\34\0\1\105\15\0\1\106\11\0\7\7"+ + "\1\0\12\7\1\107\2\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\13\0\7\7\1\0\13\7\1\110\1\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\13\0\7\7"+ + "\1\0\6\7\1\111\6\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\27\0\1\112\64\0\1\113\34\0\1\70"+ + "\1\71\1\0\1\67\1\71\1\0\6\71\5\0\2\71"+ + "\6\0\1\71\24\0\2\114\1\0\1\67\1\114\1\0"+ + "\6\114\5\0\2\114\6\0\1\114\24\0\1\115\2\0"+ + "\1\67\2\0\3\115\20\0\1\115\22\0\7\7\1\0"+ + "\4\7\1\116\10\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\6\7\1\117\6\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\4\7\1\120\10\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\15\0\1\121\5\0\3\121\20\0\1\121\22\0"+ + "\7\7\1\0\6\7\1\122\6\7\3\0\6\7\1\0"+ + "\1\7\2\0\1\7\13\0\7\7\1\0\15\7\3\0"+ + "\6\7\1\0\1\7\1\123\1\0\1\7\13\0\7\7"+ + "\1\0\13\7\1\124\1\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\13\0\7\7\1\0\4\7\1\125\10\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\13\0\5\7"+ + "\1\126\1\7\1\0\15\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\13\0\5\7\1\127\1\7\1\0\15\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\41\0\1\26"+ + "\27\0\7\7\1\0\6\7\1\130\6\7\3\0\1\7"+ + "\1\131\4\7\1\0\1\7\2\0\1\7\13\0\7\7"+ + "\1\0\12\7\1\132\2\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\13\0\5\7\1\133\1\7\1\0\15\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\30\0\1\134"+ + "\61\0\1\135\36\0\2\136\1\0\1\67\1\136\1\0"+ + "\6\136\5\0\2\136\6\0\1\136\24\0\1\137\2\0"+ + "\1\67\2\0\3\137\20\0\1\137\22\0\7\7\1\0"+ + "\12\7\1\140\2\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\7\7\1\50\5\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\15\0\1\141\5\0"+ + "\3\141\20\0\1\141\22\0\7\7\1\0\7\7\1\142"+ + "\5\7\3\0\6\7\1\0\1\7\2\0\1\7\23\0"+ + "\1\143\45\0\7\7\1\0\10\7\1\120\4\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\3\7\1\120\11\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\4\7\1\144\10\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\3\7\1\145\11\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\7\7\1\146\5\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\5\7\1\147\7\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\13\0\7\7\1\0\4\7\1\150\10\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\4\7\1\50\10\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\33\0\1\151\51\0\1\152\43\0\2\153\1\0"+ + "\1\67\1\153\1\0\6\153\5\0\2\153\6\0\1\153"+ + "\24\0\1\154\2\0\1\67\2\0\3\154\20\0\1\154"+ + "\22\0\7\7\1\0\13\7\1\155\1\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\15\0\1\156\5\0\3\156"+ + "\20\0\1\156\22\0\7\7\1\0\10\7\1\157\4\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\46\0\1\160"+ + "\22\0\7\7\1\0\12\7\1\120\2\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\13\0\7\7\1\0\13\7"+ + "\1\161\1\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\13\0\7\7\1\0\11\7\1\120\3\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\13\0\7\7\1\0\10\7"+ + "\1\50\4\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\13\0\7\7\1\0\3\7\1\162\11\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\31\0\1\163\41\0\2\164"+ + "\1\0\1\67\1\164\1\0\6\164\5\0\2\164\6\0"+ + "\1\164\24\0\1\165\2\0\1\67\2\0\3\165\20\0"+ + "\1\165\22\0\5\7\1\50\1\7\1\0\15\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\15\0\1\166\5\0"+ + "\3\166\20\0\1\166\22\0\7\7\1\0\4\7\1\167"+ + "\10\7\3\0\6\7\1\0\1\7\2\0\1\7\54\0"+ + "\1\170\14\0\5\7\1\171\1\7\1\0\15\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\13\0\7\7\1\0"+ + "\15\7\3\0\3\7\1\50\2\7\1\0\1\7\2\0"+ + "\1\7\47\0\1\172\23\0\2\173\1\0\1\67\1\173"+ + "\1\0\6\173\5\0\2\173\6\0\1\173\24\0\1\174"+ + "\2\0\1\67\2\0\3\174\20\0\1\174\24\0\1\175"+ + "\5\0\3\175\20\0\1\175\22\0\7\7\1\0\11\7"+ + "\1\176\3\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\13\0\7\7\1\0\6\7\1\177\6\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\32\0\1\152\40\0\2\200"+ + "\1\0\1\67\1\200\1\0\6\200\5\0\2\200\6\0"+ + "\1\200\24\0\1\201\2\0\1\67\2\0\3\201\20\0"+ + "\1\201\24\0\1\202\5\0\3\202\20\0\1\202\22\0"+ + "\7\7\1\0\4\7\1\203\10\7\3\0\6\7\1\0"+ + "\1\7\2\0\1\7\13\0\7\7\1\0\11\7\1\117"+ + "\3\7\3\0\6\7\1\0\1\7\2\0\1\7\15\0"+ + "\2\204\1\0\1\67\1\204\1\0\6\204\5\0\2\204"+ + "\6\0\1\204\24\0\1\205\2\0\1\67\2\0\3\205"+ + "\20\0\1\205\24\0\1\206\5\0\3\206\20\0\1\206"+ + "\22\0\7\7\1\0\12\7\1\207\2\7\3\0\6\7"+ + "\1\0\1\7\2\0\1\7\15\0\2\210\1\0\1\67"+ + "\1\210\1\0\6\210\5\0\2\210\6\0\1\210\24\0"+ + "\1\211\2\0\1\67\2\0\3\211\20\0\1\211\24\0"+ + "\1\212\5\0\3\212\20\0\1\212\22\0\5\7\1\213"+ + "\1\7\1\0\15\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\15\0\2\214\1\0\1\67\1\214\1\0\6\214"+ + "\5\0\2\214\6\0\1\214\24\0\1\215\2\0\1\67"+ + "\2\0\3\215\20\0\1\215\24\0\1\216\5\0\3\216"+ + "\20\0\1\216\22\0\7\7\1\0\6\7\1\217\6\7"+ + "\3\0\6\7\1\0\1\7\2\0\1\7\15\0\2\220"+ + "\1\0\1\67\1\220\1\0\6\220\5\0\2\220\6\0"+ + "\1\220\24\0\1\221\2\0\1\67\2\0\3\221\20\0"+ + "\1\221\24\0\1\222\5\0\3\222\20\0\1\222\22\0"+ + "\7\7\1\0\10\7\1\223\4\7\3\0\6\7\1\0"+ + "\1\7\2\0\1\7\15\0\2\224\1\0\1\67\1\224"+ + "\1\0\6\224\5\0\2\224\6\0\1\224\24\0\1\225"+ + "\2\0\1\67\2\0\3\225\20\0\1\225\24\0\1\226"+ + "\5\0\3\226\20\0\1\226\22\0\7\7\1\0\4\7"+ + "\1\227\10\7\3\0\6\7\1\0\1\7\2\0\1\7"+ + "\15\0\2\230\1\0\1\67\1\230\1\0\6\230\5\0"+ + "\2\230\6\0\1\230\24\0\1\231\2\0\1\67\2\0"+ + "\3\231\20\0\1\231\24\0\1\232\5\0\3\232\20\0"+ + "\1\232\22\0\7\7\1\0\12\7\1\233\2\7\3\0"+ + "\6\7\1\0\1\7\2\0\1\7\15\0\2\234\1\0"+ + "\1\67\1\234\1\0\6\234\5\0\2\234\6\0\1\234"+ + "\24\0\1\235\2\0\1\67\2\0\3\235\20\0\1\235"+ + "\24\0\1\67\5\0\3\67\20\0\1\67\22\0\7\7"+ + "\1\0\13\7\1\236\1\7\3\0\6\7\1\0\1\7"+ + "\2\0\1\7\15\0\2\237\1\0\1\67\1\237\1\0"+ + "\6\237\5\0\2\237\6\0\1\237\24\0\1\240\2\0"+ + "\1\67\2\0\3\240\20\0\1\240\22\0\5\7\1\241"+ + "\1\7\1\0\15\7\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\15\0\2\242\1\0\1\67\1\242\1\0\6\242"+ + "\5\0\2\242\6\0\1\242\24\0\1\243\2\0\1\67"+ + "\2\0\3\243\20\0\1\243\22\0\7\7\1\0\3\7"+ + "\1\244\10\7\1\244\3\0\6\7\1\0\1\7\2\0"+ + "\1\7\20\0\1\67\52\0\1\245\2\0\1\67\2\0"+ + "\3\245\20\0\1\245\24\0\1\246\2\0\1\67\2\0"+ + "\3\246\20\0\1\246\24\0\1\247\2\0\1\67\2\0"+ + "\3\247\20\0\1\247\24\0\1\242\2\0\1\67\2\0"+ + "\3\242\20\0\1\242\14\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[7222]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\1\0\1\11\23\1\1\11\3\1\1\0\1\1\1\11"+ + "\1\1\4\0\14\1\4\0\3\1\2\0\1\11\2\1"+ + "\1\0\12\1\1\11\1\0\3\1\2\0\1\1\1\0"+ + "\5\1\1\0\10\1\2\0\1\1\1\0\3\1\1\0"+ + "\5\1\1\0\1\11\1\1\1\0\3\1\1\0\2\1"+ + "\1\0\1\1\1\0\2\1\1\11\1\1\1\0\1\1"+ + "\1\0\4\1\1\0\3\1\1\0\2\1\2\0\2\1"+ + "\2\0\2\1\2\0\2\1\2\0\2\1\2\0\2\1"+ + "\2\0\1\1\2\0\1\1\2\0\1\1\3\0"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[167]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public TALLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public TALLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public TALLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 190) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: + { return token(TokenType.STRING); + } + case 9: break; + case 6: + { return token(TokenType.KEYWORD); + } + case 10: break; + case 7: + { return token(TokenType.TYPE); + } + case 11: break; + case 2: + { return token(TokenType.OPERATOR); + } + case 12: break; + case 4: + { return token(TokenType.NUMBER); + } + case 13: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 14: break; + case 5: + { return token(TokenType.COMMENT); + } + case 15: break; + case 1: + { + } + case 16: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XHTMLLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XHTMLLexer.java new file mode 100644 index 000000000..af0eb5b63 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XHTMLLexer.java @@ -0,0 +1,1520 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xhtml.flex + */ +public final class XHTMLLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int INSTR = 8; + public static final int YYINITIAL = 0; + public static final int COMMENT = 2; + public static final int CDATA = 4; + public static final int TAG = 6; + public static final int DOCTYPE = 10; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\1\1\2\2\0\1\2\22\0\1\1\1\4\1\104\1\110"+ + "\2\0\1\106\1\105\5\0\1\5\1\12\1\37\1\13\6\75\3\13"+ + "\1\7\1\107\1\3\1\40\1\6\1\14\1\0\1\34\1\47\1\21"+ + "\1\15\1\31\1\51\1\57\1\73\1\55\1\10\1\61\1\45\1\71"+ + "\1\53\1\17\1\27\1\63\1\41\1\43\1\23\1\65\1\67\1\100"+ + "\1\76\1\25\1\102\1\33\1\0\1\36\1\0\1\7\1\0\1\35"+ + "\1\50\1\22\1\16\1\32\1\52\1\60\1\74\1\56\1\11\1\62"+ + "\1\46\1\72\1\54\1\20\1\30\1\64\1\42\1\44\1\24\1\66"+ + "\1\70\1\101\1\77\1\26\1\103\74\0\1\12\u05a8\0\12\111\206\0"+ + "\12\111\u026c\0\12\111\166\0\12\111\166\0\12\111\166\0\12\111\166\0"+ + "\12\111\167\0\11\111\166\0\12\111\166\0\12\111\166\0\12\111\340\0"+ + "\12\111\166\0\12\111\106\0\12\111\u0116\0\12\111\u031f\0\11\111\u046e\0"+ + "\12\111\46\0\12\111\u012c\0\12\111\ue5c0\0\12\111\346\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\10\1\1\2\32\1\1\3\1\0\1\4\1\0"+ + "\4\4\2\5\1\0\2\4\1\5\11\4\11\0\1\6"+ + "\23\0\1\7\47\0\1\10\4\0\1\11\1\5\17\4"+ + "\23\0\6\4\1\5\16\4\1\12\2\0\1\13\1\0"+ + "\1\14\72\0\1\15\2\0\10\4\1\0\1\16\14\0"+ + "\1\17\32\0\16\4\1\20\55\0\5\4\26\0\3\4"+ + "\1\5\2\4\41\0\2\4\13\0\3\4\21\0\1\4"+ + "\5\0\3\4\16\0\1\4\2\0\1\21\1\22\1\0"; + + private static int [] zzUnpackAction() { + int [] result = new int[498]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\112\0\224\0\336\0\u0128\0\u0172\0\u01bc\0\u0206"+ + "\0\u0250\0\u029a\0\u02e4\0\u032e\0\u0378\0\u01bc\0\u03c2\0\u040c"+ + "\0\u0456\0\u04a0\0\u04ea\0\u0534\0\u057e\0\u05c8\0\u0612\0\u065c"+ + "\0\u06a6\0\u06f0\0\u073a\0\u0784\0\u07ce\0\u0818\0\u0862\0\u08ac"+ + "\0\u08f6\0\u0940\0\u098a\0\u09d4\0\u0a1e\0\u0a68\0\u0ab2\0\u0afc"+ + "\0\u01bc\0\u0b46\0\u0b90\0\u0bda\0\u0c24\0\u0c6e\0\u0cb8\0\u0d02"+ + "\0\u0d4c\0\u0d96\0\u0de0\0\u0e2a\0\u0e74\0\u0ebe\0\u0f08\0\u0f52"+ + "\0\u0f9c\0\u0fe6\0\u1030\0\u107a\0\u10c4\0\u110e\0\u1158\0\u11a2"+ + "\0\u11ec\0\u029a\0\u1236\0\u1280\0\u032e\0\u12ca\0\u1314\0\u03c2"+ + "\0\u01bc\0\u135e\0\u13a8\0\u13f2\0\u143c\0\u1486\0\u14d0\0\u151a"+ + "\0\u1564\0\u15ae\0\u15f8\0\u1642\0\u168c\0\u16d6\0\u1720\0\u176a"+ + "\0\u17b4\0\u17fe\0\u1848\0\u1892\0\u01bc\0\u18dc\0\u1926\0\u1970"+ + "\0\u19ba\0\u1a04\0\u1a4e\0\u1a98\0\u1ae2\0\u1b2c\0\u1b76\0\u1bc0"+ + "\0\u1c0a\0\u1c54\0\u1c9e\0\u1ce8\0\u1d32\0\u1d7c\0\u1dc6\0\u1e10"+ + "\0\u1e5a\0\u1ea4\0\u1eee\0\u1f38\0\u1f82\0\u1fcc\0\u2016\0\u2060"+ + "\0\u20aa\0\u20f4\0\u213e\0\u2188\0\u21d2\0\u221c\0\u2266\0\u22b0"+ + "\0\u22fa\0\u2344\0\u238e\0\u0a1e\0\u01bc\0\u0a68\0\u23d8\0\u2422"+ + "\0\u246c\0\u24b6\0\u0b90\0\u2500\0\u254a\0\u2594\0\u25de\0\u2628"+ + "\0\u2672\0\u26bc\0\u2706\0\u2750\0\u279a\0\u27e4\0\u282e\0\u2878"+ + "\0\u28c2\0\u290c\0\u2956\0\u29a0\0\u29ea\0\u2a34\0\u2a7e\0\u2ac8"+ + "\0\u2b12\0\u2b5c\0\u2ba6\0\u2bf0\0\u2c3a\0\u2c84\0\u2cce\0\u2d18"+ + "\0\u2d62\0\u2dac\0\u2df6\0\u2e40\0\u2e8a\0\u2ed4\0\u2f1e\0\u2f68"+ + "\0\u2fb2\0\u2ffc\0\u3046\0\u3090\0\u30da\0\u3124\0\u316e\0\u31b8"+ + "\0\u3202\0\u324c\0\u3296\0\u32e0\0\u332a\0\u3374\0\u33be\0\u3408"+ + "\0\u3452\0\u349c\0\u01bc\0\u34e6\0\u3530\0\u01bc\0\u357a\0\u01bc"+ + "\0\u35c4\0\u360e\0\u3658\0\u36a2\0\u36ec\0\u3736\0\u3780\0\u37ca"+ + "\0\u3814\0\u385e\0\u38a8\0\u38f2\0\u393c\0\u3986\0\u39d0\0\u3a1a"+ + "\0\u3a64\0\u3aae\0\u3af8\0\u3b42\0\u3b8c\0\u3bd6\0\u3c20\0\u3c6a"+ + "\0\u3cb4\0\u3cfe\0\u3d48\0\u3d92\0\u3ddc\0\u3e26\0\u3e70\0\u3eba"+ + "\0\u3f04\0\u3f4e\0\u3f98\0\u3fe2\0\u402c\0\u4076\0\u40c0\0\u410a"+ + "\0\u4154\0\u419e\0\u41e8\0\u4232\0\u427c\0\u42c6\0\u4310\0\u435a"+ + "\0\u43a4\0\u43ee\0\u4438\0\u4482\0\u44cc\0\u4516\0\u4560\0\u45aa"+ + "\0\u45f4\0\u463e\0\u01bc\0\u4688\0\u46d2\0\u471c\0\u4766\0\u47b0"+ + "\0\u47fa\0\u4844\0\u488e\0\u48d8\0\u4922\0\u496c\0\u01bc\0\u49b6"+ + "\0\u4a00\0\u4a4a\0\u4a94\0\u4ade\0\u4b28\0\u4b72\0\u4bbc\0\u4c06"+ + "\0\u4c50\0\u4c9a\0\u4ce4\0\u01bc\0\u4d2e\0\u4d78\0\u4dc2\0\u4e0c"+ + "\0\u4e56\0\u4ea0\0\u4eea\0\u4f34\0\u4f7e\0\u4fc8\0\u5012\0\u505c"+ + "\0\u50a6\0\u50f0\0\u513a\0\u5184\0\u51ce\0\u5218\0\u5262\0\u52ac"+ + "\0\u52f6\0\u5340\0\u538a\0\u53d4\0\u541e\0\u5468\0\u54b2\0\u54fc"+ + "\0\u5546\0\u5590\0\u55da\0\u5624\0\u566e\0\u56b8\0\u5702\0\u574c"+ + "\0\u5796\0\u57e0\0\u582a\0\u5874\0\u01bc\0\u58be\0\u5908\0\u5952"+ + "\0\u599c\0\u59e6\0\u5a30\0\u5a7a\0\u5ac4\0\u5b0e\0\u5b58\0\u5ba2"+ + "\0\u5bec\0\u5c36\0\u5c80\0\u5cca\0\u5d14\0\u5d5e\0\u5da8\0\u5df2"+ + "\0\u5e3c\0\u5e86\0\u5ed0\0\u5f1a\0\u5f64\0\u5fae\0\u5ff8\0\u6042"+ + "\0\u608c\0\u60d6\0\u6120\0\u616a\0\u61b4\0\u61fe\0\u6248\0\u6292"+ + "\0\u62dc\0\u6326\0\u6370\0\u63ba\0\u6404\0\u644e\0\u6498\0\u64e2"+ + "\0\u652c\0\u6576\0\u65c0\0\u660a\0\u6654\0\u669e\0\u66e8\0\u6732"+ + "\0\u677c\0\u67c6\0\u6810\0\u685a\0\u68a4\0\u68ee\0\u6938\0\u6982"+ + "\0\u69cc\0\u6a16\0\u6a60\0\u6aaa\0\u6af4\0\u6b3e\0\u6b88\0\u6bd2"+ + "\0\u6c1c\0\u6c66\0\u6cb0\0\u6cfa\0\u6d44\0\u6d8e\0\u6dd8\0\u6e22"+ + "\0\u6e6c\0\u6eb6\0\u6f00\0\u6f4a\0\u6f94\0\u6fde\0\u7028\0\u7072"+ + "\0\u70bc\0\u7106\0\u7150\0\u719a\0\u71e4\0\u722e\0\u7278\0\u72c2"+ + "\0\u730c\0\u7356\0\u73a0\0\u73ea\0\u7434\0\u747e\0\u74c8\0\u7512"+ + "\0\u755c\0\u75a6\0\u75f0\0\u763a\0\u7684\0\u76ce\0\u7718\0\u7762"+ + "\0\u77ac\0\u77f6\0\u7840\0\u788a\0\u78d4\0\u791e\0\u7968\0\u79b2"+ + "\0\u79fc\0\u7a46\0\u7a90\0\u7ada\0\u7b24\0\u7b6e\0\u7bb8\0\u7c02"+ + "\0\u7c4c\0\u7c96\0\u7ce0\0\u7d2a\0\u7d74\0\u7dbe\0\u7e08\0\u7e52"+ + "\0\u7e9c\0\u7ee6\0\u7f30\0\u7f7a\0\u7fc4\0\u800e\0\u8058\0\u80a2"+ + "\0\u80ec\0\u8136\0\u8180\0\u81ca\0\u8214\0\u825e\0\u82a8\0\u82f2"+ + "\0\u833c\0\u8386\0\u83d0\0\u841a\0\u8464\0\u84ae\0\u84f8\0\u8542"+ + "\0\u858c\0\u85d6\0\u8620\0\u866a\0\u86b4\0\u86fe\0\u8748\0\u8792"+ + "\0\u87dc\0\u8826\0\u8870\0\u88ba\0\u8904\0\u894e\0\u8998\0\u01bc"+ + "\0\u01bc\0\u89e2"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[498]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\7\1\10\102\7\1\11\3\7\5\12\1\13\104\12"+ + "\36\14\1\15\53\14\6\7\1\16\3\17\3\7\2\20"+ + "\2\21\2\22\2\23\2\17\2\24\2\25\1\7\2\26"+ + "\1\7\1\27\1\7\2\30\2\31\2\32\2\33\2\34"+ + "\2\35\2\36\2\37\4\17\2\40\2\41\2\42\2\43"+ + "\1\7\2\17\2\44\2\17\1\45\1\46\13\7\3\17"+ + "\2\7\1\47\16\17\1\7\2\17\3\7\34\17\1\7"+ + "\6\17\1\45\1\46\4\7\6\50\1\51\103\50\116\0"+ + "\1\52\2\0\3\53\2\0\1\54\2\55\2\56\2\57"+ + "\2\60\2\53\2\61\2\53\1\0\2\62\1\0\1\63"+ + "\1\0\2\53\2\64\2\65\2\66\2\67\2\70\2\71"+ + "\2\53\2\72\2\53\2\73\2\74\2\75\2\76\1\0"+ + "\2\77\4\53\17\0\1\100\4\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\2\0\1\100\4\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\2\0\1\100\1\0\1\100\1\0\1\100\4\0\1\101"+ + "\1\0\5\102\1\103\111\102\1\104\104\102\36\105\1\106"+ + "\111\105\1\107\53\105\5\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\14\110\2\112\1\0\2\113\2\0"+ + "\1\111\14\110\2\114\25\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\6\110\2\115"+ + "\33\110\13\0\1\110\1\0\5\110\1\0\2\110\2\116"+ + "\10\110\2\117\1\0\2\110\2\0\1\111\4\110\2\120"+ + "\6\110\2\121\14\110\2\122\7\110\13\0\1\110\1\0"+ + "\5\110\1\0\10\110\2\123\2\110\2\124\1\0\2\125"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\2\126\41\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\12\110\2\127\27\110\13\0\1\110\1\0\5\110"+ + "\1\0\4\110\2\130\10\110\1\0\2\110\2\0\1\111"+ + "\2\131\2\110\2\132\2\133\25\110\2\134\4\110\14\0"+ + "\1\135\110\0\1\110\1\0\5\110\1\0\2\110\2\136"+ + "\10\110\2\137\1\0\2\110\2\0\1\111\24\110\2\140"+ + "\15\110\13\0\1\110\1\0\5\110\1\0\4\110\2\141"+ + "\2\142\2\110\2\143\2\144\1\0\2\110\2\0\1\111"+ + "\2\145\12\110\2\146\6\110\2\147\4\110\2\150\7\110"+ + "\13\0\1\110\1\0\5\110\1\0\2\110\2\151\12\110"+ + "\1\0\2\152\2\0\1\111\14\110\2\153\25\110\13\0"+ + "\1\110\1\0\5\110\1\0\2\110\2\154\12\110\1\0"+ + "\2\155\2\0\1\111\16\110\2\156\23\110\13\0\1\110"+ + "\1\0\5\110\1\0\2\110\2\157\12\110\1\0\2\160"+ + "\2\0\1\111\2\161\41\110\13\0\1\110\1\0\5\110"+ + "\1\0\2\110\2\162\12\110\1\0\2\163\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\2\164\14\110"+ + "\1\0\2\110\2\0\1\111\2\110\2\165\37\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\24\110\2\166\15\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\2\167\2\170"+ + "\37\110\13\0\1\110\1\0\5\110\1\0\14\110\2\171"+ + "\1\0\2\172\2\0\1\111\2\110\2\173\2\174\35\110"+ + "\13\0\1\110\1\0\5\110\1\0\14\110\2\175\1\0"+ + "\2\176\2\0\1\111\24\110\2\177\15\110\13\0\1\110"+ + "\1\0\5\110\1\0\14\110\2\200\1\0\2\110\2\0"+ + "\1\111\2\201\2\173\37\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\2\202\12\110"+ + "\2\203\25\110\6\0\2\204\1\0\101\204\1\205\5\204"+ + "\2\206\1\0\102\206\1\205\4\206\6\0\1\51\103\0"+ + "\6\50\1\0\103\50\5\0\1\207\7\0\2\210\14\0"+ + "\1\211\63\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\43\53\15\0\3\212\3\0\16\212\1\0"+ + "\2\212\3\0\34\212\1\0\6\212\13\0\1\53\1\0"+ + "\5\53\1\0\2\213\4\53\2\213\6\53\1\0\2\53"+ + "\3\0\4\53\2\213\2\53\2\214\2\53\2\215\25\53"+ + "\13\0\1\53\1\0\5\53\1\0\12\53\2\216\2\53"+ + "\1\0\2\53\3\0\4\53\2\213\35\53\13\0\1\53"+ + "\1\0\5\53\1\0\2\53\2\217\10\53\2\220\1\0"+ + "\2\221\3\0\14\53\2\222\25\53\13\0\1\53\1\0"+ + "\5\53\1\0\2\213\4\53\2\213\4\53\2\223\1\0"+ + "\2\224\3\0\2\213\12\53\2\225\14\53\2\213\7\53"+ + "\13\0\1\53\1\0\5\53\1\0\16\53\1\0\2\226"+ + "\3\0\2\227\41\53\13\0\1\53\1\0\5\53\1\0"+ + "\2\230\10\53\2\231\2\53\1\0\2\53\3\0\2\232"+ + "\41\53\15\0\3\233\3\0\2\234\2\235\2\236\2\237"+ + "\2\233\2\240\2\233\1\0\2\241\3\0\2\233\2\242"+ + "\2\243\2\244\2\245\2\246\2\247\2\233\2\250\2\233"+ + "\2\251\2\252\2\253\2\254\1\0\2\255\4\233\13\0"+ + "\1\53\1\0\5\53\1\0\4\53\2\256\2\257\2\53"+ + "\2\260\2\261\1\0\2\77\3\0\24\53\2\262\2\53"+ + "\2\263\11\53\13\0\1\53\1\0\5\53\1\0\16\53"+ + "\1\0\2\53\3\0\14\53\2\264\25\53\13\0\1\53"+ + "\1\0\5\53\1\0\2\53\2\265\12\53\1\0\2\266"+ + "\3\0\2\213\2\53\2\267\6\53\2\270\25\53\13\0"+ + "\1\53\1\0\5\53\1\0\2\53\2\271\12\53\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\2\53\2\272\12\53\1\0\2\53\3\0\43\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\2\53\2\273\6\53\2\274\14\53\2\270\11\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\6\53\2\275\33\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\4\53\2\213\35\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\276\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\14\53\2\277"+ + "\1\0\2\300\3\0\43\53\13\0\1\53\1\0\5\53"+ + "\1\0\6\53\2\301\4\53\2\302\1\0\2\53\3\0"+ + "\2\213\32\53\1\213\6\53\13\0\1\53\1\0\5\53"+ + "\1\0\16\53\1\0\2\53\3\0\30\53\2\300\11\53"+ + "\17\0\1\100\4\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\2\0\1\100\4\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\1\0\1\100"+ + "\1\0\1\100\1\0\1\100\1\0\1\100\2\0\1\100"+ + "\1\0\1\100\1\0\1\100\3\0\1\303\15\0\1\304"+ + "\61\0\1\304\13\0\1\304\5\102\1\305\111\102\1\305"+ + "\1\306\103\102\36\105\1\307\61\105\1\310\27\105\1\307"+ + "\53\105\5\0\1\110\1\0\5\110\1\0\4\110\2\311"+ + "\10\110\1\0\2\110\2\0\1\111\10\110\2\312\31\110"+ + "\13\0\1\110\1\0\5\110\1\0\6\110\2\313\6\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\2\164"+ + "\2\314\37\110\13\0\1\110\1\0\1\110\2\315\2\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\2\316\2\317\12\110\1\0"+ + "\2\110\2\0\1\111\4\110\2\320\4\110\2\321\14\110"+ + "\2\322\11\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\4\110\2\323\35\110\13\0"+ + "\1\110\1\0\5\110\1\0\14\110\2\324\1\0\2\325"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\6\110\2\326\6\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\14\110\2\327\1\0"+ + "\2\330\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\12\110\2\326\2\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\35\110\2\331\4\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\332\4\110\2\333\33\110\13\0\1\110\1\0\5\110"+ + "\1\0\2\110\2\334\12\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\4\110\2\335"+ + "\10\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\4\110\2\336\2\337\6\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\4\110\2\340\10\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\6\110\2\164"+ + "\6\110\1\0\2\110\2\0\1\111\14\110\2\341\25\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\6\110\2\157\33\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\14\110"+ + "\2\342\25\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\37\110\2\343\2\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\344\2\0"+ + "\1\111\4\110\2\164\20\110\2\164\13\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\4\110\2\345\35\110\13\0\1\110\1\0\5\110\1\0"+ + "\2\110\2\123\12\110\1\0\2\110\2\0\1\111\2\346"+ + "\30\110\2\347\7\110\13\0\1\110\1\0\5\110\1\0"+ + "\10\110\2\350\4\110\1\0\2\351\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\352"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\4\110\2\353\35\110"+ + "\13\0\1\110\1\0\5\110\1\0\4\110\2\164\10\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\41\110"+ + "\2\326\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\30\110\2\354\11\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\123\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\12\110\2\355\23\110\2\356\2\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\12\110\2\357\27\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\12\110"+ + "\2\360\27\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\2\361\41\110\13\0\1\110"+ + "\1\0\5\110\1\0\4\110\2\362\10\110\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\4\110\2\363\10\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\2\164\41\110\13\0\1\110\1\0\5\110"+ + "\1\0\4\110\2\326\10\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\163\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\32\110\2\364"+ + "\3\110\2\365\2\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\30\110\2\326\11\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\303\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\30\110\2\202\11\110"+ + "\13\0\1\110\1\0\5\110\1\0\6\110\2\366\6\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\4\110"+ + "\2\164\35\110\13\0\1\110\1\0\5\110\1\0\14\110"+ + "\2\165\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\367\41\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\4\110\2\370\35\110\13\0"+ + "\1\110\1\0\5\110\1\0\12\110\2\371\2\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\14\110\2\153"+ + "\25\110\13\0\1\110\1\0\5\110\1\0\6\110\2\372"+ + "\6\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\373\33\110\2\374\4\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\4\110\2\375"+ + "\35\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\376\2\0\1\111\14\110\2\377\25\110\13\0\1\110"+ + "\1\0\5\110\1\0\14\110\2\u0100\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\u0101\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\2\u0102\14\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\u0103\123\0\2\u0104\112\0\2\u0105\74\0"+ + "\1\212\1\0\5\212\1\0\16\212\1\0\2\212\3\0"+ + "\43\212\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\12\53\2\213\27\53\13\0\1\53\1\0"+ + "\5\53\1\0\16\53\1\0\2\53\3\0\2\213\24\53"+ + "\2\213\13\53\13\0\1\53\1\0\5\53\1\0\6\53"+ + "\2\u0106\6\53\1\0\2\53\3\0\43\53\13\0\1\53"+ + "\1\0\5\53\1\0\2\227\14\53\1\0\2\53\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\12\53\2\u0107\27\53\13\0\1\53\1\0"+ + "\5\53\1\0\12\53\2\216\2\53\1\0\2\53\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\6\53\2\227"+ + "\6\53\1\0\2\53\3\0\43\53\13\0\1\53\1\0"+ + "\5\53\1\0\16\53\1\0\2\53\3\0\35\53\2\u0108"+ + "\4\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\6\53\2\u0109\33\53\13\0\1\53\1\0"+ + "\5\53\1\0\6\53\2\u0109\6\53\1\0\2\53\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\2\u010a\41\53\13\0\1\53\1\0\5\53"+ + "\1\0\14\53\2\213\1\0\2\53\3\0\43\53\13\0"+ + "\1\53\1\0\5\53\1\0\2\u010b\14\53\1\0\2\53"+ + "\3\0\43\53\13\0\1\53\1\0\5\53\1\0\12\53"+ + "\2\u010c\2\53\1\0\2\53\3\0\43\53\13\0\1\53"+ + "\1\0\5\53\1\0\14\53\2\u010d\1\0\2\53\3\0"+ + "\43\53\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\2\u0110\4\233\2\u0110\6\233"+ + "\1\0\2\233\3\0\4\233\2\u0110\2\233\2\u0111\2\233"+ + "\2\u0112\25\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\12\233\2\u0113\2\233\1\0\2\233\3\0\4\233"+ + "\2\u0110\35\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\2\233\2\u0114\10\233\2\u0115\1\0\2\u0116\3\0"+ + "\14\233\2\u0117\25\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\2\u0110\4\233\2\u0110\4\233\2\u0118\1\0"+ + "\2\u0119\3\0\2\u0110\12\233\2\u011a\14\233\2\u0110\7\233"+ + "\7\0\2\u011b\2\0\1\233\1\u011c\5\233\1\0\16\233"+ + "\1\0\2\u011d\3\0\2\u011e\41\233\7\0\2\u011b\2\0"+ + "\1\233\1\u011c\5\233\1\0\2\u011f\10\233\2\u0120\2\233"+ + "\1\0\2\233\3\0\2\u0121\41\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\4\233\2\u0122\2\u0123\2\233"+ + "\2\u0124\2\u0125\1\0\2\255\3\0\24\233\2\u0126\2\233"+ + "\2\u0127\11\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\14\233\2\u0128\25\233"+ + "\7\0\2\u011b\2\0\1\233\1\u011c\5\233\1\0\2\233"+ + "\2\u0129\12\233\1\0\2\u012a\3\0\2\u0110\2\233\2\u012b"+ + "\6\233\2\u012c\25\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\2\233\2\u012d\12\233\1\0\2\233\3\0"+ + "\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\2\233\2\u012e\12\233\1\0\2\233\3\0\43\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\2\233\2\u012f\6\233\2\u0130\14\233\2\u012c"+ + "\11\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\6\233\2\u0131\33\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\4\233\2\u0110\35\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\u0132\3\0"+ + "\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\14\233\2\u0133\1\0\2\u0134\3\0\43\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\6\233\2\u0135\4\233"+ + "\2\u0136\1\0\2\233\3\0\2\u0110\32\233\1\u0110\6\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\30\233\2\u0134\11\233\13\0\1\53"+ + "\1\0\5\53\1\0\16\53\1\0\2\53\3\0\2\u0137"+ + "\41\53\13\0\1\53\1\0\5\53\1\0\10\53\2\u0109"+ + "\4\53\1\0\2\53\3\0\2\u0138\41\53\13\0\1\53"+ + "\1\0\5\53\1\0\16\53\1\0\2\214\3\0\43\53"+ + "\13\0\1\53\1\0\5\53\1\0\16\53\1\0\2\53"+ + "\3\0\4\53\2\u0139\35\53\13\0\1\53\1\0\5\53"+ + "\1\0\12\53\2\213\2\53\1\0\2\53\3\0\6\53"+ + "\2\213\33\53\13\0\1\53\1\0\5\53\1\0\16\53"+ + "\1\0\2\u013a\3\0\43\53\13\0\1\53\1\0\5\53"+ + "\1\0\16\53\1\0\2\53\3\0\12\53\2\u013b\27\53"+ + "\13\0\1\53\1\0\5\53\1\0\2\u013c\14\53\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\2\53\2\u013d\37\53\13\0"+ + "\1\53\1\0\5\53\1\0\2\53\2\u013e\12\53\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\16\53\2\213\23\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\2\u013f\10\53\2\u0140\27\53\13\0\1\53\1\0\5\53"+ + "\1\0\16\53\1\0\2\53\3\0\2\53\2\u0141\37\53"+ + "\13\0\1\53\1\0\5\53\1\0\16\53\1\0\2\53"+ + "\3\0\14\53\2\u0142\25\53\13\0\1\53\1\0\5\53"+ + "\1\0\12\53\2\u0143\2\53\1\0\2\53\3\0\43\53"+ + "\13\0\1\53\1\0\5\53\1\0\2\213\14\53\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\2\213\41\53\13\0\1\53"+ + "\1\0\5\53\1\0\6\53\2\u010d\6\53\1\0\2\53"+ + "\3\0\12\53\2\u0144\27\53\13\0\1\53\1\0\5\53"+ + "\1\0\12\53\2\213\2\53\1\0\2\53\3\0\43\53"+ + "\13\0\1\53\1\0\5\53\1\0\16\53\1\0\2\53"+ + "\3\0\30\53\2\73\11\53\13\0\1\53\1\0\5\53"+ + "\1\0\16\53\1\0\2\275\3\0\43\53\21\0\1\304"+ + "\61\0\1\304\11\0\1\303\1\0\1\304\5\102\1\305"+ + "\1\u0145\103\102\6\105\1\u0145\27\105\1\307\53\105\5\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\4\110\2\u0146\35\110\13\0\1\110\1\0\5\110"+ + "\1\0\14\110\2\157\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\14\110\2\u0147\1\0"+ + "\2\164\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\u0148\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\14\110\2\u0149\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\14\110\2\u014a\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\2\u014b\41\110\13\0\1\110\1\0\5\110\1\0"+ + "\2\110\2\157\12\110\1\0\2\110\2\0\1\111\2\110"+ + "\2\u014c\37\110\13\0\1\110\1\0\5\110\1\0\6\110"+ + "\2\u014d\6\110\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\12\110\2\u014e\2\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\4\110\2\u014f"+ + "\35\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\157\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\2\110\2\u0150"+ + "\37\110\13\0\1\110\1\0\5\110\1\0\14\110\2\164"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\4\110\2\u0151\10\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\2\u0152\41\110\13\0\1\110"+ + "\1\0\5\110\1\0\6\110\2\164\6\110\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\16\110\2\u0153\23\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\14\110\2\u0154\25\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\10\110"+ + "\2\u0155\16\110\2\u0156\11\110\13\0\1\110\1\0\5\110"+ + "\1\0\6\110\2\u0157\6\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\14\110\2\u0158"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\14\110"+ + "\2\u0159\25\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\32\110\2\u015a\7\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\12\110\2\360\2\110\2\352\23\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\110\2\164\37\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\2\110\2\u014c\37\110"+ + "\13\0\1\110\1\0\5\110\1\0\2\u015b\14\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\14\110\2\342\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\2\110\2\u015c\12\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\14\110\2\163\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\4\110\2\326\35\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\331\10\110\2\u015d\27\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\12\110\2\164"+ + "\27\110\13\0\1\110\1\0\5\110\1\0\14\110\2\u015e"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\30\110"+ + "\2\u015f\11\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\16\110\2\u0160\23\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\2\110\2\u0161\37\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\16\110\2\u0162"+ + "\23\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\20\110\2\164\21\110\13\0\1\110"+ + "\1\0\5\110\1\0\2\u0163\14\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\20\110\2\u0164\21\110\13\0"+ + "\1\110\1\0\5\110\1\0\2\110\2\u0165\12\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\2\u0166\41\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\2\202\41\110\13\0\1\110\1\0\5\110"+ + "\1\0\6\110\2\312\6\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\2\110\2\337\37\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\14\110\2\u0167\6\110\2\u0168\15\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\160\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\32\110\2\u0169\7\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\16\110"+ + "\2\u016a\23\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\4\110\2\u016b\35\110\13\0"+ + "\1\110\1\0\5\110\1\0\6\110\2\u016c\6\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\2\u016d\14\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\16\110\2\u016e\23\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\10\110"+ + "\2\u016f\31\110\13\0\1\110\1\0\5\110\1\0\12\110"+ + "\2\164\2\110\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\6\110\2\u0170\6\110\1\0"+ + "\2\110\2\0\1\111\43\110\27\0\2\u0171\104\0\2\u0172"+ + "\100\0\1\53\1\0\5\53\1\0\16\53\1\0\2\53"+ + "\3\0\14\53\2\u0173\25\53\13\0\1\53\1\0\5\53"+ + "\1\0\6\53\2\u0174\6\53\1\0\2\53\3\0\43\53"+ + "\13\0\1\53\1\0\5\53\1\0\6\53\2\u0175\6\53"+ + "\1\0\2\53\3\0\43\53\13\0\1\53\1\0\5\53"+ + "\1\0\16\53\1\0\2\53\3\0\4\53\2\227\35\53"+ + "\13\0\1\53\1\0\5\53\1\0\16\53\1\0\2\u013f"+ + "\3\0\43\53\13\0\1\53\1\0\5\53\1\0\16\53"+ + "\1\0\2\53\3\0\2\u0176\41\53\13\0\1\53\1\0"+ + "\5\53\1\0\16\53\1\0\2\53\3\0\4\53\2\u0177"+ + "\35\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\213\3\0\43\53\7\0\2\u010e\3\0\1\u010f\104\0"+ + "\2\u011b\2\0\1\233\1\u011c\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\233\3\0\12\233\2\u0110"+ + "\27\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\2\u0110\24\233\2\u0110\13\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\6\233"+ + "\2\u0178\6\233\1\0\2\233\3\0\43\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\2\u011e\14\233\1\0"+ + "\2\233\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\233\3\0\12\233\2\u0179"+ + "\27\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\12\233\2\u0113\2\233\1\0\2\233\3\0\43\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\6\233\2\u011e"+ + "\6\233\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0"+ + "\35\233\2\u017a\4\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\233\3\0\6\233\2\u017b"+ + "\33\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\6\233\2\u017b\6\233\1\0\2\233\3\0\43\233\7\0"+ + "\2\u011b\3\0\1\u011c\104\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\233\3\0\2\u017c\41\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\14\233"+ + "\2\u0110\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\2\u017d\14\233\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\12\233\2\u017e\2\233\1\0\2\233\3\0\43\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\14\233"+ + "\2\u017f\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0"+ + "\2\u0180\41\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\10\233\2\u017b\4\233\1\0\2\233\3\0\2\u0181"+ + "\41\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\u0111\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0"+ + "\4\233\2\u0182\35\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\12\233\2\u0110\2\233\1\0\2\233\3\0"+ + "\6\233\2\u0110\33\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\u0183\3\0\43\233\7\0"+ + "\2\u011b\2\0\1\233\1\u011c\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\12\233\2\u0184\27\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\2\u0185\14\233\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\2\233\2\u0186\37\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\2\233"+ + "\2\u0187\12\233\1\0\2\233\3\0\43\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233"+ + "\3\0\16\233\2\u0110\23\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0\2\u0188"+ + "\10\233\2\u0189\27\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\233\3\0\2\233\2\u018a"+ + "\37\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\14\233\2\u018b\25\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\12\233\2\u018c"+ + "\2\233\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\2\u0110\14\233\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\2\u0110\41\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\6\233\2\u017f"+ + "\6\233\1\0\2\233\3\0\12\233\2\u018d\27\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\12\233\2\u0110"+ + "\2\233\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0"+ + "\30\233\2\251\11\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\16\233\1\0\2\u0131\3\0\43\233\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\14\53\2\u018e\25\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\14\53\2\u018f\25\53\13\0"+ + "\1\53\1\0\5\53\1\0\14\53\2\u0190\1\0\2\53"+ + "\3\0\43\53\13\0\1\53\1\0\5\53\1\0\16\53"+ + "\1\0\2\53\3\0\4\53\2\73\35\53\13\0\1\53"+ + "\1\0\5\53\1\0\16\53\1\0\2\53\3\0\20\53"+ + "\2\213\21\53\13\0\1\53\1\0\5\53\1\0\10\53"+ + "\2\213\4\53\1\0\2\53\3\0\43\53\13\0\1\53"+ + "\1\0\5\53\1\0\14\53\2\u0191\1\0\2\53\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\4\53\2\u0192"+ + "\10\53\1\0\2\53\3\0\43\53\13\0\1\53\1\0"+ + "\5\53\1\0\16\53\1\0\2\53\3\0\30\53\2\213"+ + "\11\53\13\0\1\53\1\0\5\53\1\0\6\53\2\213"+ + "\6\53\1\0\2\53\3\0\43\53\13\0\1\53\1\0"+ + "\5\53\1\0\4\53\2\256\10\53\1\0\2\53\3\0"+ + "\43\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\12\53\2\u0193\27\53\13\0\1\53\1\0"+ + "\5\53\1\0\16\53\1\0\2\53\3\0\24\53\2\u0140"+ + "\15\53\13\0\1\53\1\0\5\53\1\0\16\53\1\0"+ + "\2\53\3\0\24\53\2\213\15\53\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\u0194\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\6\110\2\u0195\6\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\6\110"+ + "\2\u0196\33\110\13\0\1\110\1\0\5\110\1\0\4\110"+ + "\2\331\10\110\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\6\110\2\u0157\6\110\1\0"+ + "\2\110\2\0\1\303\6\110\2\u0197\33\110\13\0\1\110"+ + "\1\0\5\110\1\0\2\342\14\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\12\110"+ + "\2\143\2\110\1\0\2\110\2\0\1\303\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\14\110\2\u0198\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\u0149\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\12\110\2\u0199\2\110\1\0\2\110"+ + "\2\0\1\111\2\110\2\u019a\37\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\2\110"+ + "\2\u019b\37\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\20\110\2\u019c\21\110\13\0"+ + "\1\110\1\0\5\110\1\0\2\110\2\u019d\12\110\1\0"+ + "\2\110\2\0\1\303\2\110\2\u0153\37\110\13\0\1\110"+ + "\1\0\5\110\1\0\14\110\2\331\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\12\110\2\u019e\27\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\14\110\2\350\25\110\13\0\1\110\1\0\5\110"+ + "\1\0\12\110\2\331\2\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\10\110\2\123"+ + "\4\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\12\110\2\331\2\110\1\0\2\110"+ + "\2\0\1\111\2\110\2\u019f\37\110\13\0\1\110\1\0"+ + "\5\110\1\0\2\110\2\352\12\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\14\110\2\u01a0\25\110\13\0"+ + "\1\110\1\0\5\110\1\0\2\110\2\u01a1\12\110\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\4\110\2\u01a2"+ + "\35\110\13\0\1\110\1\0\5\110\1\0\2\u01a3\14\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\4\110\2\u01a4\10\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\u01a5\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\2\u01a6\14\110\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\2\145\41\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\303\24\110"+ + "\2\u01a7\15\110\13\0\1\110\1\0\5\110\1\0\14\110"+ + "\2\u01a8\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\16\110\2\u01a9\23\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\4\110\2\u01aa\35\110"+ + "\13\0\1\110\1\0\5\110\1\0\14\110\2\u01ab\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\16\110\2\352"+ + "\23\110\13\0\1\110\1\0\5\110\1\0\14\110\2\u01ac"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\2\110\2\u01ad\12\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\14\110\2\u01ae\25\110\13\0"+ + "\1\110\1\0\5\110\1\0\14\110\2\u01af\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\14\110\2\u01b0\25\110"+ + "\13\0\1\110\1\0\5\110\1\0\14\110\2\u01b1\1\0"+ + "\2\110\2\0\1\111\43\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\32\110\2\331"+ + "\7\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\303\4\110\2\u01b2\35\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\32\110\2\164\7\110\31\0\2\u01b3\121\0\2\u01b4\61\0"+ + "\1\53\1\0\5\53\1\0\2\53\2\214\12\53\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\14\53\2\276\1\0\2\53\3\0\43\53\13\0\1\53"+ + "\1\0\5\53\1\0\16\53\1\0\2\u01b5\3\0\43\53"+ + "\13\0\1\53\1\0\5\53\1\0\14\53\2\u01b6\1\0"+ + "\2\53\3\0\43\53\13\0\1\53\1\0\5\53\1\0"+ + "\14\53\2\u0140\1\0\2\53\3\0\43\53\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233"+ + "\3\0\14\233\2\u01b7\25\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\6\233\2\u01b8\6\233\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\6\233\2\u01b9\6\233\1\0\2\233\3\0\43\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\4\233\2\u011e\35\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0\2\u0188"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\2\u01ba\41\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\4\233\2\u01bb\35\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\u0110\3\0"+ + "\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\14\233\2\u01bc\25\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\14\233\2\u01bd\25\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\14\233\2\u01be\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\4\233\2\251\35\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\20\233\2\u0110\21\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\10\233\2\u0110\4\233"+ + "\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\14\233\2\u01bf\1\0\2\233\3\0"+ + "\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\4\233\2\u01c0\10\233\1\0\2\233\3\0\43\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\30\233\2\u0110\11\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\6\233\2\u0110\6\233\1\0"+ + "\2\233\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\4\233\2\u0122\10\233\1\0\2\233\3\0"+ + "\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0"+ + "\16\233\1\0\2\233\3\0\12\233\2\u01c1\27\233\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\24\233\2\u0189\15\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0"+ + "\24\233\2\u0110\15\233\13\0\1\53\1\0\5\53\1\0"+ + "\12\53\2\u0140\2\53\1\0\2\53\3\0\43\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\20\53\2\227\21\53\13\0\1\53\1\0\5\53\1\0"+ + "\4\53\2\u0140\10\53\1\0\2\53\3\0\43\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\10\53\2\u01c2\31\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\20\53\2\u01c3\21\53\13\0"+ + "\1\53\1\0\5\53\1\0\2\u01c4\14\53\1\0\2\53"+ + "\3\0\43\53\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\2\326\41\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\14\110\2\163\25\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\4\110\2\u019c\35\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\u01c5"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\12\110\2\331\27\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\u01c6"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\12\110\2\u01c7\2\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\303\14\110\2\u01ad\25\110\13\0\1\110\1\0"+ + "\5\110\1\0\14\110\2\u01ad\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\10\110\2\u01ab\31\110\13\0\1\110"+ + "\1\0\5\110\1\0\2\u01c8\14\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\2\110\2\u01c9\37\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\26\110\2\326\13\110\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\12\110\2\u01ca"+ + "\27\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\4\110\2\u01cb\35\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\6\110\2\u01cc\33\110\13\0\1\110\1\0\5\110\1\0"+ + "\6\110\2\u019c\6\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\2\u01cc\41\110\13\0\1\110\1\0\5\110"+ + "\1\0\14\110\2\u01cd\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\u01ce"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\2\u01cf\41\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\2\u01d0\41\110\13\0\1\110\1\0\5\110\1\0"+ + "\2\110\2\157\12\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\10\110\2\164\31\110\13\0\1\110\1\0"+ + "\5\110\1\0\6\110\2\u0157\6\110\1\0\2\110\2\0"+ + "\1\303\43\110\13\0\1\110\1\0\5\110\1\0\2\164"+ + "\14\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\12\110\2\u01d1\27\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\12\110\2\u01d2\27\110"+ + "\13\0\1\110\1\0\5\110\1\0\12\110\2\350\2\110"+ + "\1\0\2\110\2\0\1\111\43\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\2\342"+ + "\41\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\u01d3\2\0\1\111\43\110\33\0\2\u01d4\106\0\2\u01d5"+ + "\72\0\1\53\1\0\5\53\1\0\16\53\1\0\2\53"+ + "\3\0\2\232\41\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\2\53\2\u01d6\37\53\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\2\233\2\u0111"+ + "\12\233\1\0\2\233\3\0\43\233\7\0\2\u010e\2\0"+ + "\1\233\1\u010f\5\233\1\0\14\233\2\u0132\1\0\2\233"+ + "\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\u01d7\3\0\43\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\14\233\2\u01d8\1\0"+ + "\2\233\3\0\43\233\7\0\2\u010e\2\0\1\233\1\u010f"+ + "\5\233\1\0\14\233\2\u0189\1\0\2\233\3\0\43\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\12\233"+ + "\2\u0189\2\233\1\0\2\233\3\0\43\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233"+ + "\3\0\20\233\2\u011e\21\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\4\233\2\u0189\10\233\1\0\2\233"+ + "\3\0\43\233\7\0\2\u011b\2\0\1\233\1\u011c\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\10\233\2\u01d9\31\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\20\233\2\u01da\21\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\2\u01db\14\233\1\0"+ + "\2\233\3\0\43\233\13\0\1\53\1\0\5\53\1\0"+ + "\2\53\2\u01dc\12\53\1\0\2\53\3\0\43\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\22\53\2\u01dd\17\53\13\0\1\53\1\0\5\53\1\0"+ + "\14\53\2\u01de\1\0\2\53\3\0\43\53\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\2\110\2\326\37\110\13\0\1\110\1\0\5\110\1\0"+ + "\2\u01df\14\110\1\0\2\110\2\0\1\111\43\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\u01e0\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\14\110"+ + "\2\u01e1\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\20\110\2\u01e2\21\110\13\0\1\110\1\0\5\110\1\0"+ + "\16\110\1\0\2\110\2\0\1\111\4\110\2\u01cc\35\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\14\110\2\u01d3\25\110\13\0\1\110\1\0"+ + "\5\110\1\0\10\110\2\164\4\110\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\2\110\2\145\37\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\16\110\2\326\23\110\13\0\1\110\1\0\5\110"+ + "\1\0\4\110\2\363\10\110\1\0\2\110\2\0\1\303"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\2\110\2\u01e3"+ + "\12\110\1\0\2\110\2\0\1\111\43\110\13\0\1\110"+ + "\1\0\5\110\1\0\16\110\1\0\2\110\2\0\1\111"+ + "\32\110\2\u01e4\3\110\2\u01e5\2\110\13\0\1\110\1\0"+ + "\5\110\1\0\16\110\1\0\2\110\2\0\1\111\16\110"+ + "\2\u0102\23\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\12\110\2\u01e6\27\110\35\0"+ + "\2\u01e7\115\0\2\u01e8\61\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\2\53\2\213\37\53\7\0"+ + "\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0"+ + "\2\233\3\0\2\u0121\41\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0\2\233"+ + "\2\u01e9\37\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\2\233\2\u01ea\12\233\1\0\2\233\3\0\43\233"+ + "\7\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\22\233\2\u01eb\17\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\14\233\2\u01ec\1\0"+ + "\2\233\3\0\43\233\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\12\53\2\u0140\27\53\13\0"+ + "\1\53\1\0\5\53\1\0\16\53\1\0\2\53\3\0"+ + "\24\53\2\u01ed\15\53\13\0\1\53\1\0\5\53\1\0"+ + "\16\53\1\0\2\53\3\0\35\53\2\213\4\53\13\0"+ + "\1\110\1\0\5\110\1\0\2\u01cb\14\110\1\0\2\110"+ + "\2\0\1\111\43\110\13\0\1\110\1\0\5\110\1\0"+ + "\4\110\2\u01cb\10\110\1\0\2\110\2\0\1\111\43\110"+ + "\13\0\1\110\1\0\5\110\1\0\16\110\1\0\2\110"+ + "\2\0\1\111\35\110\2\164\4\110\13\0\1\110\1\0"+ + "\5\110\1\0\14\110\2\u01cc\1\0\2\110\2\0\1\111"+ + "\43\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\24\110\2\u01ee\15\110\13\0\1\110"+ + "\1\0\5\110\1\0\14\110\2\u01ef\1\0\2\110\2\0"+ + "\1\111\43\110\13\0\1\110\1\0\5\110\1\0\16\110"+ + "\1\0\2\110\2\0\1\111\14\110\2\203\25\110\13\0"+ + "\1\110\1\0\5\110\1\0\16\110\1\0\2\110\2\0"+ + "\1\111\16\110\2\164\23\110\37\0\2\u01f0\112\0\1\u01f1"+ + "\57\0\2\u010e\2\0\1\233\1\u010f\5\233\1\0\16\233"+ + "\1\0\2\233\3\0\2\233\2\u0110\37\233\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\16\233\1\0\2\233"+ + "\3\0\12\233\2\u0189\27\233\7\0\2\u010e\2\0\1\233"+ + "\1\u010f\5\233\1\0\16\233\1\0\2\233\3\0\24\233"+ + "\2\u01f2\15\233\7\0\2\u010e\2\0\1\233\1\u010f\5\233"+ + "\1\0\16\233\1\0\2\233\3\0\35\233\2\u0110\4\233"+ + "\13\0\1\53\1\0\5\53\1\0\2\53\2\222\12\53"+ + "\1\0\2\53\3\0\43\53\13\0\1\110\1\0\5\110"+ + "\1\0\16\110\1\0\2\110\2\0\1\111\12\110\2\u01ad"+ + "\27\110\13\0\1\110\1\0\5\110\1\0\16\110\1\0"+ + "\2\110\2\0\1\111\14\110\2\377\25\110\7\0\2\u010e"+ + "\2\0\1\233\1\u010f\5\233\1\0\2\233\2\u0117\12\233"+ + "\1\0\2\233\3\0\43\233\6\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[35372]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\1\1\11\6\1\1\11\32\1\1\11\1\0"+ + "\1\1\1\0\6\1\1\0\14\1\11\0\1\11\23\0"+ + "\1\11\47\0\1\11\4\0\21\1\23\0\25\1\1\11"+ + "\2\0\1\11\1\0\1\11\72\0\1\11\2\0\10\1"+ + "\1\0\1\11\14\0\1\11\32\0\16\1\1\11\55\0"+ + "\5\1\26\0\6\1\41\0\2\1\13\0\3\1\21\0"+ + "\1\1\5\0\3\1\16\0\1\1\2\0\2\11\1\0"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[498]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XHTMLLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte TAG_OPEN = 1; + private static final byte TAG_CLOSE = -1; + + private static final byte INSTR_OPEN = 2; + private static final byte INSTR_CLOSE = -2; + + private static final byte CDATA_OPEN = 3; + private static final byte CDATA_CLOSE = -3; + + private static final byte COMMENT_OPEN = 4; + private static final byte COMMENT_CLOSE = -4; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public XHTMLLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public XHTMLLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 256) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 14: + { return token(TokenType.KEYWORD, TAG_CLOSE); + } + case 19: break; + case 11: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT2, COMMENT_CLOSE); + } + case 20: break; + case 7: + { yybegin(YYINITIAL); + return token(TokenType.KEYWORD, TAG_CLOSE); + } + case 21: break; + case 4: + { yybegin(TAG); + return token(TokenType.KEYWORD, TAG_OPEN); + } + case 22: break; + case 8: + { return token(TokenType.STRING); + } + case 23: break; + case 15: + { return token(TokenType.KEYWORD2, TAG_CLOSE); + } + case 24: break; + case 2: + { yybegin(YYINITIAL); + return token(TokenType.KEYWORD); + } + case 25: break; + case 6: + { return token(TokenType.IDENTIFIER); + } + case 26: break; + case 10: + { return token(TokenType.KEYWORD2); + } + case 27: break; + case 9: + { yybegin(INSTR); + return token(TokenType.TYPE2, INSTR_OPEN); + } + case 28: break; + case 13: + { yybegin(COMMENT); + return token(TokenType.COMMENT2, COMMENT_OPEN); + } + case 29: break; + case 5: + { yybegin(TAG); + return token(TokenType.KEYWORD2, TAG_OPEN); + } + case 30: break; + case 18: + { yybegin(CDATA); + return token(TokenType.COMMENT2, CDATA_OPEN); + } + case 31: break; + case 16: + { yypushback(3); + return token(TokenType.COMMENT); + } + case 32: break; + case 17: + { yybegin(DOCTYPE); + return token(TokenType.TYPE2, INSTR_OPEN); + } + case 33: break; + case 3: + { yybegin(YYINITIAL); + return token(TokenType.TYPE2, INSTR_CLOSE); + } + case 34: break; + case 1: + { + } + case 35: break; + case 12: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT2, CDATA_CLOSE); + } + case 36: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + switch (zzLexicalState) { + case INSTR: { + return null; + } + case 499: break; + case YYINITIAL: { + return null; + } + case 500: break; + case COMMENT: { + return null; + } + case 501: break; + case CDATA: { + return null; + } + case 502: break; + case TAG: { + return null; + } + case 503: break; + default: + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XPathLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XPathLexer.java new file mode 100644 index 000000000..c0032e185 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XPathLexer.java @@ -0,0 +1,1383 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This flex file originally donated to the project by HeyChinaski + * + */ + +package jsyntaxpane.lexers; + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xpath.flex + */ +public final class XPathLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int STRING_SINGLE = 4; + public static final int YYINITIAL = 0; + public static final int STRING_DOUBLE = 2; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\55\1\13\2\0\1\12\22\0\1\55\1\37\1\64\1\0"+ + "\1\11\2\0\1\65\1\56\1\57\1\10\1\35\1\35\1\5\1\6"+ + "\1\34\12\1\1\7\1\0\1\40\1\36\1\40\1\0\1\35\15\2"+ + "\1\54\2\2\1\53\2\2\1\52\6\2\1\62\1\0\1\63\1\0"+ + "\1\2\1\0\1\32\1\43\1\14\1\31\1\17\1\41\1\27\1\44"+ + "\1\26\1\46\1\51\1\42\1\16\1\20\1\15\1\23\1\45\1\24"+ + "\1\25\1\21\1\30\1\33\1\50\1\22\1\3\1\47\1\60\1\35"+ + "\1\61\71\0\1\4\10\0\27\2\1\0\37\2\1\0\10\2\62\2"+ + "\2\4\13\2\2\4\10\2\1\4\65\2\1\4\104\2\11\4\44\2"+ + "\3\4\2\2\4\4\36\2\70\4\131\2\22\4\7\2\76\4\160\4"+ + "\16\4\1\0\7\4\1\2\1\4\3\2\1\4\1\2\1\4\24\2"+ + "\1\4\54\2\1\4\7\2\3\4\1\2\1\4\1\2\1\4\1\2"+ + "\1\4\1\2\1\4\22\2\15\4\14\2\1\4\102\2\1\4\14\2"+ + "\1\4\44\2\16\4\65\2\2\4\2\2\2\4\2\2\3\4\34\2"+ + "\2\4\10\2\2\4\2\2\67\4\46\2\2\4\1\2\7\4\46\2"+ + "\111\4\33\2\5\4\3\2\56\4\32\2\6\4\12\2\46\4\107\2"+ + "\2\4\5\2\1\4\17\2\1\4\4\2\1\4\1\2\17\4\2\2"+ + "\u021e\4\65\2\3\4\1\2\32\4\12\2\43\4\10\2\2\4\2\2"+ + "\2\4\26\2\1\4\7\2\1\4\1\2\3\4\4\2\42\4\2\2"+ + "\1\4\3\2\16\4\2\2\23\4\6\2\4\4\2\2\2\4\26\2"+ + "\1\4\7\2\1\4\2\2\1\4\2\2\1\4\2\2\37\4\4\2"+ + "\1\4\1\2\23\4\3\2\20\4\7\2\1\4\1\2\1\4\3\2"+ + "\1\4\26\2\1\4\7\2\1\4\2\2\1\4\5\2\3\4\1\2"+ + "\42\4\1\2\44\4\10\2\2\4\2\2\2\4\26\2\1\4\7\2"+ + "\1\4\2\2\2\4\4\2\3\4\1\2\36\4\2\2\1\4\3\2"+ + "\43\4\6\2\3\4\3\2\1\4\4\2\3\4\2\2\1\4\1\2"+ + "\1\4\2\2\3\4\2\2\3\4\3\2\3\4\10\2\1\4\3\2"+ + "\113\4\10\2\1\4\3\2\1\4\27\2\1\4\12\2\1\4\5\2"+ + "\46\4\2\2\43\4\10\2\1\4\3\2\1\4\27\2\1\4\12\2"+ + "\1\4\5\2\44\4\1\2\1\4\2\2\43\4\10\2\1\4\3\2"+ + "\1\4\27\2\1\4\20\2\46\4\2\2\237\4\56\2\1\4\1\2"+ + "\1\4\2\2\14\4\6\2\73\4\2\2\1\4\1\2\2\4\2\2"+ + "\1\4\1\2\2\4\1\2\6\4\4\2\1\4\7\2\1\4\3\2"+ + "\1\4\1\2\1\4\1\2\2\4\2\2\1\4\2\2\1\4\1\2"+ + "\1\4\2\2\11\4\1\2\2\4\5\2\173\4\10\2\1\4\41\2"+ + "\u0136\4\46\2\12\4\47\2\11\4\1\2\1\4\2\2\1\4\3\2"+ + "\1\4\1\2\1\4\2\2\1\4\5\2\51\4\1\2\1\4\1\2"+ + "\1\4\1\2\13\4\1\2\1\4\1\2\1\4\1\2\3\4\2\2"+ + "\3\4\1\2\5\4\3\2\1\4\1\2\1\4\1\2\1\4\1\2"+ + "\1\4\1\2\3\4\2\2\3\4\2\2\1\4\1\2\50\4\1\2"+ + "\11\4\1\2\2\4\1\2\2\4\2\2\7\4\2\2\1\4\1\2"+ + "\1\4\7\2\50\4\1\2\4\4\1\2\10\4\1\2\u0c06\4\234\2"+ + "\4\4\132\2\6\4\26\2\2\4\6\2\2\4\46\2\2\4\6\2"+ + "\2\4\10\2\1\4\1\2\1\4\1\2\1\4\1\2\1\4\37\2"+ + "\2\4\65\2\1\4\7\2\1\4\1\2\3\4\3\2\1\4\7\2"+ + "\3\4\4\2\2\4\6\2\4\4\15\2\5\4\3\2\1\4\7\2"+ + "\3\4\14\0\2\4\61\0\2\4\57\0\266\4\1\2\3\4\2\2"+ + "\2\4\1\2\121\4\3\2\15\4\u0a70\0\u03f0\4\21\0\6\4\1\2"+ + "\31\4\11\2\27\4\124\2\14\4\132\2\12\4\50\2\u1cd3\4\u51a6\2"+ + "\u0c5a\4\u2ba4\2\134\4\u2100\0\u04d0\4\40\0\u020e\4\2\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\1\1\1\2\2\3\2\4\1\5\1\1\2\5"+ + "\15\3\1\4\1\1\1\4\6\3\1\6\1\7\1\10"+ + "\1\11\1\12\1\13\1\14\1\15\1\16\1\17\2\0"+ + "\7\3\1\4\32\3\1\20\25\3\1\2\3\3\1\0"+ + "\12\3\1\20\1\3\1\20\46\3\1\20\45\3\1\21"+ + "\2\3\1\20\1\3\1\21\14\3\1\22\64\3\1\20"+ + "\57\3\1\20\62\3\1\20\45\3\1\22\11\3\1\22"+ + "\2\3\1\22\4\3\1\20\43\3\1\20\30\3\1\20"+ + "\23\3\1\20\61\3"; + + private static int [] zzUnpackAction() { + int [] result = new int[554]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\66\0\154\0\242\0\330\0\u010e\0\u0144\0\242"+ + "\0\u017a\0\u01b0\0\u01e6\0\u021c\0\242\0\u0252\0\u0288\0\u02be"+ + "\0\u02f4\0\u032a\0\u0360\0\u0396\0\u03cc\0\u0402\0\u0438\0\u046e"+ + "\0\u04a4\0\u04da\0\u0510\0\u0546\0\u0546\0\u057c\0\u05b2\0\u05e8"+ + "\0\u061e\0\u0654\0\u068a\0\242\0\242\0\242\0\242\0\242"+ + "\0\242\0\242\0\242\0\242\0\242\0\u06c0\0\u06f6\0\u072c"+ + "\0\u0762\0\u0798\0\u07ce\0\u0804\0\u083a\0\u0870\0\u010e\0\u08a6"+ + "\0\u08dc\0\u0912\0\u0948\0\u097e\0\u09b4\0\u09ea\0\u0a20\0\u0a56"+ + "\0\u0a8c\0\u0ac2\0\u0af8\0\u0b2e\0\u0b64\0\u0b9a\0\u0bd0\0\u0c06"+ + "\0\u0c3c\0\u0c72\0\u0ca8\0\u0cde\0\u0d14\0\u0d4a\0\u0d80\0\u0db6"+ + "\0\u0dec\0\u0e22\0\u0e58\0\u0e8e\0\u0ec4\0\u0efa\0\u0f30\0\u0f66"+ + "\0\u0f9c\0\u0fd2\0\u1008\0\u103e\0\u1074\0\u10aa\0\u10e0\0\u1116"+ + "\0\u114c\0\u1182\0\u11b8\0\u11ee\0\u1224\0\u125a\0\u1290\0\u06c0"+ + "\0\u12c6\0\242\0\u12fc\0\u1332\0\u1368\0\u139e\0\u13d4\0\u140a"+ + "\0\u1440\0\u1476\0\u14ac\0\u14e2\0\u1518\0\u154e\0\u1584\0\u15ba"+ + "\0\u010e\0\u15f0\0\u1626\0\u165c\0\u1692\0\u16c8\0\u16fe\0\u1734"+ + "\0\u176a\0\u17a0\0\u17d6\0\u180c\0\u1842\0\u1878\0\u18ae\0\u18e4"+ + "\0\u191a\0\u1950\0\u1986\0\u19bc\0\u19f2\0\u1a28\0\u1a5e\0\u1a94"+ + "\0\u1aca\0\u1b00\0\u1b36\0\u1b6c\0\u1ba2\0\u1bd8\0\u1c0e\0\u1c44"+ + "\0\u1c7a\0\u1cb0\0\u1ce6\0\u1d1c\0\u1d52\0\u1d88\0\u1dbe\0\u1df4"+ + "\0\u1e2a\0\u1e60\0\u1e96\0\u1ecc\0\u1f02\0\u1f38\0\u1f6e\0\u1fa4"+ + "\0\u1fda\0\u2010\0\u2046\0\u207c\0\u20b2\0\u20e8\0\u211e\0\u2154"+ + "\0\u218a\0\u21c0\0\u21f6\0\u222c\0\u2262\0\u2298\0\u22ce\0\u2304"+ + "\0\u233a\0\u2370\0\u23a6\0\u23dc\0\u2412\0\u2448\0\u247e\0\u24b4"+ + "\0\u24ea\0\u2520\0\u2556\0\u258c\0\u25c2\0\u25f8\0\u262e\0\u2664"+ + "\0\u269a\0\u26d0\0\u010e\0\u2706\0\u273c\0\u2772\0\u27a8\0\u27de"+ + "\0\u2814\0\u284a\0\u2880\0\u28b6\0\u28ec\0\u2922\0\u2958\0\u010e"+ + "\0\u298e\0\u29c4\0\u29fa\0\u2a30\0\u2a66\0\u2a9c\0\u2ad2\0\u2b08"+ + "\0\u2b3e\0\u2b74\0\u2baa\0\u2be0\0\u2c16\0\u2c4c\0\u2c82\0\u2cb8"+ + "\0\u2cee\0\u2d24\0\u2d5a\0\u2d90\0\u2dc6\0\u2dfc\0\u2e32\0\u2e68"+ + "\0\u2e9e\0\u2ed4\0\u2f0a\0\u2f40\0\u2f76\0\u2fac\0\u2fe2\0\u3018"+ + "\0\u304e\0\u3084\0\u30ba\0\u30f0\0\u3126\0\u315c\0\u3192\0\u31c8"+ + "\0\u31fe\0\u3234\0\u326a\0\u32a0\0\u32d6\0\u330c\0\u3342\0\u3378"+ + "\0\u33ae\0\u33e4\0\u341a\0\u3450\0\u3486\0\u34bc\0\u34f2\0\u3528"+ + "\0\u355e\0\u3594\0\u35ca\0\u3600\0\u3636\0\u366c\0\u36a2\0\u36d8"+ + "\0\u370e\0\u3744\0\u377a\0\u37b0\0\u37e6\0\u381c\0\u3852\0\u3888"+ + "\0\u38be\0\u38f4\0\u392a\0\u3960\0\u3996\0\u39cc\0\u3a02\0\u3a38"+ + "\0\u3a6e\0\u3aa4\0\u3ada\0\u3b10\0\u3b46\0\u3b7c\0\u3bb2\0\u3be8"+ + "\0\u3c1e\0\u3c54\0\u3c8a\0\u3cc0\0\u3cf6\0\u3d2c\0\u3d62\0\u3d98"+ + "\0\u3dce\0\u3e04\0\u3e3a\0\u3e70\0\u3ea6\0\u3edc\0\u3f12\0\u3f48"+ + "\0\u3f7e\0\u3fb4\0\u3fea\0\u4020\0\u4056\0\u408c\0\u40c2\0\u40f8"+ + "\0\u412e\0\u4164\0\u419a\0\u41d0\0\u4206\0\u423c\0\u4272\0\u42a8"+ + "\0\u42de\0\u4314\0\u434a\0\u4380\0\u43b6\0\u43ec\0\u4422\0\u4458"+ + "\0\u448e\0\u44c4\0\u44fa\0\u4530\0\u4566\0\u459c\0\u45d2\0\u4608"+ + "\0\u463e\0\u4674\0\u46aa\0\u46e0\0\u4716\0\u474c\0\u4782\0\u47b8"+ + "\0\u47ee\0\u4824\0\u485a\0\u4890\0\u48c6\0\u48fc\0\u4932\0\u4968"+ + "\0\u499e\0\u49d4\0\u4a0a\0\u4a40\0\u4a76\0\u4aac\0\u4ae2\0\u4b18"+ + "\0\u4b4e\0\u4b84\0\u4bba\0\u4bf0\0\u4c26\0\u4c5c\0\u4c92\0\u4cc8"+ + "\0\u4cfe\0\u4d34\0\u4d6a\0\u4da0\0\u4dd6\0\u4e0c\0\u4e42\0\u4e78"+ + "\0\u4eae\0\u4ee4\0\u4f1a\0\u4f50\0\u4f86\0\u4fbc\0\u4ff2\0\u5028"+ + "\0\u505e\0\u5094\0\u50ca\0\u5100\0\u5136\0\u516c\0\u51a2\0\u51d8"+ + "\0\u520e\0\u5244\0\u527a\0\u52b0\0\u52e6\0\u531c\0\u5352\0\u5388"+ + "\0\u53be\0\u53f4\0\u542a\0\u5460\0\u5496\0\u54cc\0\u5502\0\u5538"+ + "\0\u556e\0\u55a4\0\u55da\0\u5610\0\u5646\0\u567c\0\u56b2\0\u56e8"+ + "\0\u571e\0\u5754\0\u578a\0\u57c0\0\u57f6\0\u582c\0\u5862\0\u5898"+ + "\0\u58ce\0\u5904\0\u593a\0\u5970\0\u59a6\0\u59dc\0\u5a12\0\u5a48"+ + "\0\u5a7e\0\u5ab4\0\u5aea\0\u5b20\0\u5b56\0\u5b8c\0\u5bc2\0\u5bf8"+ + "\0\u5c2e\0\u5c64\0\u5c9a\0\u5cd0\0\u5d06\0\u5d3c\0\u5d72\0\u5da8"+ + "\0\u5dde\0\u5e14\0\u5e4a\0\u5e80\0\u5eb6\0\u5eec\0\u5f22\0\u5f58"+ + "\0\u5f8e\0\u5fc4\0\u5ffa\0\u6030\0\u6066\0\u609c\0\u60d2\0\u6108"+ + "\0\u613e\0\u6174\0\u61aa\0\u61e0\0\u2d90\0\u6216\0\u624c\0\u6282"+ + "\0\u62b8\0\u62ee\0\u6324\0\u635a\0\u6390\0\u63c6\0\u63fc\0\u6432"+ + "\0\u6468\0\u649e\0\u64d4\0\u650a\0\u6540\0\u6576\0\u65ac\0\u65e2"+ + "\0\u6618\0\u664e\0\u6684\0\u66ba\0\u66f0\0\u6726\0\u675c\0\u6792"+ + "\0\u67c8\0\u67fe\0\u6834\0\u686a\0\u68a0\0\u68d6\0\u690c\0\u6942"+ + "\0\u6978\0\u69ae\0\u69e4\0\u6a1a\0\u6a50\0\u6a86\0\u6abc\0\u6af2"+ + "\0\u6b28\0\u6b5e\0\u6b94\0\u6bca\0\u6c00\0\u6c36\0\u6c6c\0\u6ca2"+ + "\0\u6cd8\0\u6d0e\0\u6d44\0\u6d7a\0\u6db0\0\u6de6\0\u6e1c\0\u6e52"+ + "\0\u6e88\0\u6ebe\0\u6ef4\0\u6f2a\0\u6f60\0\u6f96\0\u6fcc\0\u7002"+ + "\0\u7038\0\u706e"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[554]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\1\5\1\6\1\7\1\4\1\10\1\11\1\12"+ + "\1\10\1\13\1\14\1\15\1\16\1\17\1\20\1\21"+ + "\1\22\1\23\1\6\1\24\1\25\1\26\1\27\1\6"+ + "\1\30\1\31\1\32\1\6\1\33\2\10\1\34\1\35"+ + "\1\36\1\37\1\40\1\41\2\6\1\42\3\6\1\43"+ + "\1\6\1\15\1\44\1\45\1\46\1\47\1\50\1\51"+ + "\1\52\1\53\64\54\1\55\66\54\1\55\67\0\1\5"+ + "\4\0\1\56\60\0\6\6\1\57\4\0\20\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\60\14\6"+ + "\5\0\14\6\17\0\1\10\66\0\1\10\60\0\2\61"+ + "\10\0\20\61\5\0\14\61\24\0\1\4\53\0\6\6"+ + "\1\57\4\0\1\6\1\62\1\6\1\63\10\6\1\64"+ + "\3\6\5\0\3\6\1\65\10\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\66\3\6\1\67\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\70\10\6\1\71"+ + "\3\6\1\72\1\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\2\6\1\73\1\6\1\74\1\6\1\75\1\6"+ + "\1\76\1\77\6\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\100\10\6\1\101\1\6\1\102\1\6"+ + "\1\103\1\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\104\1\6\1\105\4\6\1\106\1\6\1\107"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\1\6"+ + "\1\110\6\6\1\111\5\6\1\112\1\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\113\1\6\1\114"+ + "\14\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\115\1\6\1\116\6\6\1\117\3\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\2\6\1\120\1\6\1\121"+ + "\10\6\1\122\2\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\123\2\6\1\124\10\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\125\1\6\1\126"+ + "\6\6\1\127\3\6\1\130\1\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\4\6\1\131\1\132\7\6\1\133"+ + "\1\6\1\134\5\0\2\6\1\135\11\6\45\0\1\10"+ + "\67\0\1\10\30\0\6\6\1\57\4\0\1\6\1\136"+ + "\14\6\1\137\1\6\5\0\1\6\1\140\12\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\141\14\6\1\142\1\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\6\1\143"+ + "\14\6\1\144\1\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\145\16\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\146\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\13\6\1\147\12\0"+ + "\1\150\66\0\2\151\4\0\1\152\3\0\20\151\5\0"+ + "\14\151\12\0\6\6\1\57\4\0\16\6\1\153\1\6"+ + "\5\0\14\6\12\0\6\61\1\154\4\0\20\61\5\0"+ + "\14\61\12\0\6\6\1\57\4\0\2\6\1\155\1\6"+ + "\1\156\7\6\1\157\1\160\2\6\5\0\1\6\1\161"+ + "\12\6\12\0\6\6\1\57\4\0\12\6\1\162\5\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\10\6\1\163"+ + "\7\6\5\0\14\6\12\0\6\6\1\57\4\0\12\6"+ + "\1\164\5\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\3\6\1\165\14\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\166\10\6\1\67\2\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\4\6\1\167\13\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\170\1\171"+ + "\11\6\5\0\14\6\12\0\6\6\1\57\4\0\7\6"+ + "\1\172\10\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\15\6\1\173\2\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\174\3\6\1\175\1\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\176\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\1\177\17\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\171\2\6"+ + "\1\200\4\6\1\201\2\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\202\12\6\12\0"+ + "\6\6\1\57\4\0\2\6\1\203\15\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\2\6\1\204\15\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\10\6"+ + "\1\205\3\6\12\0\6\6\1\57\4\0\6\6\1\206"+ + "\11\6\5\0\14\6\12\0\6\6\1\57\4\0\14\6"+ + "\1\207\1\6\1\210\1\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\2\6\1\211\15\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\11\6\1\212\6\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\213\1\6\1\214"+ + "\14\6\5\0\14\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\215\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\216\12\6\1\217\3\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\2\6\1\220\4\6\1\221\1\6"+ + "\1\222\5\6\1\223\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\224\17\6\5\0\1\6\1\225\12\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\226\5\6\1\227\1\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\2\6\1\171"+ + "\15\6\5\0\2\6\1\230\11\6\12\0\6\6\1\57"+ + "\4\0\7\6\1\231\10\6\5\0\14\6\12\0\4\6"+ + "\1\232\1\6\1\57\4\0\11\6\1\233\3\6\1\234"+ + "\2\6\5\0\14\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\235\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\236\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\7\6\1\237\10\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\1\240\17\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\241\5\6\1\242\6\6\5\0"+ + "\1\243\13\6\12\0\6\6\1\57\4\0\11\6\1\244"+ + "\5\6\1\67\5\0\14\6\12\0\2\6\1\245\3\6"+ + "\1\57\4\0\5\6\1\246\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\247\14\6\1\67\2\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\250\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\5\6\1\251\6\6\12\0\6\6\1\57\4\0\13\6"+ + "\1\171\4\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\11\6\1\171\6\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\1\6\1\252\12\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\253\12\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\176\16\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\254\17\6\5\0\7\6"+ + "\1\237\4\6\12\0\6\6\1\57\4\0\4\6\1\134"+ + "\4\6\1\216\6\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\255\16\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\11\6\1\256\6\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\14\6\1\257\3\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\260\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\16\6\1\261\1\6"+ + "\5\0\14\6\12\0\6\151\5\0\20\151\5\0\14\151"+ + "\12\0\6\6\1\57\4\0\10\6\1\245\7\6\5\0"+ + "\14\6\13\0\2\151\10\0\20\151\5\0\14\151\12\0"+ + "\6\6\1\57\4\0\2\6\1\262\4\6\1\263\10\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\264\4\6"+ + "\1\265\12\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\4\6\1\216\13\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\266\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\267\12\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\1\6\1\270\12\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\271\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\6"+ + "\1\272\12\6\12\0\4\6\1\273\1\6\1\57\4\0"+ + "\20\6\5\0\14\6\12\0\6\6\1\57\4\0\5\6"+ + "\1\274\12\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\14\6\1\275\3\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\276\17\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\5\6\1\277\12\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\11\6\1\300\6\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\11\6\1\301\6\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\302\17\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\303\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\16\6\1\304\1\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\2\6\1\305"+ + "\15\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\306\14\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\307\12\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\2\6\1\310\11\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\311\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\312\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\313\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\171\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\207\3\6"+ + "\1\314\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\3\6\1\315\14\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\316\5\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\1\317\17\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\1\320\17\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\321\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\5\6\1\171\12\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\4\6\1\322\13\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\1\6\1\323\16\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\1\6\1\324\12\6\12\0\6\6\1\57\4\0\1\6"+ + "\1\325\16\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\3\6\1\326\14\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\327\16\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\330\13\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\331\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\5\6\1\332\2\6\1\333\7\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\11\6\1\334"+ + "\6\6\5\0\14\6\12\0\6\6\1\57\4\0\20\6"+ + "\5\0\1\6\1\335\12\6\12\0\6\6\1\57\4\0"+ + "\11\6\1\336\6\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\337\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\340\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\341\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\342\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\343\14\6"+ + "\5\0\14\6\12\0\4\6\1\344\1\6\1\57\4\0"+ + "\14\6\1\345\3\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\7\6\1\346\10\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\1\347\17\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\16\6\1\350\1\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\5\6\1\351\12\6\5\0\14\6"+ + "\12\0\4\6\1\352\1\6\1\57\4\0\11\6\1\353"+ + "\6\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\354\12\6\1\171\1\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\355\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\356\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\14\6\1\357\3\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\6"+ + "\1\360\12\6\12\0\6\6\1\57\4\0\11\6\1\207"+ + "\6\6\5\0\14\6\12\0\6\6\1\57\4\0\16\6"+ + "\1\361\1\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\362\12\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\363\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\10\6\1\364\7\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\365\16\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\2\6\1\207\15\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\366\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\16\6\1\367"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\16\6"+ + "\1\216\1\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\16\6\1\370\1\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\7\6\1\371\10\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\372\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\12\6\1\373\5\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\374\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\15\6\1\330\2\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\6\1\375"+ + "\16\6\5\0\14\6\12\0\6\6\1\57\4\0\20\6"+ + "\5\0\3\6\1\245\10\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\376\12\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\3\6\1\377\10\6\12\0\2\6"+ + "\1\171\3\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\4\6\1\u0100\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\135\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\u0101\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\10\6\1\171"+ + "\7\6\5\0\14\6\12\0\6\6\1\57\4\0\7\6"+ + "\1\256\10\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\16\6\1\u0102\1\6\5\0\14\6\12\0\4\6\1\u0103"+ + "\1\6\1\57\4\0\20\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\u0104\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\303\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\11\6\1\u0105\6\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\4\6\1\u0106\13\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\11\6\1\u0107"+ + "\6\6\5\0\14\6\12\0\6\6\1\57\4\0\20\6"+ + "\5\0\6\6\1\u0108\5\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\u0109\12\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\u010a\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\u010b\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\4\6\1\u010c\13\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\15\6\1\u010d\2\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\17\6\1\207\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\16\6\1\u010e\1\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\1\6\1\u010f\12\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\253\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\4\6\1\u0110\13\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\u0111\13\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\u0112\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\5\6\1\173\12\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\u0113\1\6\1\u0114"+ + "\12\6\5\0\14\6\12\0\6\6\1\57\4\0\12\6"+ + "\1\u0115\5\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\u0116\17\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\10\6\1\u0117\7\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\6\6\1\u0118\11\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\171\13\6\12\0\6\6"+ + "\1\57\4\0\15\6\1\u0119\2\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\u011a\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\16\6\1\u011b\1\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\2\6\1\u011c\15\6"+ + "\5\0\14\6\12\0\4\6\1\u011d\1\6\1\57\4\0"+ + "\20\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\u011e\14\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\14\6\1\u011f\3\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\u0120\5\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\u0121\13\6\12\0\4\6"+ + "\1\u0122\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\11\6\1\u0123\2\6"+ + "\12\0\6\6\1\57\4\0\11\6\1\u0124\6\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\12\6\1\u0125\5\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\11\6\1\u0126"+ + "\6\6\5\0\14\6\12\0\6\6\1\57\4\0\1\6"+ + "\1\u0127\16\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\u0128\12\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\u0129\14\6\5\0\14\6\12\0\4\6"+ + "\1\u012a\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\11\6\1\u012b\6\6\5\0\14\6"+ + "\12\0\4\6\1\u012c\1\6\1\57\4\0\20\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\4\6\1\206\13\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\10\6\1\207"+ + "\7\6\5\0\14\6\12\0\6\6\1\57\4\0\12\6"+ + "\1\u012d\5\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\u012e\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\316\17\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\134\13\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\4\6\1\u012f\13\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\u0130\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\364\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\135\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\7\6\1\u0131\4\6\12\0\6\6\1\57\4\0\20\6"+ + "\5\0\1\6\1\u0132\12\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\u0133\12\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\147\13\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\15\6\1\171\2\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\7\6\1\u0134\10\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\12\6\1\u0135\5\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\6"+ + "\1\u0136\12\6\12\0\6\6\1\57\4\0\1\6\1\u0137"+ + "\16\6\5\0\14\6\12\0\6\6\1\57\4\0\12\6"+ + "\1\u0138\5\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\11\6\1\u0139\6\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\15\6\1\u013a\2\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\330\12\6\5\0\14\6\12\0"+ + "\4\6\1\u013b\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\207\17\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\17\6\1\u013c\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\15\6\1\364\2\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\13\6\1\u013d\4\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\u013e\17\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\4\6\1\u013f\7\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\u0140\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\u0141\17\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\u0142\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\5\6\1\u0143\12\6\5\0\14\6\12\0\4\6"+ + "\1\u0144\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\u0145\14\6\5\0\14\6"+ + "\12\0\4\6\1\u0146\1\6\1\57\4\0\20\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\17\6\1\u0147\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\u0148\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\3\6\1\u0149"+ + "\14\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u014a\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\u014b\12\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\u014c\13\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\10\6\1\u014d\7\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\1\u014e\13\6\12\0"+ + "\6\6\1\57\4\0\12\6\1\261\5\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\u014f\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\2\6"+ + "\1\u0150\11\6\12\0\6\6\1\57\4\0\5\6\1\u0151"+ + "\12\6\5\0\14\6\12\0\6\6\1\57\4\0\20\6"+ + "\5\0\7\6\1\u013a\4\6\12\0\4\6\1\u0152\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\16\6\1\u0153\1\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\14\6\1\u0154\3\6\5\0\14\6\12\0"+ + "\4\6\1\u0155\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u0156\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\4\6\1\135\13\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\12\6\1\u0157"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\5\6"+ + "\1\u0158\12\6\5\0\14\6\12\0\4\6\1\u0159\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\u015a\5\6\5\0\14\6\12\0\2\6"+ + "\1\u015b\3\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\12\6\1\u015c\5\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\16\6\1\u015d\1\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\6\6"+ + "\1\207\5\6\12\0\6\6\1\57\4\0\16\6\1\u015e"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u015f\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\u0153\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\11\6\1\u0160\6\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\u0161\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\3\6\1\u0162\10\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\u0163\14\6\5\0"+ + "\14\6\12\0\4\6\1\u0164\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\4\6\1\u0165\1\6\1\57\4\0"+ + "\20\6\5\0\14\6\12\0\6\6\1\57\4\0\14\6"+ + "\1\u0166\3\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\12\6\1\u0167\5\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\u0168\5\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\7\6\1\u0169\10\6\5\0\14\6\12\0"+ + "\4\6\1\u016a\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\341\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\10\6\1\307\7\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\u016b\17\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\16\6\1\u016c"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u016d\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\4\6\1\u016e\7\6\12\0\6\6\1\57"+ + "\4\0\15\6\1\u016f\2\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\u0170\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\u0171\17\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\u0172\16\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\u0173\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\1\6\1\u0174\16\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\14\6\1\u0175"+ + "\3\6\5\0\14\6\12\0\4\6\1\u0176\1\6\1\57"+ + "\4\0\20\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\4\6\1\u0177\13\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\4\6\1\171\13\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\10\6\1\u0178\7\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\1\u0179\13\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\u015b\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\4\6\1\u017a\13\6\5\0"+ + "\14\6\12\0\4\6\1\u017b\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\2\6\1\u017c"+ + "\15\6\5\0\14\6\12\0\6\6\1\57\4\0\5\6"+ + "\1\u017d\12\6\5\0\14\6\12\0\4\6\1\u017e\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\6\6\1\u017f\5\6\12\0\6\6"+ + "\1\57\4\0\1\u0180\17\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\207\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\u0181\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\12\6\1\u0182\5\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\4\6\1\u0183\13\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\16\6\1\u0184"+ + "\1\6\5\0\14\6\12\0\4\6\1\u0185\1\6\1\57"+ + "\4\0\20\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\u0186\12\6\5\0\1\6\1\u0187\3\6\1\u0188"+ + "\6\6\12\0\6\6\1\57\4\0\20\6\5\0\2\6"+ + "\1\u0189\11\6\12\0\6\6\1\57\4\0\3\6\1\u018a"+ + "\14\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u018b\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\u018c\12\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\u018d\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\2\6\1\u018e\11\6\12\0"+ + "\6\6\1\57\4\0\16\6\1\253\1\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\12\6\1\u018f\5\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\363\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\14\6\1\u0190"+ + "\3\6\5\0\14\6\12\0\6\6\1\57\4\0\16\6"+ + "\1\u0191\1\6\5\0\14\6\12\0\4\6\1\u0192\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\5\6\1\u0193\12\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\2\6\1\u0194\15\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\u0195\16\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\10\6\1\u0196\7\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\u0197\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\5\6\1\u0198"+ + "\7\6\1\u0199\2\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\16\6\1\u019a\1\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\171\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\u019b\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\u019c\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\u0123\7\6"+ + "\1\u019d\2\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\367\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\3\6\1\171\10\6\12\0\6\6"+ + "\1\57\4\0\1\6\1\u019e\16\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\u019f\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\u01a0\14\6\5\0"+ + "\14\6\12\0\4\6\1\u01a1\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\4\6\1\u01a2"+ + "\13\6\5\0\14\6\12\0\6\6\1\57\4\0\13\6"+ + "\1\u01a3\4\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\u01a4\12\6\12\0\6\6\1\57"+ + "\4\0\14\6\1\u0154\3\6\5\0\12\6\1\43\1\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u01a5\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\u01a6\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\6\1\u01a7"+ + "\16\6\5\0\14\6\12\0\6\6\1\57\4\0\16\6"+ + "\1\144\1\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\4\6\1\u010e\13\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\13\6\1\u01a8\4\6\5\0\14\6\12\0\4\6"+ + "\1\u01a9\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\4\6\1\u01aa\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\u01ab\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\6"+ + "\1\u01ac\12\6\12\0\6\6\1\57\4\0\16\6\1\u01ad"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u01ae\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\u01af\17\6\5\0\14\6\12\0\4\6\1\u01b0\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\4\6\1\u01b1"+ + "\1\6\1\57\4\0\20\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\2\6\1\u01b2\15\6\5\0\14\6\12\0"+ + "\4\6\1\u01b3\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\330\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\12\6\1\u01b4\5\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\16\6\1\u01b5"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\2\6"+ + "\1\u01b6\15\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\u01b7\16\6\5\0\14\6\12\0\4\6\1\u011d"+ + "\1\6\1\57\4\0\11\6\1\u01b8\6\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\16\6\1\u01b9\1\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\4\6\1\207\13\6"+ + "\5\0\14\6\12\0\4\6\1\u01ba\1\6\1\57\4\0"+ + "\20\6\5\0\14\6\12\0\4\6\1\u01bb\1\6\1\57"+ + "\4\0\20\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\u01bc\13\6\12\0\6\6\1\57\4\0"+ + "\13\6\1\u01bd\4\6\5\0\14\6\12\0\4\6\1\u01be"+ + "\1\6\1\57\4\0\20\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\u01bf\13\6\12\0\4\6"+ + "\1\u01c0\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\4\6\1\u01c1\13\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\12\6\1\u0153\5\6\5\0"+ + "\14\6\12\0\4\6\1\u01c2\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\5\6\1\u01c3"+ + "\12\6\5\0\14\6\12\0\6\6\1\57\4\0\7\6"+ + "\1\u01c4\10\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\u017c\13\6\12\0\6\6\1\57\4\0"+ + "\16\6\1\u01c5\1\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\1\6\1\171\12\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\u0196\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\1\6\1\u01c6\16\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\17\6\1\u01c7\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\15\6\1\u019d\2\6\5\0"+ + "\14\6\12\0\4\6\1\u01c8\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\6\1\u01c9"+ + "\16\6\5\0\14\6\12\0\6\6\1\57\4\0\2\6"+ + "\1\u01ca\15\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\u01cb\12\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\u01cc\14\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\2\6\1\u01cd\15\6\5\0\14\6\12\0"+ + "\4\6\1\u01ce\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\u01cf\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\11\6\1\u01d0\2\6"+ + "\1\u01d1\3\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\14\6\1\u01d2\3\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\10\6\1\u01d3\7\6\5\0\14\6\12\0\4\6"+ + "\1\u01d4\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\11\6\1\u01d5\6\6\5\0\14\6"+ + "\12\0\4\6\1\u01d6\1\6\1\57\4\0\20\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\1\u01d7\17\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\13\6\1\u015a\4\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\16\6\1\u01d8"+ + "\1\6\5\0\2\6\1\u018e\11\6\12\0\6\6\1\57"+ + "\4\0\12\6\1\u01d9\5\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\10\6\1\u01da\7\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\20\6\5\0\2\6\1\u01db\11\6"+ + "\12\0\6\6\1\57\4\0\20\6\5\0\1\6\1\u01dc"+ + "\12\6\12\0\6\6\1\57\4\0\16\6\1\u01dd\1\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\15\6\1\u01de"+ + "\2\6\5\0\14\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\u01df\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\3\6\1\u01e0\14\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\3\6\1\u01e1\14\6\5\0\14\6\12\0\4\6"+ + "\1\u01e2\1\6\1\57\4\0\20\6\5\0\14\6\12\0"+ + "\4\6\1\u01e3\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\u01e4\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\u01e5\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\7\6\1\324"+ + "\10\6\5\0\14\6\12\0\6\6\1\57\4\0\4\6"+ + "\1\u01e6\13\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\10\6\1\u01e7\7\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\u01e8\16\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\u01e9\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\12\6\1\u01ea\5\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\u01eb\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\1\6\1\u01ec\16\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\1\u01ed\13\6\12\0\6\6\1\57\4\0\2\6\1\u01ee"+ + "\15\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\u01ef\14\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\20\6\5\0\1\6\1\207\12\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\1\6\1\u01f0\12\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\u01f1\12\6\12\0"+ + "\6\6\1\57\4\0\14\6\1\u01f2\3\6\5\0\14\6"+ + "\12\0\4\6\1\u01f3\1\6\1\57\4\0\20\6\5\0"+ + "\14\6\12\0\4\6\1\u01f4\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\4\6\1\u01f4\1\6\1\57\4\0"+ + "\20\6\5\0\11\6\1\u0198\2\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\1\u01f5\13\6\12\0\6\6\1\57"+ + "\4\0\5\6\1\u0123\7\6\1\u01f6\2\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u01f7\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\12\6\1\u01f8\5\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\12\6\1\u01f9"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\2\6"+ + "\1\u0158\15\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\4\6\1\u01fa\13\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\20\6\5\0\2\6\1\u01fb\11\6\12\0\6\6"+ + "\1\57\4\0\1\6\1\u01fc\16\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\15\6\1\u01fd\2\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\5\6\1\310\12\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\3\6\1\u01fe\14\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\20\6\5\0"+ + "\1\u01ff\13\6\12\0\6\6\1\57\4\0\16\6\1\316"+ + "\1\6\5\0\14\6\12\0\6\6\1\57\4\0\14\6"+ + "\1\377\3\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\10\6\1\u01f0\7\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\11\6\1\u0200\6\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\u0201\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\10\6\1\u0202\7\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\14\6\1\u01f2\1\6\1\u0203"+ + "\1\6\5\0\14\6\12\0\4\6\1\u0204\1\6\1\57"+ + "\4\0\20\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\u0205\17\6\5\0\14\6\12\0\4\6\1\u0206\1\6"+ + "\1\57\4\0\20\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\11\6\1\u0207\6\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\u0208\12\6\12\0"+ + "\4\6\1\u0209\1\6\1\57\4\0\20\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\u020a\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\6\6"+ + "\1\u017e\5\6\12\0\6\6\1\57\4\0\12\6\1\u020b"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\u020c\14\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\1\6\1\u018c\16\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\1\6\1\u020d\16\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\5\6\1\u020e\12\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\11\6\1\u020f\6\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u0210\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\u0211"+ + "\13\6\12\0\6\6\1\57\4\0\5\6\1\u0212\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\12\6\1\u0213"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\3\6"+ + "\1\u0214\14\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\7\6\1\u0215\10\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\6\6\1\377\11\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\20\6\5\0\1\6\1\225\12\6\12\0"+ + "\6\6\1\57\4\0\2\6\1\u0216\15\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\3\6\1\354\14\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\5\6\1\u0217\12\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\15\6\1\207"+ + "\2\6\5\0\14\6\12\0\6\6\1\57\4\0\1\6"+ + "\1\u0218\6\6\1\u0202\7\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\10\6\1\u0219\7\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\4\6\1\u021a\13\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\17\6\1\u021b\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u021c\16\6\5\0"+ + "\14\6\12\0\4\6\1\u021d\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\10\6\1\270"+ + "\7\6\5\0\14\6\12\0\6\6\1\57\4\0\10\6"+ + "\1\u021e\7\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\14\6\1\u021f\3\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\13\6\1\330\4\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\3\6\1\u0153\14\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\12\6\1\u0220\5\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\20\6\5\0\12\6\1\43"+ + "\1\6\12\0\4\6\1\u0221\1\6\1\57\4\0\20\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\1\u0222\17\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\4\6\1\301"+ + "\13\6\5\0\14\6\12\0\6\6\1\57\4\0\7\6"+ + "\1\u0223\10\6\5\0\14\6\12\0\6\6\1\57\4\0"+ + "\5\6\1\u0224\12\6\5\0\14\6\12\0\6\6\1\57"+ + "\4\0\10\6\1\u0225\7\6\5\0\14\6\12\0\6\6"+ + "\1\57\4\0\12\6\1\u0226\5\6\5\0\14\6\12\0"+ + "\6\6\1\57\4\0\3\6\1\u0227\14\6\5\0\14\6"+ + "\12\0\6\6\1\57\4\0\1\6\1\u0228\16\6\5\0"+ + "\14\6\12\0\6\6\1\57\4\0\20\6\5\0\1\u0229"+ + "\13\6\12\0\6\6\1\57\4\0\4\6\1\313\13\6"+ + "\5\0\14\6\12\0\6\6\1\57\4\0\12\6\1\u022a"+ + "\5\6\5\0\14\6\12\0\6\6\1\57\4\0\6\6"+ + "\1\171\11\6\5\0\14\6\11\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[28836]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\3\1\1\11\4\1\1\11\26\1\12\11"+ + "\2\0\72\1\1\11\1\1\1\0\u01be\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[554]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XPathLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte PARAN = 1; + private static final byte BRACKET = 2; + private static final byte CURLY = 3; + + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public XPathLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public XPathLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 996) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 7: + { return token(TokenType.OPERATOR, -PARAN); + } + case 19: break; + case 17: + { return token(TokenType.KEYWORD); + } + case 20: break; + case 2: + { return token(TokenType.NUMBER); + } + case 21: break; + case 15: + { yybegin(YYINITIAL); + // length also includes the trailing quote + return token(TokenType.STRING, tokenStart, tokenLength + 1); + } + case 22: break; + case 4: + { return token(TokenType.OPERATOR); + } + case 23: break; + case 8: + { return token(TokenType.OPERATOR, CURLY); + } + case 24: break; + case 9: + { return token(TokenType.OPERATOR, -CURLY); + } + case 25: break; + case 14: + { tokenLength += yylength(); + } + case 26: break; + case 13: + { yybegin(STRING_SINGLE); + tokenStart = yychar; + tokenLength = 1; + } + case 27: break; + case 18: + { return token(TokenType.TYPE); + } + case 28: break; + case 1: + { /* skip */ + } + case 29: break; + case 11: + { return token(TokenType.OPERATOR, -BRACKET); + } + case 30: break; + case 12: + { yybegin(STRING_DOUBLE); + tokenStart = yychar; + tokenLength = 1; + } + case 31: break; + case 6: + { return token(TokenType.OPERATOR, PARAN); + } + case 32: break; + case 3: + { return token(TokenType.IDENTIFIER); + } + case 33: break; + case 16: + { return token(TokenType.KEYWORD2); + } + case 34: break; + case 10: + { return token(TokenType.OPERATOR, BRACKET); + } + case 35: break; + case 5: + { + } + case 36: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + return null; + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XmlLexer.java b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XmlLexer.java new file mode 100644 index 000000000..9a0f4d22b --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/generated-sources/jflex/jsyntaxpane/lexers/XmlLexer.java @@ -0,0 +1,712 @@ +/* The following code was generated by JFlex 1.4.3 on 21.7.10 18:14 */ + +/* + * Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package jsyntaxpane.lexers; + + +import jsyntaxpane.Token; +import jsyntaxpane.TokenType; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 21.7.10 18:14 from the specification file + * D:/Dokumenty/Programovani/JavaSE/JPSWFDec/libsrc/jsyntaxpane/jsyntaxpane/src/main/jflex/jsyntaxpane/lexers/xml.flex + */ +public final class XmlLexer extends DefaultJFlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int INSTR = 8; + public static final int YYINITIAL = 0; + public static final int COMMENT = 2; + public static final int CDATA = 4; + public static final int TAG = 6; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\0\1\1\1\2\2\0\1\2\22\0\1\1\1\4\1\24\1\30"+ + "\2\0\1\26\1\25\5\0\1\5\1\11\1\22\12\12\1\7\1\27"+ + "\1\3\1\23\1\6\1\13\1\0\1\17\1\7\1\15\1\16\1\7"+ + "\16\7\1\20\6\7\1\14\1\0\1\21\1\0\1\7\1\0\32\10"+ + "\74\0\1\11\10\0\27\0\1\0\37\0\1\0\u0208\0\160\0\16\0"+ + "\1\0\u02e1\0\12\31\206\0\12\31\u026c\0\12\31\166\0\12\31\166\0"+ + "\12\31\166\0\12\31\166\0\12\31\167\0\11\31\166\0\12\31\166\0"+ + "\12\31\166\0\12\31\340\0\12\31\166\0\12\31\106\0\12\31\u0116\0"+ + "\12\31\266\0\u0269\0\11\31\u046e\0\12\31\46\0\12\31\u012c\0\12\31"+ + "\u06b0\0\14\0\2\0\63\0\57\0\u0120\0\u0a70\0\u03f0\0\21\0\ua7ff\0"+ + "\u0800\0\u1000\0\u0900\0\u04d0\0\40\0\u0120\0\12\31\344\0\2\0"; + + /** + * Translates characters to character classes + */ + private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\5\0\7\1\1\2\5\1\1\0\1\3\13\0\1\4"+ + "\1\5\1\0\1\6\1\0\1\7\2\0\1\10\1\0"+ + "\1\11\2\0\1\12\1\0\1\13\1\14\2\0\1\15"+ + "\1\16\4\0\1\17"; + + private static int [] zzUnpackAction() { + int [] result = new int[57]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\32\0\64\0\116\0\150\0\202\0\234\0\266"+ + "\0\320\0\352\0\u0104\0\u011e\0\202\0\u0138\0\u0152\0\u016c"+ + "\0\u0186\0\u01a0\0\u01ba\0\u01d4\0\u01ee\0\u0208\0\u0222\0\u023c"+ + "\0\320\0\u0256\0\u0270\0\u0104\0\u028a\0\u02a4\0\u0138\0\202"+ + "\0\202\0\u016c\0\202\0\u0186\0\202\0\u02be\0\u02d8\0\u02f2"+ + "\0\u030c\0\202\0\u0326\0\u0340\0\202\0\u035a\0\202\0\202"+ + "\0\u0374\0\u038e\0\202\0\202\0\u03a8\0\u03c2\0\u03dc\0\u03f6"+ + "\0\202"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[57]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\3\6\1\7\22\6\1\10\3\6\5\11\1\12\24\11"+ + "\21\13\1\14\10\13\6\6\1\15\2\16\4\6\4\16"+ + "\1\6\1\17\1\6\1\20\1\21\13\6\2\16\2\6"+ + "\1\22\1\6\4\16\3\6\1\20\1\21\4\6\36\0"+ + "\1\23\2\0\2\24\2\0\1\25\1\0\4\24\1\0"+ + "\1\26\17\0\1\27\17\0\1\30\1\0\5\31\1\32"+ + "\31\31\1\33\24\31\21\34\1\35\31\34\1\36\10\34"+ + "\5\0\1\37\1\0\4\37\2\0\4\37\2\0\1\40"+ + "\14\0\1\41\23\0\2\42\1\0\21\42\1\43\5\42"+ + "\2\44\1\0\22\44\1\43\4\44\6\0\1\45\30\0"+ + "\1\46\6\0\1\47\22\0\1\24\1\0\4\24\2\0"+ + "\4\24\20\0\2\50\4\0\4\50\20\0\2\51\4\0"+ + "\4\51\21\0\1\27\16\0\1\52\14\0\1\53\16\0"+ + "\1\53\5\31\1\54\31\31\1\54\1\55\23\31\21\34"+ + "\1\56\16\34\1\57\12\34\1\56\10\34\5\0\1\60"+ + "\41\0\1\61\21\0\1\50\1\0\4\50\2\0\4\50"+ + "\12\0\2\62\2\0\1\51\1\63\4\51\2\0\4\51"+ + "\23\0\1\53\14\0\1\52\1\0\1\53\5\31\1\54"+ + "\1\64\23\31\6\34\1\64\12\34\1\56\10\34\16\0"+ + "\1\65\14\0\2\62\3\0\1\63\42\0\1\66\32\0"+ + "\1\67\30\0\1\70\26\0\1\71\15\0"; + + private static int [] zzUnpackTrans() { + int [] result = new int[1040]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\5\0\1\11\6\1\1\11\5\1\1\0\1\1\13\0"+ + "\2\11\1\0\1\11\1\0\1\11\2\0\1\1\1\0"+ + "\1\11\2\0\1\11\1\0\2\11\2\0\2\11\4\0"+ + "\1\11"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[57]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** number of newlines encountered up to the start of the matched text */ + private int yyline; + + /** the number of characters up to the start of the matched text */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + /* user code: */ + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public XmlLexer() { + super(); + } + + @Override + public int yychar() { + return yychar; + } + + private static final byte TAG_OPEN = 1; + private static final byte TAG_CLOSE = -1; + + private static final byte INSTR_OPEN = 2; + private static final byte INSTR_CLOSE = -2; + + private static final byte CDATA_OPEN = 3; + private static final byte CDATA_CLOSE = -3; + + private static final byte COMMENT_OPEN = 4; + private static final byte COMMENT_CLOSE = -4; + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public XmlLexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public XmlLexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + char [] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 218) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead-zzStartRead); + + /* translate stored positions */ + zzEndRead-= zzStartRead; + zzCurrentPos-= zzStartRead; + zzMarkedPos-= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos*2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length-zzEndRead); + + if (numRead > 0) { + zzEndRead+= numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + * + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead ); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead+pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public Token yylex() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; + char [] zzCMapL = ZZ_CMAP; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar+= zzMarkedPosL-zzStartRead; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 12: + { yybegin(COMMENT); + return token(TokenType.COMMENT2, COMMENT_OPEN); + } + case 16: break; + case 10: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT2, COMMENT_CLOSE); + } + case 17: break; + case 5: + { yybegin(YYINITIAL); + return token(TokenType.TYPE, TAG_CLOSE); + } + case 18: break; + case 15: + { yybegin(CDATA); + return token(TokenType.COMMENT2, CDATA_OPEN); + } + case 19: break; + case 11: + { yybegin(YYINITIAL); + return token(TokenType.COMMENT2, CDATA_CLOSE); + } + case 20: break; + case 2: + { yybegin(YYINITIAL); + return token(TokenType.TYPE); + } + case 21: break; + case 9: + { return token(TokenType.KEYWORD2); + } + case 22: break; + case 13: + { return token(TokenType.TYPE, TAG_CLOSE); + } + case 23: break; + case 4: + { return token(TokenType.IDENTIFIER); + } + case 24: break; + case 3: + { yybegin(TAG); + return token(TokenType.TYPE, TAG_OPEN); + } + case 25: break; + case 6: + { return token(TokenType.STRING); + } + case 26: break; + case 14: + { yypushback(3); + return token(TokenType.COMMENT); + } + case 27: break; + case 7: + { yybegin(YYINITIAL); + return token(TokenType.TYPE2, INSTR_CLOSE); + } + case 28: break; + case 1: + { + } + case 29: break; + case 8: + { yybegin(INSTR); + return token(TokenType.TYPE2, INSTR_OPEN); + } + case 30: break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + switch (zzLexicalState) { + case INSTR: { + return null; + } + case 58: break; + case YYINITIAL: { + return null; + } + case 59: break; + case COMMENT: { + return null; + } + case 60: break; + case CDATA: { + return null; + } + case 61: break; + case TAG: { + return null; + } + case 62: break; + default: + return null; + } + } + else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/jsyntaxpane-0.9.5.jar b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/jsyntaxpane-0.9.5.jar new file mode 100644 index 000000000..e20d1fafe Binary files /dev/null and b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/jsyntaxpane-0.9.5.jar differ diff --git a/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/maven-archiver/pom.properties b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/maven-archiver/pom.properties new file mode 100644 index 000000000..a046ad8f3 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/jsyntaxpane/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Wed Jul 21 18:15:08 CEST 2010 +version=0.9.5 +groupId=jsyntaxpane +artifactId=jsyntaxpane diff --git a/trunk/libsrc/jsyntaxpane/nbactions.xml b/trunk/libsrc/jsyntaxpane/nbactions.xml new file mode 100644 index 000000000..a842b1e66 --- /dev/null +++ b/trunk/libsrc/jsyntaxpane/nbactions.xml @@ -0,0 +1,32 @@ + + + + run + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.1:exec + + + -classpath %classpath jsyntaxpane.SyntaxTester + java + + + + debug + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.1:exec + + + -Xdebug -Djava.compiler=none -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath jsyntaxpane.SyntaxTester + true + java + + + diff --git a/trunk/src/com/jpexs/asdec/Main.java b/trunk/src/com/jpexs/asdec/Main.java new file mode 100644 index 000000000..7286a278e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/Main.java @@ -0,0 +1,372 @@ +package com.jpexs.asdec; + +import com.jpexs.asdec.abc.NotSameException; +import com.jpexs.asdec.gui.LoadingDialog; +import com.jpexs.asdec.gui.ModeFrame; +import com.jpexs.asdec.gui.View; +import com.jpexs.asdec.gui.proxy.ProxyFrame; +import com.jpexs.asdec.tags.DoABCTag; +import com.jpexs.asdec.tags.Tag; +import com.jpexs.proxy.Replacement; + +import javax.swing.*; +import javax.swing.filechooser.FileFilter; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.*; +import java.util.ArrayList; +import java.util.List; + + +/** + * Main executable class + * + * @author JPEXS + */ +public class Main { + + public static com.jpexs.asdec.abc.gui.MainFrame abcMainFrame; + public static com.jpexs.asdec.action.gui.MainFrame actionMainFrame; + public static ProxyFrame proxyFrame; + public static String file; + public static String maskURL; + public static SWF swf; + public static String version = "alpha7"; + public static String applicationName = "JP ActionScript Decompiler v." + version; + public static LoadingDialog loadingDialog = new LoadingDialog(); + public static ModeFrame modeFrame; + private static boolean working = false; + private static TrayIcon trayIcon; + private static MenuItem stopMenuItem; + public static boolean DEBUG_COPY = false; + public static boolean DEBUG_MODE = false; + public static boolean DISABLE_DANGEROUS = false; + + public static String getFileTitle() { + if (maskURL != null) return maskURL; + return file; + } + + /** + * List of replacements + */ + public static java.util.List replacements = new ArrayList(); + + + private static String getASDecHome() { + String dir = ".";//System.getProperty("user.home"); + if (!dir.endsWith(File.separator)) dir += File.separator; + dir += "config" + File.separator; + return dir; + } + + private static String getReplacementsFile() { + return getASDecHome() + "replacements.ini"; + } + + /** + * Saves replacements to file for future use + */ + public static void saveReplacements() { + try { + File f = new File(getASDecHome()); + if (!f.exists()) f.mkdir(); + PrintWriter pw = new PrintWriter(new FileWriter(getReplacementsFile())); + for (Replacement r : replacements) { + pw.println(r.urlPattern); + pw.println(r.targetFile); + } + pw.close(); + } catch (IOException e) { + + } + } + + /** + * Load replacements from file + */ + public static void loadReplacements() { + replacements = new ArrayList(); + try { + BufferedReader br = new BufferedReader(new FileReader(getReplacementsFile())); + String s = ""; + while ((s = br.readLine()) != null) { + Replacement r = new Replacement(s, br.readLine()); + replacements.add(r); + } + br.close(); + } catch (IOException e) { + + } + } + + public static boolean isWorking() { + return working; + } + + public static void showProxy() { + if (proxyFrame == null) proxyFrame = new ProxyFrame(); + proxyFrame.setVisible(true); + proxyFrame.setState(Frame.NORMAL); + } + + public static void startWork(String name) { + working = true; + abcMainFrame.setStatus(name); + } + + public static void stopWork() { + working = false; + abcMainFrame.setStatus(""); + } + + public static SWF parseSWF(String file) throws Exception { + FileInputStream fis = new FileInputStream(file); + SWF locswf = new SWF(fis); + return locswf; + } + + + public static void saveFile(String outfile) throws IOException { + file = outfile; + swf.saveTo(new FileOutputStream(outfile)); + } + + + private static class OpenFileWorker extends SwingWorker { + @Override + protected Object doInBackground() throws Exception { + try { + swf = parseSWF(Main.file); + FileInputStream fis = new FileInputStream(file); + DEBUG_COPY = true; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + swf.saveTo(baos); + } catch (NotSameException nse) { + if (DEBUG_MODE) { + nse.printStackTrace(); + System.exit(0); + } + JOptionPane.showMessageDialog(null, "WARNING: The SWF decompiler may have problems saving this file. Recommended usage is READ ONLY."); + } + DEBUG_COPY = false; + //DEBUG_COPY=true; + } catch (Exception ex) { + ex.printStackTrace(); + JOptionPane.showMessageDialog(null, "Cannot load SWF file."); + loadingDialog.setVisible(false); + return false; + } + List listAbc = new ArrayList(); + for (Tag t : swf.tags) { + if (t instanceof DoABCTag) listAbc.add(t); + } + + + if (false) { + JOptionPane.showMessageDialog(null, "This SWF file does not contain any ActionScript parts"); + loadingDialog.setVisible(false); + if (!openFileDialog()) { + System.exit(0); + } + } else { + if (listAbc.size() > 0) { + List listAbc2 = new ArrayList(); + for (Tag tag : listAbc) { + listAbc2.add((DoABCTag) tag); + } + abcMainFrame = new com.jpexs.asdec.abc.gui.MainFrame(listAbc2); + abcMainFrame.display(); + } else { + actionMainFrame = new com.jpexs.asdec.action.gui.MainFrame(swf.tags); + actionMainFrame.display(); + } + } + loadingDialog.setVisible(false); + return true; + } + } + + public static boolean openFile(String swfFile) { + if (abcMainFrame != null) + abcMainFrame.setVisible(false); + if (actionMainFrame != null) + actionMainFrame.setVisible(false); + Main.file = swfFile; + Main.loadingDialog.setVisible(true); + (new OpenFileWorker()).execute(); + return true; + } + + + public static boolean saveFileDialog(Frame f) { + JFileChooser fc = new JFileChooser(); + int returnVal = fc.showSaveDialog(f); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + try { + Main.saveFile(file.getAbsolutePath()); + maskURL = null; + return true; + } catch (IOException ex) { + JOptionPane.showMessageDialog(null, "Cannot write to the file"); + } + } + return false; + } + + public static boolean openFileDialog() { + maskURL = null; + JFileChooser fc = new JFileChooser(); + fc.setFileFilter(new FileFilter() { + + @Override + public boolean accept(File f) { + return (f.getName().endsWith(".swf")) || (f.isDirectory()); + } + + @Override + public String getDescription() { + return "SWF files (*.swf)"; + } + + }); + int returnVal = fc.showOpenDialog(null); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File selfile = fc.getSelectedFile(); + Main.openFile(selfile.getAbsolutePath()); + return true; + } else { + return false; + } + } + + + public static void showModeFrame() { + if (modeFrame == null) modeFrame = new ModeFrame(); + modeFrame.setVisible(true); + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) throws IOException { + View.setWinLookAndFeel(); + loadReplacements(); + if (args.length < 1) { + showModeFrame(); + } else { + if (args[0].equals("-proxy")) { + int port = 55555; + for (int i = 0; i < args.length; i++) { + if (args[i].startsWith("-P")) { + try { + port = Integer.parseInt(args[i].substring(2)); + } catch (NumberFormatException nex) { + System.err.println("Bad port number"); + } + } + } + if (proxyFrame == null) proxyFrame = new ProxyFrame(); + proxyFrame.setPort(port); + addTrayIcon(); + switchProxy(); + } else { + openFile(args[0]); + } + } + } + + + public static String tempFile(String url) { + File f = new File(getASDecHome() + "saved" + File.separator); + if (!f.exists()) f.mkdirs(); + return getASDecHome() + "saved" + File.separator + "asdec_" + Integer.toHexString(url.hashCode()) + ".tmp"; + + } + + public static void removeTrayIcon() { + if (SystemTray.isSupported()) { + SystemTray tray = SystemTray.getSystemTray(); + if (trayIcon != null) { + tray.remove(trayIcon); + trayIcon = null; + } + } + } + + public static void switchProxy() { + proxyFrame.switchState(); + if (stopMenuItem != null) { + if (proxyFrame.isRunning()) { + stopMenuItem.setLabel("Stop proxy"); + } else { + stopMenuItem.setLabel("Start proxy"); + } + } + } + + public static void addTrayIcon() { + if (trayIcon != null) return; + if (SystemTray.isSupported()) { + SystemTray tray = SystemTray.getSystemTray(); + trayIcon = new TrayIcon(View.loadImage("com/jpexs/asdec/gui/graphics/proxy16.png"), "JP ASDec Proxy"); + trayIcon.setImageAutoSize(true); + PopupMenu trayPopup = new PopupMenu(); + + + ActionListener trayListener = new ActionListener() { + /** + * Invoked when an action occurs. + */ + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals("EXIT")) Main.exit(); + if (e.getActionCommand().equals("SHOW")) Main.showProxy(); + if (e.getActionCommand().equals("SWITCH")) Main.switchProxy(); + } + }; + + + MenuItem showMenuItem = new MenuItem("Show proxy"); + showMenuItem.setActionCommand("SHOW"); + showMenuItem.addActionListener(trayListener); + trayPopup.add(showMenuItem); + stopMenuItem = new MenuItem("Start proxy"); + stopMenuItem.setActionCommand("SWITCH"); + stopMenuItem.addActionListener(trayListener); + trayPopup.add(stopMenuItem); + trayPopup.addSeparator(); + MenuItem exitMenuItem = new MenuItem("Exit"); + exitMenuItem.setActionCommand("EXIT"); + exitMenuItem.addActionListener(trayListener); + trayPopup.add(exitMenuItem); + + trayIcon.setPopupMenu(trayPopup); + trayIcon.addMouseListener(new MouseAdapter() { + /** + * {@inheritDoc} + */ + @Override + public void mouseClicked(MouseEvent e) { + if (e.getButton() == MouseEvent.BUTTON1) { + Main.showProxy(); + } + } + }); + try { + tray.add(trayIcon); + } catch (AWTException ex) { + + } + } + } + + public static void exit() { + saveReplacements(); + System.exit(0); + } +} diff --git a/trunk/src/com/jpexs/asdec/SWF.java b/trunk/src/com/jpexs/asdec/SWF.java new file mode 100644 index 000000000..d3319b0bc --- /dev/null +++ b/trunk/src/com/jpexs/asdec/SWF.java @@ -0,0 +1,190 @@ +package com.jpexs.asdec; + +import com.jpexs.asdec.tags.Tag; +import com.jpexs.asdec.types.RECT; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.DeflaterOutputStream; +import java.util.zip.InflaterInputStream; + +/** + * Class representing SWF file + * + * @author JPEXS + */ +public class SWF { + + /** + * Tags inside of file + */ + public List tags = new ArrayList(); + /** + * Rectangle for the display + */ + public RECT displayRect; + /** + * Movie frame rate + */ + public int frameRate; + /** + * Number of frames in movie + */ + public int frameCount; + /** + * Version of SWF + */ + public int version; + /** + * Size of the file + */ + public long fileSize; + + /** + * Use compression + */ + public boolean compressed = false; + + /** + * Gets all tags with specified id + * + * @param tagId Identificator of tag type + * @return List of tags + */ + public List getTagData(int tagId) { + List ret = new ArrayList(); + for (Tag tag : tags) { + if (tag.getId() == tagId) { + ret.add(tag); + } + } + return ret; + } + + /** + * Saves this SWF into new file + * + * @param os OutputStream to save SWF in + * @throws IOException + */ + public void saveTo(OutputStream os) throws IOException { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos = new SWFOutputStream(baos, version); + sos.writeRECT(displayRect); + sos.writeUI8(0); + sos.writeUI8(frameRate); + sos.writeUI16(frameCount); + + sos.writeTags(tags); + sos.writeUI16(0); + sos.close(); + if (compressed) { + os.write('C'); + } else { + os.write('F'); + } + os.write('W'); + os.write('S'); + os.write(version); + byte data[] = baos.toByteArray(); + sos = new SWFOutputStream(os, version); + sos.writeUI32(data.length + 8); + + if (compressed) { + os = new DeflaterOutputStream(os); + } + os.write(data); + } + finally { + if (os != null) + os.close(); + } + + } + + /** + * Construct SWF from stream + * + * @param is Stream to read SWF from + * @throws IOException + */ + public SWF(InputStream is) throws IOException { + byte hdr[] = new byte[3]; + is.read(hdr); + String shdr = new String(hdr); + if ((!shdr.equals("FWS")) && (!shdr.equals("CWS"))) { + throw new IOException("Invalid SWF file"); + } + version = is.read(); + SWFInputStream sis = new SWFInputStream(is, version); + fileSize = sis.readUI32(); + + if (hdr[0] == 'C') { + sis = new SWFInputStream(new InflaterInputStream(is), version); + compressed = true; + } + + + displayRect = sis.readRECT(); + sis.readUI8(); + frameRate = sis.readUI8(); + frameCount = sis.readUI16(); + tags = sis.readTagList(); + } + + + /** + * Compress SWF file + * + * @param fis Input stream + * @param fos Output stream + */ + public static void fws2cws(InputStream fis, OutputStream fos) { + try { + byte swfHead[] = new byte[8]; + fis.read(swfHead); + + swfHead[0] = 'C'; + fos.write(swfHead); + fos = new DeflaterOutputStream(fos); + int i = 0; + while ((i = fis.read()) != -1) { + fos.write(i); + } + + fis.close(); + fos.close(); + } catch (FileNotFoundException ex) { + } catch (IOException ex) { + } + + } + + /** + * Decompress SWF file + * + * @param fis Input stream + * @param fos Output stream + */ + public static void cws2fws(InputStream fis, OutputStream fos) { + try { + byte swfHead[] = new byte[8]; + fis.read(swfHead); + InflaterInputStream iis = new InflaterInputStream(fis); + swfHead[0] = 'F'; + fos.write(swfHead); + int i = 0; + while ((i = iis.read()) != -1) { + fos.write(i); + } + + fis.close(); + fos.close(); + } catch (FileNotFoundException ex) { + } catch (IOException ex) { + } + + } +} diff --git a/trunk/src/com/jpexs/asdec/SWFInputStream.java b/trunk/src/com/jpexs/asdec/SWFInputStream.java new file mode 100644 index 000000000..e5a6859b8 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/SWFInputStream.java @@ -0,0 +1,1153 @@ +package com.jpexs.asdec; + +import com.jpexs.asdec.action.Action; +import com.jpexs.asdec.action.swf3.*; +import com.jpexs.asdec.action.swf4.*; +import com.jpexs.asdec.action.swf5.*; +import com.jpexs.asdec.action.swf6.*; +import com.jpexs.asdec.action.swf7.*; +import com.jpexs.asdec.tags.*; +import com.jpexs.asdec.types.*; +import com.jpexs.asdec.types.filters.*; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +/** + * Class for reading data from SWF file + * + * @author JPEXS + */ +public class SWFInputStream extends InputStream { + private InputStream is; + private Stack margedPos = new Stack(); + private long pos = 0; + private int version; + + /** + * Constructor + * + * @param is Existing inputstream + * @param version Version of SWF to read + */ + public SWFInputStream(InputStream is, int version) { + this.version = version; + this.is = is; + } + + /** + * Gets position in bytes in the stream + * + * @return Number of bytes + */ + public long getPos() { + return pos; + } + + /** + * Reads one byte from the stream + * + * @return byte or -1 on error + * @throws IOException + */ + @Override + public int read() throws IOException { + pos++; + bitPos = 0; + return is.read(); + } + + private void alignByte() { + bitPos = 0; + } + + private int readNoBitReset() throws IOException { + pos++; + return is.read(); + } + + /** + * Reads one UI8 (Unsigned 8bit integer) value from the stream + * + * @return UI8 value or -1 on error + * @throws IOException + */ + public int readUI8() throws IOException { + return read(); + } + + /** + * Reads one string value from the stream + * + * @return String value + * @throws IOException + */ + public String readString() throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + int r = 0; + while (true) { + r = read(); + if (r == 0) return new String(baos.toByteArray(), "utf8"); + baos.write(r); + } + } + + /** + * Reads one UI32 (Unsigned 32bit integer) value from the stream + * + * @return UI32 value + * @throws IOException + */ + public long readUI32() throws IOException { + return (read() + (read() << 8) + (read() << 16) + (read() << 24)) & 0xffffffff; + } + + /** + * Reads one UI16 (Unsigned 16bit integer) value from the stream + * + * @return UI16 value + * @throws IOException + */ + public int readUI16() throws IOException { + return read() + (read() << 8); + } + + /** + * Reads one SI32 (Signed 32bit integer) value from the stream + * + * @return SI32 value + * @throws IOException + */ + public long readSI32() throws IOException { + long uval = read() + (read() << 8) + (read() << 16) + (read() << 24); + if (uval >= 0x80000000) { + return -(((~uval) & 0xffffffff) + 1); + } else { + return uval; + } + } + + /** + * Reads one SI16 (Signed 16bit integer) value from the stream + * + * @return SI16 value + * @throws IOException + */ + public int readSI16() throws IOException { + int uval = read() + (read() << 8); + if (uval >= 0x8000) { + return -(((~uval) & 0xffff) + 1); + } else { + return uval; + } + } + + /** + * Reads one SI8 (Signed 8bit integer) value from the stream + * + * @return SI8 value + * @throws IOException + */ + public int readSI8() throws IOException { + int uval = read(); + if (uval >= 0x80) { + return -(((~uval) & 0xff) + 1); + } else { + return uval; + } + } + + /** + * Reads one FIXED (Fixed point 16.16) value from the stream + * + * @return FIXED value + * @throws IOException + */ + public double readFIXED() throws IOException { + int afterPoint = readUI16(); + int beforePoint = readUI16(); + return ((double) ((beforePoint << 16) + afterPoint)) / 65536; + } + + /** + * Reads one FIXED8 (Fixed point 8.8) value from the stream + * + * @return FIXED8 value + * @throws IOException + */ + public float readFIXED8() throws IOException { + int afterPoint = read(); + int beforePoint = read(); + return beforePoint + (((float) afterPoint) / 256); + } + + private long readLong() throws IOException { + byte readBuffer[] = readBytes(8); + return (((long) readBuffer[3] << 56) + + ((long) (readBuffer[2] & 255) << 48) + + ((long) (readBuffer[1] & 255) << 40) + + ((long) (readBuffer[0] & 255) << 32) + + ((long) (readBuffer[7] & 255) << 24) + + ((readBuffer[6] & 255) << 16) + + ((readBuffer[5] & 255) << 8) + + ((readBuffer[4] & 255) << 0)); + } + + /** + * Reads one DOUBLE (double precision floating point value) value from the stream + * + * @return DOUBLE value + * @throws IOException + */ + public double readDOUBLE() throws IOException { + long el = readLong(); + double ret = Double.longBitsToDouble(el); + return ret; + } + + /** + * Reads one FLOAT (single precision floating point value) value from the stream + * + * @return FLOAT value + * @throws IOException + */ + public float readFLOAT() throws IOException { + int val = (int) readUI32(); + float ret = Float.intBitsToFloat(val); + /*int sign = val >> 31; + int mantisa = val & 0x3FFFFF; + int exp = (val >> 22) & 0xFF; + float ret =(sign == 1 ? -1 : 1) * (float) Math.pow(2, exp)* (1+((mantisa)/ (float)(1<<23)));*/ + return ret; + } + + /** + * Reads one FLOAT16 (16bit floating point value) value from the stream + * + * @return FLOAT16 value + * @throws IOException + */ + public float readFLOAT16() throws IOException { + int val = readUI16(); + int sign = val >> 15; + int mantisa = val & 0x3FF; + int exp = (val >> 10) & 0x1F; + float ret = (sign == 1 ? -1 : 1) * (float) Math.pow(2, exp) * (1 + ((mantisa) / (float) (1 << 10))); + return ret; + } + + + /** + * Reads bytes from the stream + * + * @param count Number of bytes to read + * @return Array of read bytes + * @throws IOException + */ + public byte[] readBytes(long count) throws IOException { + byte ret[] = new byte[(int) count]; + for (int i = 0; i < count; i++) { + ret[i] = (byte) read(); + } + return ret; + } + + + /** + * Reads one EncodedU32 (Encoded unsigned 32bit value) value from the stream + * + * @return U32 value + * @throws IOException + */ + public long readEncodedU32() throws IOException { + int result = read(); + if ((result & 0x00000080) == 0) { + return result; + } + result = (result & 0x0000007f) | (read()) << 7; + if ((result & 0x00004000) == 0) { + return result; + } + result = (result & 0x00003fff) | (read()) << 14; + if ((result & 0x00200000) == 0) { + return result; + } + result = (result & 0x001fffff) | (read()) << 21; + if ((result & 0x10000000) == 0) { + return result; + } + result = (result & 0x0fffffff) | (read()) << 28; + return result; + } + + private int bitPos = 0; + private int tempByte = 0; + + /** + * Reads UB[nBits] (Unsigned-bit value) value from the stream + * + * @param nBits Number of bits which represent value + * @return Unsigned value + * @throws IOException + */ + public long readUB(int nBits) throws IOException { + if (nBits == 0) return 0; + long ret = 0; + if (bitPos == 0) { + tempByte = readNoBitReset(); + } + for (int bit = 0; bit < nBits; bit++) { + int nb = (tempByte >> (7 - bitPos)) & 1; + ret = ret + (nb << (nBits - 1 - bit)); + bitPos++; + if (bitPos == 8) { + bitPos = 0; + if (bit != nBits - 1) { + tempByte = readNoBitReset(); + } + } + } + return ret; + } + + /** + * Reads SB[nBits] (Signed-bit value) value from the stream + * + * @param nBits Number of bits which represent value + * @return Signed value + * @throws IOException + */ + public long readSB(int nBits) throws IOException { + long uval = readUB(nBits); + + if ((uval & (1 << (nBits - 1))) > 0) uval |= (0xffffffff << nBits); + return uval; + /*int sign = (int) (uval >> (nBits - 1)); + if (sign == 1) { + long mask = 0; + for (int k = 0; k < nBits; k++) { + mask = mask + (1 << k); + } + return -(((~uval) & mask) + 1); + } else { + return uval; + } */ + } + + + /** + * Reads FB[nBits] (Signed fixed-point bit value) value from the stream + * + * @param nBits Number of bits which represent value + * @return Fixed-point value + * @throws IOException + */ + public double readFB(int nBits) throws IOException { + + double val = readSB(nBits); + double ret = val / (1 << 16); + return ret; + } + + /** + * Reads one RECT value from the stream + * + * @return RECT value + * @throws IOException + */ + public RECT readRECT() throws IOException { + RECT ret = new RECT(); + int NBits = (int) readUB(5); + ret.Xmin = (int) readSB(NBits); + ret.Xmax = (int) readSB(NBits); + ret.Ymin = (int) readSB(NBits); + ret.Ymax = (int) readSB(NBits); + return ret; + } + + /** + * Reads list of actions from the stream. Reading ends with ActionEndFlag(=0) or end of the stream. + * + * @return List of actions + * @throws IOException + */ + public List readActionList() throws IOException { + List ret = new ArrayList(); + Action a; + while ((a = readAction()) != null) { + ret.add(a); + } + return ret; + } + + /** + * Reads list of tags from the stream. Reading ends with End tag(=0) or end of the stream. + * + * @return List of tags + * @throws IOException + */ + public List readTagList() throws IOException { + List tags = new ArrayList(); + Tag tag; + while ((tag = readTag()) != null) { + tags.add(tag); + } + return tags; + } + + /** + * Reads one Tag from the stream + * + * @return Tag or null when End tag + * @throws IOException + */ + public Tag readTag() throws IOException { + int tagIDTagLength = readUI16(); + int tagID = (tagIDTagLength) >> 6; + if (tagID == 0) { + return null; + } + long tagLength = (tagIDTagLength & 0x003F); + boolean readLong = false; + if (tagLength == 0x3f) { + tagLength = readSI32(); + readLong = true; + } + byte data[] = readBytes((int) tagLength); + Tag ret; + switch (tagID) { + case 82: + ret = new DoABCTag(data, version); + break; + case 12: + ret = new DoActionTag(data, version); + break; + case 59: + ret = new DoInitActionTag(data, version); + break; + case 39: + ret = new DefineSpriteTag(data, version); + break; + case 1: + ret = new ShowFrameTag(); + break; + case 26: + ret = new PlaceObject2Tag(data, version); + break; + case 56: + ret = new ExportAssetsTag(data, version); + break; + case 70: + ret = new PlaceObject3Tag(data, version); + break; + case 7: + ret = new DefineButtonTag(data, version); + break; + case 34: + ret = new DefineButton2Tag(data, version); + break; + default: + ret = new Tag(tagID, data); + } + ret.forceWriteAsLong = readLong; + return ret; + } + + /** + * Reads one Action from the stream + * + * @return Action or null when ActionEndFlag or end of the stream + * @throws IOException + */ + public Action readAction() throws IOException { + { + int actionCode = readUI8(); + if (actionCode == 0) return null; + if (actionCode == -1) return null; + int actionLength = 0; + if (actionCode >= 0x80) { + actionLength = readUI16(); + } + switch (actionCode) { + //SWF3 Actions + case 0x81: + return new ActionGotoFrame(this); + case 0x83: + return new ActionGetURL(actionLength, this); + case 0x04: + return new ActionNextFrame(); + case 0x05: + return new ActionPrevFrame(); + case 0x06: + return new ActionPlay(); + case 0x07: + return new ActionStop(); + case 0x08: + return new ActionToggleQuality(); + case 0x09: + return new ActionStopSounds(); + case 0x8A: + return new ActionWaitForFrame(this); + case 0x8B: + return new ActionSetTarget(actionLength, this); + case 0x8C: + return new ActionGoToLabel(actionLength, this); + //SWF4 Actions + case 0x96: + return new ActionPush(actionLength, this, version); + case 0x17: + return new ActionPop(); + case 0x0A: + return new ActionAdd(); + case 0x0B: + return new ActionSubtract(); + case 0x0C: + return new ActionMultiply(); + case 0x0D: + return new ActionDivide(); + case 0x0E: + return new ActionEquals(); + case 0x0F: + return new ActionLess(); + case 0x10: + return new ActionAnd(); + case 0x11: + return new ActionOr(); + case 0x12: + return new ActionNot(); + case 0x13: + return new ActionStringEquals(); + case 0x14: + return new ActionStringLength(); + case 0x21: + return new ActionStringAdd(); + case 0x15: + return new ActionStringExtract(); + case 0x29: + return new ActionStringLess(); + case 0x31: + return new ActionMBStringLength(); + case 0x35: + return new ActionMBStringExtract(); + case 0x18: + return new ActionToInteger(); + case 0x32: + return new ActionCharToAscii(); + case 0x33: + return new ActionAsciiToChar(); + case 0x36: + return new ActionMBCharToAscii(); + case 0x37: + return new ActionMBAsciiToChar(); + case 0x99: + return new ActionJump(this); + case 0x9D: + return new ActionIf(this); + case 0x9E: + return new ActionCall(); + case 0x1C: + return new ActionGetVariable(); + case 0x1D: + return new ActionSetVariable(); + case 0x9A: + return new ActionGetURL2(this); + case 0x9F: + return new ActionGotoFrame2(actionLength, this); + case 0x20: + return new ActionSetTarget2(); + case 0x22: + return new ActionGetProperty(); + case 0x23: + return new ActionSetProperty(); + case 0x24: + return new ActionCloneSprite(); + case 0x25: + return new ActionRemoveSprite(); + case 0x27: + return new ActionStartDrag(); + case 0x28: + return new ActionEndDrag(); + case 0x8D: + return new ActionWaitForFrame2(this); + case 0x26: + return new ActionTrace(); + case 0x34: + return new ActionGetTime(); + case 0x30: + return new ActionRandomNumber(); + //SWF5 Actions + case 0x3D: + return new ActionCallFunction(); + case 0x52: + return new ActionCallMethod(); + case 0x88: + return new ActionConstantPool(actionLength, this); + case 0x9B: + return new ActionDefineFunction(actionLength, this, version); + case 0x3C: + return new ActionDefineLocal(); + case 0x41: + return new ActionDefineLocal2(); + case 0x3A: + return new ActionDelete(); + case 0x3B: + return new ActionDelete2(); + case 0x46: + return new ActionEnumerate(); + case 0x49: + return new ActionEquals2(); + case 0x4E: + return new ActionGetMember(); + case 0x42: + return new ActionInitArray(); + case 0x43: + return new ActionInitObject(); + case 0x53: + return new ActionNewMethod(); + case 0x40: + return new ActionNewObject(); + case 0x4F: + return new ActionSetMember(); + case 0x45: + return new ActionTargetPath(); + case 0x94: + return new ActionWith(this, version); + case 0x4A: + return new ActionToNumber(); + case 0x4B: + return new ActionToString(); + case 0x44: + return new ActionTypeOf(); + case 0x47: + return new ActionAdd2(); + case 0x48: + return new ActionLess2(); + case 0x3F: + return new ActionModulo(); + case 0x60: + return new ActionBitAnd(); + case 0x63: + return new ActionBitLShift(); + case 0x61: + return new ActionBitOr(); + case 0x64: + return new ActionBitRShift(); + case 0x65: + return new ActionBitURShift(); + case 0x62: + return new ActionBitXor(); + case 0x51: + return new ActionDecrement(); + case 0x50: + return new ActionIncrement(); + case 0x4C: + return new ActionPushDuplicate(); + case 0x3E: + return new ActionReturn(); + case 0x4D: + return new ActionStackSwap(); + case 0x87: + return new ActionStoreRegister(this); + //SWF6 Actions + case 0x54: + return new ActionInstanceOf(); + case 0x55: + return new ActionEnumerate2(); + case 0x66: + return new ActionStrictEquals(); + case 0x67: + return new ActionGreater(); + case 0x68: + return new ActionStringGreater(); + //SWF7 Actions + case 0x8E: + return new ActionDefineFunction2(actionLength, this, version); + case 0x69: + return new ActionExtends(); + case 0x2B: + return new ActionCastOp(); + case 0x2C: + return new ActionImplementsOp(); + case 0x8F: + return new ActionTry(actionLength, this, version); + case 0x2A: + return new ActionThrow(); + default: + if (actionLength > 0) skip(actionLength); + return new Action(actionCode, actionLength); + } + } + } + + /** + * Reads one MATRIX value from the stream + * + * @return MATRIX value + * @throws IOException + */ + public MATRIX readMatrix() throws IOException { + MATRIX ret = new MATRIX(); + ret.hasScale = readUB(1) == 1; + if (ret.hasScale) { + int NScaleBits = (int) readUB(5); + ret.scaleNBits = NScaleBits; + + ret.scaleX = readFB(NScaleBits); + ret.scaleY = readFB(NScaleBits); + } + ret.hasRotate = readUB(1) == 1; + if (ret.hasRotate) { + int NRotateBits = (int) readUB(5); + ret.rotateNBits = NRotateBits; + ret.rotateSkew0 = readFB(NRotateBits); + ret.rotateSkew1 = readFB(NRotateBits); + } + int NTranslateBits = (int) readUB(5); + ret.translateNBits = NTranslateBits; + ret.translateX = readSB(NTranslateBits); + ret.translateY = readSB(NTranslateBits); + alignByte(); + return ret; + } + + /** + * Reads one CXFORMWITHALPHA value from the stream + * + * @return CXFORMWITHALPHA value + * @throws IOException + */ + public CXFORMWITHALPHA readCXFORMWITHALPHA() throws IOException { + CXFORMWITHALPHA ret = new CXFORMWITHALPHA(); + ret.hasAddTerms = readUB(1) == 1; + ret.hasMultTerms = readUB(1) == 1; + int Nbits = (int) readUB(4); + ret.nbits = Nbits; + if (ret.hasMultTerms) { + ret.redMultTerm = (int) readSB(Nbits); + ret.greenMultTerm = (int) readSB(Nbits); + ret.blueMultTerm = (int) readSB(Nbits); + ret.alphaMultTerm = (int) readSB(Nbits); + } + if (ret.hasAddTerms) { + ret.redAddTerm = (int) readSB(Nbits); + ret.greenAddTerm = (int) readSB(Nbits); + ret.blueAddTerm = (int) readSB(Nbits); + ret.alphaAddTerm = (int) readSB(Nbits); + } + alignByte(); + return ret; + } + + /** + * Reads one CLIPEVENTFLAGS value from the stream + * + * @return CLIPEVENTFLAGS value + * @throws IOException + */ + + public CLIPEVENTFLAGS readCLIPEVENTFLAGS() throws IOException { + CLIPEVENTFLAGS ret = new CLIPEVENTFLAGS(); + ret.clipEventKeyUp = readUB(1) == 1; + ret.clipEventKeyDown = readUB(1) == 1; + ret.clipEventMouseUp = readUB(1) == 1; + ret.clipEventMouseDown = readUB(1) == 1; + ret.clipEventMouseMove = readUB(1) == 1; + ret.clipEventUnload = readUB(1) == 1; + ret.clipEventEnterFrame = readUB(1) == 1; + ret.clipEventLoad = readUB(1) == 1; + ret.clipEventDragOver = readUB(1) == 1; + ret.clipEventRollOut = readUB(1) == 1; + ret.clipEventRollOver = readUB(1) == 1; + ret.clipEventReleaseOutside = readUB(1) == 1; + ret.clipEventRelease = readUB(1) == 1; + ret.clipEventPress = readUB(1) == 1; + ret.clipEventInitialize = readUB(1) == 1; + ret.clipEventData = readUB(1) == 1; + if (version >= 6) { + readUB(5); + ret.clipEventConstruct = readUB(1) == 1; + ret.clipEventKeyPress = readUB(1) == 1; + ret.clipEventDragOut = readUB(1) == 1; + readUB(8); + } + return ret; + } + + /** + * Reads one CLIPACTIONRECORD value from the stream + * + * @return CLIPACTIONRECORD value + * @throws IOException + */ + public CLIPACTIONRECORD readCLIPACTIONRECORD() throws IOException { + CLIPACTIONRECORD ret = new CLIPACTIONRECORD(); + ret.eventFlags = readCLIPEVENTFLAGS(); + if (ret.eventFlags.isClear()) return null; + long actionRecordSize = readUI32(); + if (ret.eventFlags.clipEventKeyPress) { + ret.keyCode = readUI8(); + actionRecordSize--; + } + ret.actions = (new SWFInputStream(new ByteArrayInputStream(readBytes(actionRecordSize)), version)).readActionList(); + return ret; + } + + /** + * Reads one CLIPACTIONS value from the stream + * + * @return CLIPACTIONS value + * @throws IOException + */ + public CLIPACTIONS readCLIPACTIONS() throws IOException { + CLIPACTIONS ret = new CLIPACTIONS(); + readUI16();//reserved + ret.allEventFlags = readCLIPEVENTFLAGS(); + CLIPACTIONRECORD cr; + ret.clipActionRecords = new ArrayList(); + while ((cr = readCLIPACTIONRECORD()) != null) { + ret.clipActionRecords.add(cr); + } + return ret; + } + + + /** + * Reads one COLORMATRIXFILTER value from the stream + * + * @return COLORMATRIXFILTER value + * @throws IOException + */ + public COLORMATRIXFILTER readCOLORMATRIXFILTER() throws IOException { + COLORMATRIXFILTER ret = new COLORMATRIXFILTER(); + ret.matrix = new float[20]; + for (int i = 0; i < 20; i++) { + ret.matrix[i] = readFLOAT(); + } + return ret; + } + + /** + * Reads one RGBA value from the stream + * + * @return RGBA value + * @throws IOException + */ + public RGBA readRGBA() throws IOException { + RGBA ret = new RGBA(); + ret.red = readUI8(); + ret.green = readUI8(); + ret.blue = readUI8(); + ret.alpha = readUI8(); + return ret; + } + + /** + * Reads one CONVOLUTIONFILTER value from the stream + * + * @return CONVOLUTIONFILTER value + * @throws IOException + */ + public CONVOLUTIONFILTER readCONVOLUTIONFILTER() throws IOException { + CONVOLUTIONFILTER ret = new CONVOLUTIONFILTER(); + ret.matrixX = readUI8(); + ret.matrixY = readUI8(); + ret.divisor = readFLOAT(); + ret.bias = readFLOAT(); + ret.matrix = new float[ret.matrixX][ret.matrixY]; + for (int x = 0; x < ret.matrixX; x++) { + for (int y = 0; y < ret.matrixY; y++) { + ret.matrix[x][y] = readFLOAT(); + } + } + ret.defaultColor = readRGBA(); + readUB(6);//reserved + ret.clamp = readUB(1) == 1; + ret.preserveAlpha = readUB(1) == 1; + return ret; + } + + /** + * Reads one BLURFILTER value from the stream + * + * @return BLURFILTER value + * @throws IOException + */ + public BLURFILTER readBLURFILTER() throws IOException { + BLURFILTER ret = new BLURFILTER(); + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.passes = (int) readUB(5); + readUB(3); //reserved + return ret; + } + + /** + * Reads one DROPSHADOWFILTER value from the stream + * + * @return DROPSHADOWFILTER value + * @throws IOException + */ + public DROPSHADOWFILTER readDROPSHADOWFILTER() throws IOException { + DROPSHADOWFILTER ret = new DROPSHADOWFILTER(); + ret.dropShadowColor = readRGBA(); + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.angle = readFIXED(); + ret.distance = readFIXED(); + ret.strength = readFIXED8(); + ret.innerShadow = readUB(1) == 1; + ret.knockout = readUB(1) == 1; + ret.compositeSource = readUB(1) == 1; + ret.passes = (int) readUB(5); + return ret; + } + + /** + * Reads one GLOWFILTER value from the stream + * + * @return GLOWFILTER value + * @throws IOException + */ + public GLOWFILTER readGLOWFILTER() throws IOException { + GLOWFILTER ret = new GLOWFILTER(); + ret.glowColor = readRGBA(); + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.strength = readFIXED8(); + ret.innerGlow = readUB(1) == 1; + ret.knockout = readUB(1) == 1; + ret.compositeSource = readUB(1) == 1; + ret.passes = (int) readUB(5); + return ret; + } + + /** + * Reads one BEVELFILTER value from the stream + * + * @return BEVELFILTER value + * @throws IOException + */ + public BEVELFILTER readBEVELFILTER() throws IOException { + BEVELFILTER ret = new BEVELFILTER(); + ret.shadowColor = readRGBA(); + ret.highlightColor = readRGBA(); + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.angle = readFIXED(); + ret.distance = readFIXED(); + ret.strength = readFIXED8(); + ret.innerShadow = readUB(1) == 1; + ret.knockout = readUB(1) == 1; + ret.compositeSource = readUB(1) == 1; + ret.onTop = readUB(1) == 1; + ret.passes = (int) readUB(4); + return ret; + } + + /** + * Reads one GRADIENTGLOWFILTER value from the stream + * + * @return GRADIENTGLOWFILTER value + * @throws IOException + */ + public GRADIENTGLOWFILTER readGRADIENTGLOWFILTER() throws IOException { + GRADIENTGLOWFILTER ret = new GRADIENTGLOWFILTER(); + int numColors = readUI8(); + ret.gradientColors = new RGBA[numColors]; + ret.gradientRatio = new int[numColors]; + for (int i = 0; i < numColors; i++) { + ret.gradientColors[i] = readRGBA(); + } + for (int i = 0; i < numColors; i++) { + ret.gradientRatio[i] = readUI8(); + } + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.angle = readFIXED(); + ret.distance = readFIXED(); + ret.strength = readFIXED8(); + ret.innerShadow = readUB(1) == 1; + ret.knockout = readUB(1) == 1; + ret.compositeSource = readUB(1) == 1; + ret.onTop = readUB(1) == 1; + ret.passes = (int) readUB(4); + return ret; + } + + /** + * Reads one GRADIENTBEVELFILTER value from the stream + * + * @return GRADIENTBEVELFILTER value + * @throws IOException + */ + public GRADIENTBEVELFILTER readGRADIENTBEVELFILTER() throws IOException { + GRADIENTBEVELFILTER ret = new GRADIENTBEVELFILTER(); + int numColors = readUI8(); + ret.gradientColors = new RGBA[numColors]; + ret.gradientRatio = new int[numColors]; + for (int i = 0; i < numColors; i++) { + ret.gradientColors[i] = readRGBA(); + } + for (int i = 0; i < numColors; i++) { + ret.gradientRatio[i] = readUI8(); + } + ret.blurX = readFIXED(); + ret.blurY = readFIXED(); + ret.angle = readFIXED(); + ret.distance = readFIXED(); + ret.strength = readFIXED8(); + ret.innerShadow = readUB(1) == 1; + ret.knockout = readUB(1) == 1; + ret.compositeSource = readUB(1) == 1; + ret.onTop = readUB(1) == 1; + ret.passes = (int) readUB(4); + return ret; + } + + + /** + * Reads list of FILTER values from the stream + * + * @return List of FILTER values + * @throws IOException + */ + public List readFILTERLIST() throws IOException { + List ret = new ArrayList(); + int numberOfFilters = readUI8(); + for (int i = 0; i < numberOfFilters; i++) { + ret.add(readFILTER()); + } + return ret; + } + + /** + * Reads one FILTER value from the stream + * + * @return FILTER value + * @throws IOException + */ + public FILTER readFILTER() throws IOException { + int filterId = readUI8(); + switch (filterId) { + case 0: + return readDROPSHADOWFILTER(); + case 1: + return readBLURFILTER(); + case 2: + return readGLOWFILTER(); + case 3: + return readBEVELFILTER(); + case 4: + return readGRADIENTGLOWFILTER(); + case 5: + return readCONVOLUTIONFILTER(); + case 6: + return readCOLORMATRIXFILTER(); + case 7: + return readGRADIENTBEVELFILTER(); + default: + return null; + } + } + + /** + * Reads list of BUTTONRECORD values from the stream + * + * @param inDefineButton2 Whether read from inside of DefineButton2Tag or not + * @return List of BUTTONRECORD values + * @throws IOException + */ + public List readBUTTONRECORDList(boolean inDefineButton2) throws IOException { + List ret = new ArrayList(); + BUTTONRECORD br; + while ((br = readBUTTONRECORD(inDefineButton2)) != null) { + ret.add(br); + } + return ret; + } + + /** + * Reads one BUTTONRECORD value from the stream + * + * @return BUTTONRECORD value + * @throws IOException + */ + public BUTTONRECORD readBUTTONRECORD(boolean inDefineButton2) throws IOException { + BUTTONRECORD ret = new BUTTONRECORD(); + int res = (int) readUB(2); //reserved + ret.buttonHasBlendMode = readUB(1) == 1; + ret.buttonHasFilterList = readUB(1) == 1; + ret.buttonStateHitTest = readUB(1) == 1; + ret.buttonStateDown = readUB(1) == 1; + ret.buttonStateOver = readUB(1) == 1; + ret.buttonStateUp = readUB(1) == 1; + + if (!ret.buttonHasBlendMode) + if (!ret.buttonHasFilterList) + if (!ret.buttonStateHitTest) + if (!ret.buttonStateDown) + if (!ret.buttonStateOver) + if (!ret.buttonStateUp) + if (res == 0) + return null; + + ret.characterId = readUI16(); + ret.placeDepth = readUI16(); + ret.placeMatrix = readMatrix(); + if (inDefineButton2) { + ret.colorTransform = readCXFORMWITHALPHA(); + if (ret.buttonHasFilterList) { + ret.filterList = readFILTERLIST(); + } + if (ret.buttonHasBlendMode) { + ret.blendMode = readUI8(); + } + } + return ret; + } + + /** + * Reads list of BUTTONCONDACTION values from the stream + * + * @return List of BUTTONCONDACTION values + * @throws IOException + */ + public List readBUTTONCONDACTIONList() throws IOException { + List ret = new ArrayList(); + BUTTONCONDACTION bc; + while (!(bc = readBUTTONCONDACTION()).isLast) { + ret.add(bc); + } + ret.add(bc); + return ret; + } + + /** + * Reads one BUTTONCONDACTION value from the stream + * + * @return BUTTONCONDACTION value + * @throws IOException + */ + public BUTTONCONDACTION readBUTTONCONDACTION() throws IOException { + BUTTONCONDACTION ret = new BUTTONCONDACTION(); + int condActionSize = readUI16(); + ret.isLast = condActionSize == 0; + ret.condIdleToOverDown = readUB(1) == 1; + ret.condOutDownToIdle = readUB(1) == 1; + ret.condOutDownToOverDown = readUB(1) == 1; + ret.condOverDownToOutDown = readUB(1) == 1; + ret.condOverDownToOverUp = readUB(1) == 1; + ret.condOverUpToOverDown = readUB(1) == 1; + ret.condOverUpToIddle = readUB(1) == 1; + ret.condIdleToOverUp = readUB(1) == 1; + ret.condKeyPress = (int) readUB(7); + ret.condOverDownToIddle = readUB(1) == 1; + ret.actions = readActionList(); + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/SWFOutputStream.java b/trunk/src/com/jpexs/asdec/SWFOutputStream.java new file mode 100644 index 000000000..e26d2c5b0 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/SWFOutputStream.java @@ -0,0 +1,918 @@ +package com.jpexs.asdec; + +import com.jpexs.asdec.action.Action; +import com.jpexs.asdec.tags.Tag; +import com.jpexs.asdec.types.*; +import com.jpexs.asdec.types.filters.*; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; + +/** + * Class for writing data into SWF file + * + * @author JPEXS + */ +public class SWFOutputStream extends OutputStream { + private OutputStream os; + private int version; + private long pos = 0; + + /** + * Constructor + * + * @param os OutputStream for writing data + * @param version Version of SWF + */ + public SWFOutputStream(OutputStream os, int version) { + this.version = version; + this.os = os; + } + + /** + * Writes byte to the stream + * + * @param b byte to write + * @throws IOException + */ + @Override + public void write(int b) throws IOException { + alignByte(); + os.write(b); + pos++; + } + + private void alignByte() throws IOException { + if (bitPos > 0) { + bitPos = 0; + write(tempByte); + tempByte = 0; + } + } + + /** + * Writes UI8 (Unsigned 8bit integer) value to the stream + * + * @param val UI8 value to write + * @throws IOException + */ + public void writeUI8(int val) throws IOException { + write(val); + } + + /** + * Writes String value to the stream + * + * @param value String value + * @throws IOException + */ + public void writeString(String value) throws IOException { + write(value.getBytes("utf8")); + write(0); + } + + /** + * Writes UI32 (Unsigned 32bit integer) value to the stream + * + * @param value UI32 value + * @throws IOException + */ + public void writeUI32(long value) throws IOException { + write((int) (value & 0xff)); + write((int) ((value >> 8) & 0xff)); + write((int) ((value >> 16) & 0xff)); + write((int) ((value >> 24) & 0xff)); + } + + /** + * Writes UI16 (Unsigned 16bit integer) value to the stream + * + * @param value UI16 value + * @throws IOException + */ + public void writeUI16(int value) throws IOException { + write((int) (value & 0xff)); + write((int) ((value >> 8) & 0xff)); + } + + /** + * Writes SI32 (Signed 32bit integer) value to the stream + * + * @param value SI32 value + * @throws IOException + */ + public void writeSI32(long value) throws IOException { + writeUI32(value); + } + + /** + * Writes SI16 (Signed 16bit integer) value to the stream + * + * @param value SI16 value + * @throws IOException + */ + public void writeSI16(int value) throws IOException { + writeUI16(value); + } + + /** + * Writes SI8 (Signed 8bit integer) value to the stream + * + * @param value SI8 value + * @throws IOException + */ + public void writeSI8(int value) throws IOException { + writeUI8(value); + } + + /** + * Writes FIXED (Fixed point 16.16) value to the stream + * + * @param value FIXED value + * @throws IOException + */ + public void writeFIXED(double value) throws IOException { + long valueLong = (long) (value * (1 << 16)); + int beforePoint = (int) valueLong >> 16; + + int afterPoint = (int) valueLong % (1 << 16); + writeUI16(afterPoint); + writeUI16(beforePoint); + } + + /** + * Writes FIXED8 (Fixed point 8.8) value to the stream + * + * @param value FIXED8 value + * @throws IOException + */ + public void writeFIXED8(float value) throws IOException { + int beforePoint = (int) getIntPart(value); + int afterPoint = (int) getIntPart((value + (value < 0 ? beforePoint : -beforePoint)) * 256); + writeUI8(afterPoint); + writeUI8(beforePoint); + } + + private void writeLong(long value) throws IOException { + byte writeBuffer[] = new byte[8]; + writeBuffer[3] = (byte) (value >>> 56); + writeBuffer[2] = (byte) (value >>> 48); + writeBuffer[1] = (byte) (value >>> 40); + writeBuffer[0] = (byte) (value >>> 32); + writeBuffer[7] = (byte) (value >>> 24); + writeBuffer[6] = (byte) (value >>> 16); + writeBuffer[5] = (byte) (value >>> 8); + writeBuffer[4] = (byte) (value >>> 0); + write(writeBuffer); + } + + /** + * Writes DOUBLE (double precision floating point value) value to the stream + * + * @param value DOUBLE value + * @throws IOException + */ + public void writeDOUBLE(double value) throws IOException { + writeLong(Double.doubleToLongBits(value)); + } + + /** + * Writes FLOAT (single precision floating point value) value to the stream + * + * @param value FLOAT value + * @throws IOException + */ + public void writeFLOAT(float value) throws IOException { + writeUI32(Float.floatToIntBits(value)); + } + + /** + * Writes FLOAT16 (16bit floating point value) value to the stream + * + * @param value FLOAT16 value + * @throws IOException + */ + public void writeFLOAT16(float value) throws IOException { + int bits = Float.floatToRawIntBits(value); + int sign = bits >> 31; + int exponent = (bits >> 22) & 0xff; + int mantisa = bits & 0x3FFFFF; + mantisa = mantisa >> 13; + writeUI16((sign << 15) + (exponent << 10) + mantisa); + } + + /** + * Writes EncodedU32 (Encoded unsigned 32bit value) value to the stream + * + * @param value U32 value + * @throws IOException + */ + public void writeEncodedU32(long value) throws IOException { + boolean loop = true; + value = value & 0xFFFFFFFF; + do { + int ret = (int) (value & 0x7F); + if (value < 0x80) { + loop = false; + } + if (value > 0x7F) { + ret += 0x80; + } + write(ret); + value = value >> 7; + } while (loop); + } + + private int bitPos = 0; + private int tempByte = 0; + + /** + * Flushes data to underlying stream + * + * @throws IOException + */ + @Override + public void flush() throws IOException { + if (bitPos > 0) { + bitPos = 0; + write(tempByte); + tempByte = 0; + } + os.flush(); + } + + /** + * Closes the stream + * + * @throws IOException + */ + @Override + public void close() throws IOException { + flush(); + os.close(); + } + + /** + * Writes UB[nBits] (Unsigned-bit value) value to the stream + * + * @param nBits Number of bits which represent value + * @param value Unsigned value to write + * @throws IOException + */ + public void writeUB(int nBits, long value) throws IOException { + for (int bit = 0; bit < nBits; bit++) { + int nb = (int) ((value >> (nBits - 1 - bit)) & 1); + tempByte += nb * (1 << (7 - bitPos)); + bitPos++; + if (bitPos == 8) { + bitPos = 0; + write(tempByte); + tempByte = 0; + } + } + } + + /** + * Writes SB[nBits] (Signed-bit value) value to the stream + * + * @param nBits Number of bits which represent value + * @param value Signed value to write + * @throws IOException + */ + public void writeSB(int nBits, long value) throws IOException { + writeUB(nBits, value); + } + + /** + * Writes FB[nBits] (Signed fixed-point bit value) value to the stream + * + * @param nBits Number of bits which represent value + * @param value Double value to write + * @throws IOException + */ + public void writeFB(int nBits, double value) throws IOException { + long longVal = (long) (value * (1 << 16)); + writeSB(nBits, longVal); + } + + /** + * Writes RECT value to the stream + * + * @param value RECT value + * @throws IOException + */ + public void writeRECT(RECT value) throws IOException { + int nBits = 0; + nBits = enlargeBitCountS(nBits, value.Xmin); + nBits = enlargeBitCountS(nBits, value.Xmax); + nBits = enlargeBitCountS(nBits, value.Ymin); + nBits = enlargeBitCountS(nBits, value.Ymax); + + writeUB(5, nBits); + writeSB(nBits, value.Xmin); + writeSB(nBits, value.Xmax); + writeSB(nBits, value.Ymin); + writeSB(nBits, value.Ymax); + } + + /** + * Writes list of Tag values to the stream + * + * @param tags List of tag values + * @throws IOException + */ + public void writeTags(List tags) throws IOException { + for (Tag tag : tags) { + writeTag(tag); + } + } + + /** + * Writes Tag value to the stream + * + * @param tag Tag value + * @throws IOException + */ + public void writeTag(Tag tag) throws IOException { + byte data[] = tag.getData(version); + int tagLength = data.length; + int tagID = tag.getId(); + int tagIDLength = (tagID << 6); + if ((tagLength < 0x3f) && (!tag.forceWriteAsLong)) { + tagIDLength += tagLength; + writeUI16(tagIDLength); + } else { + tagIDLength += 0x3f; + writeUI16(tagIDLength); + writeSI32(tagLength); + } + write(data); + } + + /** + * Calculates number of bits needed for representing unsigned value + * + * @param v Unsigned value + * @return Number of bits + */ + public static int getNeededBitsU(long v) { + + int n = 32; + long m = 0x80000000; + if (v == 0x00000000) n = 0; + else + while (!((v & m) > 0)) { + n--; + m >>= 1; + } + return n; + /*if (value == 0) { + return 1; + } + return Long.toBinaryString(value).length();*/ + } + + /** + * Calculates number of bits needed for representing signed value + * + * @param v Signed value + * @return Number of bits + */ + public static int getNeededBitsS(long v) { + int n = 33; + long m = 0x80000000; + if ((v & m) == m) { + if (v == 0xffffffff) n = 1; + else + while ((v & m) == m) { + n--; + m >>= 1; + } + } else { + if (v == 0x00000000) n = 1; + else + while ((v & m) == 0) { + n--; + m >>= 1; + } + } + return n; + /*if (value == 0) { + return 1; + } + if (value == -1) { + return 2; + } + if (value < 0) { + String str = Long.toBinaryString(value); + for (int i = 0; i < str.length(); i++) { + if (str.charAt(i) == '0') { + return str.length() - 1 - i + 2; + } + } + return 1; + } else { + return Long.toBinaryString(value).length() + 1; + } */ + } + + + private static long getIntPart(double value) { + if (value < 0) return (long) Math.ceil(value); + return (long) Math.floor(value); + } + + private static double getFloatPart(double value) { + if (value < 0) return value - getIntPart(value); + return value + getIntPart(value); + } + + /** + * Calculates number of bits needed for representing fixed-point value + * + * @param value Fixed-point value + * @return Number of bits + */ + public static int getNeededBitsF(double value) { + if (value == -1) return 18; + long val = (long) (value * (1 << 16)); + return getNeededBitsS(val); + } + + private int enlargeBitCountU(int currentBitCount, long value) { + int neededNew = getNeededBitsU(value); + if (neededNew > currentBitCount) return neededNew; + return currentBitCount; + } + + private int enlargeBitCountS(int currentBitCount, long value) { + int neededNew = getNeededBitsS(value); + if (neededNew > currentBitCount) return neededNew; + return currentBitCount; + } + + private int enlargeBitCountF(int currentBitCount, double value) { + int neededNew = getNeededBitsF(value); + if (neededNew > currentBitCount) return neededNew; + return currentBitCount; + } + + /** + * Writes MATRIX value to the stream + * + * @param value MATRIX value + * @throws IOException + */ + public void writeMatrix(MATRIX value) throws IOException { + writeUB(1, value.hasScale ? 1 : 0); + if (value.hasScale) { + int nBits = 0; + nBits = enlargeBitCountF(nBits, value.scaleX); + nBits = enlargeBitCountF(nBits, value.scaleY); + nBits = value.scaleNBits; //FFFUUU + writeUB(5, nBits); + writeFB(nBits, value.scaleX); + writeFB(nBits, value.scaleY); + } + writeUB(1, value.hasRotate ? 1 : 0); + if (value.hasRotate) { + int nBits = 0; + nBits = enlargeBitCountF(nBits, value.rotateSkew0); + nBits = enlargeBitCountF(nBits, value.rotateSkew1); + nBits = value.rotateNBits; //FFFUUU + writeUB(5, nBits); + writeFB(nBits, value.rotateSkew0); + writeFB(nBits, value.rotateSkew1); + } + int NTranslateBits = 0; + NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateX); + NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateY); + NTranslateBits = value.translateNBits; //FFFUUU + writeUB(5, NTranslateBits); + + + writeSB(NTranslateBits, value.translateX); + writeSB(NTranslateBits, value.translateY); + alignByte(); + + } + + /** + * Writes CXFORMWITHALPHA value to the stream + * + * @param value CXFORMWITHALPHA value + * @throws IOException + */ + public void writeCXFORMWITHALPHA(CXFORMWITHALPHA value) throws IOException { + writeUB(1, value.hasAddTerms ? 1 : 0); + writeUB(1, value.hasMultTerms ? 1 : 0); + int Nbits = 1; + if (value.hasMultTerms) { + Nbits = enlargeBitCountS(Nbits, value.redMultTerm); + Nbits = enlargeBitCountS(Nbits, value.greenMultTerm); + Nbits = enlargeBitCountS(Nbits, value.blueMultTerm); + Nbits = enlargeBitCountS(Nbits, value.alphaMultTerm); + } + if (value.hasAddTerms) { + Nbits = enlargeBitCountS(Nbits, value.redAddTerm); + Nbits = enlargeBitCountS(Nbits, value.greenAddTerm); + Nbits = enlargeBitCountS(Nbits, value.blueAddTerm); + Nbits = enlargeBitCountS(Nbits, value.alphaAddTerm); + } + writeUB(4, Nbits); + if (value.hasMultTerms) { + writeSB(Nbits, value.redMultTerm); + writeSB(Nbits, value.greenMultTerm); + writeSB(Nbits, value.blueMultTerm); + writeSB(Nbits, value.alphaMultTerm); + } + if (value.hasAddTerms) { + writeSB(Nbits, value.redAddTerm); + writeSB(Nbits, value.greenAddTerm); + writeSB(Nbits, value.blueAddTerm); + writeSB(Nbits, value.alphaAddTerm); + } + alignByte(); + } + + /** + * Writes CLIPEVENTFLAGS value to the stream + * + * @param value CLIPEVENTFLAGS value + * @throws IOException + */ + public void writeCLIPEVENTFLAGS(CLIPEVENTFLAGS value) throws IOException { + writeUB(1, value.clipEventKeyUp ? 1 : 0); + writeUB(1, value.clipEventKeyDown ? 1 : 0); + writeUB(1, value.clipEventMouseUp ? 1 : 0); + writeUB(1, value.clipEventMouseDown ? 1 : 0); + writeUB(1, value.clipEventMouseMove ? 1 : 0); + writeUB(1, value.clipEventUnload ? 1 : 0); + writeUB(1, value.clipEventEnterFrame ? 1 : 0); + writeUB(1, value.clipEventLoad ? 1 : 0); + writeUB(1, value.clipEventDragOver ? 1 : 0); + writeUB(1, value.clipEventRollOut ? 1 : 0); + writeUB(1, value.clipEventRollOver ? 1 : 0); + writeUB(1, value.clipEventReleaseOutside ? 1 : 0); + writeUB(1, value.clipEventRelease ? 1 : 0); + writeUB(1, value.clipEventPress ? 1 : 0); + writeUB(1, value.clipEventInitialize ? 1 : 0); + writeUB(1, value.clipEventData ? 1 : 0); + if (version >= 6) { + writeUB(5, 0); + writeUB(1, value.clipEventConstruct ? 1 : 0); + writeUB(1, value.clipEventKeyPress ? 1 : 0); + writeUB(1, value.clipEventDragOut ? 1 : 0); + writeUB(8, 0); + } + } + + /** + * Writes CLIPACTIONRECORD value to the stream + * + * @param value CLIPACTIONRECORD value + * @throws IOException + */ + public void writeCLIPACTIONRECORD(CLIPACTIONRECORD value) throws IOException { + writeCLIPEVENTFLAGS(value.eventFlags); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos = new SWFOutputStream(baos, version); + + if (value.eventFlags.clipEventKeyPress) { + sos.writeUI8(value.keyCode); + } + sos.write(Action.actionsToBytes(value.actions, true, version)); + sos.close(); + byte data[] = baos.toByteArray(); + writeUI32(data.length); //actionRecordSize + write(data); + } + + + /** + * Writes CLIPACTIONS value to the stream + * + * @param value CLIPACTIONS value + * @throws IOException + */ + public void writeCLIPACTIONS(CLIPACTIONS value) throws IOException { + writeUI16(0);//reserved + writeCLIPEVENTFLAGS(value.allEventFlags); + for (CLIPACTIONRECORD car : value.clipActionRecords) { + writeCLIPACTIONRECORD(car); + } + if (version <= 5) { + writeUI16(0); + } else { + writeUI32(0); + } + } + + /** + * Writes COLORMATRIXFILTER value to the stream + * + * @param value COLORMATRIXFILTER value + * @throws IOException + */ + public void writeCOLORMATRIXFILTER(COLORMATRIXFILTER value) throws IOException { + for (int i = 0; i < 20; i++) { + writeFLOAT(value.matrix[i]); + } + } + + /** + * Writes RGBA value to the stream + * + * @param value RGBA value + * @throws IOException + */ + public void writeRGBA(RGBA value) throws IOException { + writeUI8(value.red); + writeUI8(value.green); + writeUI8(value.blue); + writeUI8(value.alpha); + } + + /** + * Writes CONVOLUTIONFILTER value to the stream + * + * @param value CONVOLUTIONFILTER value + * @throws IOException + */ + public void writeCONVOLUTIONFILTER(CONVOLUTIONFILTER value) throws IOException { + writeUI8(value.matrixX); + writeUI8(value.matrixY); + writeFLOAT(value.divisor); + writeFLOAT(value.bias); + for (int x = 0; x < value.matrixX; x++) { + for (int y = 0; y < value.matrixY; y++) { + writeFLOAT(value.matrix[x][y]); + } + } + writeRGBA(value.defaultColor); + writeUB(6, 0); //reserved + writeUB(1, value.clamp ? 1 : 0); + writeUB(1, value.preserveAlpha ? 1 : 0); + } + + /** + * Writes BLURFILTER value to the stream + * + * @param value BLURFILTER value + * @throws IOException + */ + public void writeBLURFILTER(BLURFILTER value) throws IOException { + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeUB(5, value.passes); + writeUB(3, 0);//reserved + } + + /** + * Writes DROPSHADOWFILTER value to the stream + * + * @param value DROPSHADOWFILTER value + * @throws IOException + */ + public void writeDROPSHADOWFILTER(DROPSHADOWFILTER value) throws IOException { + writeRGBA(value.dropShadowColor); + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeFIXED(value.angle); + writeFIXED(value.distance); + writeFIXED8(value.strength); + writeUB(1, value.innerShadow ? 1 : 0); + writeUB(1, value.knockout ? 1 : 0); + writeUB(1, value.compositeSource ? 1 : 0); + writeUB(5, value.passes); + } + + /** + * Writes GLOWFILTER value to the stream + * + * @param value GLOWFILTER value + * @throws IOException + */ + public void writeGLOWFILTER(GLOWFILTER value) throws IOException { + writeRGBA(value.glowColor); + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeFIXED8(value.strength); + writeUB(1, value.innerGlow ? 1 : 0); + writeUB(1, value.knockout ? 1 : 0); + writeUB(1, value.compositeSource ? 1 : 0); + writeUB(5, value.passes); + } + + /** + * Writes BEVELFILTER value to the stream + * + * @param value BEVELFILTER value + * @throws IOException + */ + public void writeBEVELFILTER(BEVELFILTER value) throws IOException { + writeRGBA(value.shadowColor); + writeRGBA(value.highlightColor); + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeFIXED(value.angle); + writeFIXED(value.distance); + writeFIXED8(value.strength); + writeUB(1, value.innerShadow ? 1 : 0); + writeUB(1, value.knockout ? 1 : 0); + writeUB(1, value.compositeSource ? 1 : 0); + writeUB(1, value.onTop ? 1 : 0); + writeUB(4, value.passes); + } + + /** + * Writes GRADIENTGLOWFILTER value to the stream + * + * @param value GRADIENTGLOWFILTER value + * @throws IOException + */ + public void writeGRADIENTGLOWFILTER(GRADIENTGLOWFILTER value) throws IOException { + writeUI8(value.gradientColors.length); + for (int i = 0; i < value.gradientColors.length; i++) { + writeRGBA(value.gradientColors[i]); + } + for (int i = 0; i < value.gradientColors.length; i++) { + writeUI8(value.gradientRatio[i]); + } + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeFIXED(value.angle); + writeFIXED(value.distance); + writeFIXED8(value.strength); + writeUB(1, value.innerShadow ? 1 : 0); + writeUB(1, value.knockout ? 1 : 0); + writeUB(1, value.compositeSource ? 1 : 0); + writeUB(1, value.onTop ? 1 : 0); + writeUB(4, value.passes); + } + + /** + * Writes GRADIENTBEVELFILTER value to the stream + * + * @param value GRADIENTBEVELFILTER value + * @throws IOException + */ + public void writeGRADIENTBEVELFILTER(GRADIENTBEVELFILTER value) throws IOException { + writeUI8(value.gradientColors.length); + for (int i = 0; i < value.gradientColors.length; i++) { + writeRGBA(value.gradientColors[i]); + } + for (int i = 0; i < value.gradientColors.length; i++) { + writeUI8(value.gradientRatio[i]); + } + writeFIXED(value.blurX); + writeFIXED(value.blurY); + writeFIXED(value.angle); + writeFIXED(value.distance); + writeFIXED8(value.strength); + writeUB(1, value.innerShadow ? 1 : 0); + writeUB(1, value.knockout ? 1 : 0); + writeUB(1, value.compositeSource ? 1 : 0); + writeUB(1, value.onTop ? 1 : 0); + writeUB(4, value.passes); + } + + /** + * Writes list of FILTER values to the stream + * + * @param list List of FILTER values + * @throws IOException + */ + public void writeFILTERLIST(List list) throws IOException { + writeUI8(list.size()); + for (int i = 0; i < list.size(); i++) { + writeFILTER(list.get(i)); + } + } + + /** + * Writes FILTER value to the stream + * + * @param value FILTER value + * @throws IOException + */ + public void writeFILTER(FILTER value) throws IOException { + writeUI8(value.id); + switch (value.id) { + case 0: + writeDROPSHADOWFILTER((DROPSHADOWFILTER) value); + break; + case 1: + writeBLURFILTER((BLURFILTER) value); + break; + case 2: + writeGLOWFILTER((GLOWFILTER) value); + break; + case 3: + writeBEVELFILTER((BEVELFILTER) value); + break; + case 4: + writeGRADIENTGLOWFILTER((GRADIENTGLOWFILTER) value); + break; + case 5: + writeCONVOLUTIONFILTER((CONVOLUTIONFILTER) value); + break; + case 6: + writeCOLORMATRIXFILTER((COLORMATRIXFILTER) value); + break; + case 7: + writeGRADIENTBEVELFILTER((GRADIENTBEVELFILTER) value); + break; + } + } + + /** + * Writes list of BUTTONRECORD values to the stream + * + * @param list List of BUTTONRECORD values + * @param inDefineButton2 Whether write inside of DefineButton2Tag or not + * @throws IOException + */ + public void writeBUTTONRECORDList(List list, boolean inDefineButton2) throws IOException { + for (BUTTONRECORD brec : list) { + writeBUTTONRECORD(brec, inDefineButton2); + } + writeUI8(0); + } + + /** + * Writes BUTTONRECORD value to the stream + * + * @param value BUTTONRECORD value + * @param inDefineButton2 Whether write inside of DefineButton2Tag or not + * @throws IOException + */ + public void writeBUTTONRECORD(BUTTONRECORD value, boolean inDefineButton2) throws IOException { + writeUB(2, 0);//reserved + writeUB(1, value.buttonHasBlendMode ? 1 : 0); + writeUB(1, value.buttonHasFilterList ? 1 : 0); + writeUB(1, value.buttonStateHitTest ? 1 : 0); + writeUB(1, value.buttonStateDown ? 1 : 0); + writeUB(1, value.buttonStateOver ? 1 : 0); + writeUB(1, value.buttonStateUp ? 1 : 0); + writeUI16(value.characterId); + writeUI16(value.placeDepth); + writeMatrix(value.placeMatrix); + if (inDefineButton2) { + writeCXFORMWITHALPHA(value.colorTransform); + if (value.buttonHasFilterList) { + writeFILTERLIST(value.filterList); + } + if (value.buttonHasBlendMode) { + writeUI8(value.blendMode); + } + } + } + + /** + * Writes list of BUTTONCONDACTION values to the stream + * + * @param list List of BUTTONCONDACTION values + * @throws IOException + */ + public void writeBUTTONCONDACTIONList(List list) throws IOException { + for (int i = 0; i < list.size(); i++) { + writeBUTTONCONDACTION(list.get(i), i == list.size() - 1); + } + } + + /** + * Writes BUTTONCONDACTION value to the stream + * + * @param value BUTTONCONDACTION value + * @param isLast True if it is last on the list + * @throws IOException + */ + public void writeBUTTONCONDACTION(BUTTONCONDACTION value, boolean isLast) throws IOException { + BUTTONCONDACTION ret = new BUTTONCONDACTION(); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos = new SWFOutputStream(baos, version); + sos.writeUB(1, value.condIdleToOverDown ? 1 : 0); + sos.writeUB(1, value.condOutDownToIdle ? 1 : 0); + sos.writeUB(1, value.condOutDownToOverDown ? 1 : 0); + sos.writeUB(1, value.condOverDownToOutDown ? 1 : 0); + sos.writeUB(1, value.condOverDownToOverUp ? 1 : 0); + sos.writeUB(1, value.condOverUpToOverDown ? 1 : 0); + sos.writeUB(1, value.condOverUpToIddle ? 1 : 0); + sos.writeUB(1, value.condIdleToOverUp ? 1 : 0); + sos.writeUB(7, value.condKeyPress); + sos.writeUB(1, value.condOverDownToIddle ? 1 : 0); + sos.write(Action.actionsToBytes(value.actions, true, version)); + sos.close(); + byte data[] = baos.toByteArray(); + if (isLast) { + writeUI16(0); + } else { + writeUI16(data.length + 2); + } + write(data); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/ABC.java b/trunk/src/com/jpexs/asdec/abc/ABC.java new file mode 100644 index 000000000..f6620ab68 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/ABC.java @@ -0,0 +1,728 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.UnknownInstructionCode; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.InitPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.*; +import com.jpexs.asdec.abc.types.traits.Trait; +import com.jpexs.asdec.abc.types.traits.TraitMethodGetterSetter; +import com.jpexs.asdec.abc.types.traits.TraitSlotConst; +import com.jpexs.asdec.helpers.Highlighting; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; + + +public class ABC { + + public int major_version = 0; + public int minor_version = 0; + public ConstantPool constants; + public MethodInfo method_info[]; + public MetadataInfo metadata_info[]; + public InstanceInfo instance_info[]; + public ClassInfo class_info[]; + public ScriptInfo script_info[]; + public MethodBody bodies[]; + public long stringOffsets[]; + public static String IDENT_STRING = " "; + + public ABC(InputStream is) throws IOException { + + ABCInputStream ais = new ABCInputStream(is); + major_version = ais.readU16(); + minor_version = ais.readU16(); + constants = new ConstantPool(); + //constant integers + int constant_int_pool_count = ais.readU30(); + constants.constant_int = new long[constant_int_pool_count]; + for (int i = 1; i < constant_int_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_int[i] = ais.readS32(); + } + + //constant unsigned integers + int constant_uint_pool_count = ais.readU30(); + constants.constant_uint = new long[constant_uint_pool_count]; + for (int i = 1; i < constant_uint_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_uint[i] = ais.readU32(); + } + + //constant double + int constant_double_pool_count = ais.readU30(); + constants.constant_double = new double[constant_double_pool_count]; + for (int i = 1; i < constant_double_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_double[i] = ais.readDouble(); + } + + //constant string + int constant_string_pool_count = ais.readU30(); + constants.constant_string = new String[constant_string_pool_count]; + stringOffsets = new long[constant_string_pool_count]; + constants.constant_string[0] = ""; + for (int i = 1; i < constant_string_pool_count; i++) { //index 0 not used. Values 1..n-1 + long pos = ais.getPosition(); + constants.constant_string[i] = ais.readString(); + stringOffsets[i] = pos; + /* + INVALID STRINGS + + String invalidStr=",,if,else,finally,while,int,switch,return,case,do,"; + if(invalidStr.contains(","+constants.constant_string[i]+",")){ + //constants.constant_string[i]="s"+i+"/"+constants.constant_string[i]; + }*/ + } + + //constant namespace + int constant_namespace_pool_count = ais.readU30(); + constants.constant_namespace = new Namespace[constant_namespace_pool_count]; + for (int i = 1; i < constant_namespace_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_namespace[i] = ais.readNamespace(); + cleanOneName(constants.constant_namespace[i].name_index); + } + + //constant namespace set + int constant_namespace_set_pool_count = ais.readU30(); + constants.constant_namespace_set = new NamespaceSet[constant_namespace_set_pool_count]; + for (int i = 1; i < constant_namespace_set_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_namespace_set[i] = new NamespaceSet(); + int namespace_count = ais.readU30(); + constants.constant_namespace_set[i].namespaces = new int[namespace_count]; + for (int j = 0; j < namespace_count; j++) { + constants.constant_namespace_set[i].namespaces[j] = ais.readU30(); + } + } + + + //constant multiname + int constant_multiname_pool_count = ais.readU30(); + constants.constant_multiname = new Multiname[constant_multiname_pool_count]; + for (int i = 1; i < constant_multiname_pool_count; i++) { //index 0 not used. Values 1..n-1 + constants.constant_multiname[i] = ais.readMultiname(); + cleanNamespace(constants.constant_multiname[i].name_index); + } + + + //method info + int methods_count = ais.readU30(); + method_info = new MethodInfo[methods_count]; + for (int i = 0; i < methods_count; i++) { //index 0 not used. Values 1..n-1 + method_info[i] = ais.readMethodInfo(); + } + + //metadata info + int metadata_count = ais.readU30(); + metadata_info = new MetadataInfo[metadata_count]; + for (int i = 0; i < metadata_count; i++) { //index 0 not used. Values 1..n-1 + int name_index = ais.readU30(); + int values_count = ais.readU30(); + int keys[] = new int[values_count]; + for (int v = 0; v < values_count; v++) { + keys[v] = ais.readU30(); + } + int values[] = new int[values_count]; + for (int v = 0; v < values_count; v++) { + values[v] = ais.readU30(); + } + metadata_info[i] = new MetadataInfo(name_index, keys, values); + } + + int class_count = ais.readU30(); + instance_info = new InstanceInfo[class_count]; + for (int i = 0; i < class_count; i++) { + instance_info[i] = ais.readInstanceInfo(); + } + class_info = new ClassInfo[class_count]; + for (int i = 0; i < class_count; i++) { + class_info[i] = new ClassInfo(); + class_info[i].cinit_index = ais.readU30(); + class_info[i].static_traits = ais.readTraits(); + } + int script_count = ais.readU30(); + script_info = new ScriptInfo[script_count]; + for (int i = 0; i < script_count; i++) { + script_info[i] = new ScriptInfo(); + script_info[i].init_index = ais.readU30(); + script_info[i].traits = ais.readTraits(); + } + + int bodies_count = ais.readU30(); + bodies = new MethodBody[bodies_count]; + for (int i = 0; i < bodies_count; i++) { + bodies[i] = new MethodBody(); + bodies[i].method_info = ais.readU30(); + bodies[i].max_stack = ais.readU30(); + bodies[i].max_regs = ais.readU30(); + bodies[i].scope_depth = ais.readU30(); + bodies[i].max_scope = ais.readU30(); + int code_length = ais.readU30(); + bodies[i].codeBytes = new byte[code_length]; + for (int j = 0; j < code_length; j++) { + bodies[i].codeBytes[j] = (byte) ais.read(); + } + try { + bodies[i].code = new AVM2Code(new ByteArrayInputStream(bodies[i].codeBytes)); + } catch (UnknownInstructionCode re) { + bodies[i].code = new AVM2Code(); + System.err.println(re.toString()); + } + int ex_count = ais.readU30(); + bodies[i].exceptions = new ABCException[ex_count]; + for (int j = 0; j < ex_count; j++) { + bodies[i].exceptions[j] = new ABCException(); + bodies[i].exceptions[j].start = ais.readU30(); + bodies[i].exceptions[j].end = ais.readU30(); + bodies[i].exceptions[j].target = ais.readU30(); + bodies[i].exceptions[j].type_index = ais.readU30(); + bodies[i].exceptions[j].name_index = ais.readU30(); + } + bodies[i].traits = ais.readTraits(); + /*try { + bodies[i].code.clearCode(constants, bodies[i]); + } catch (ConvertException ignored) { + } */ + } + } + + public void saveToStream(OutputStream os) throws IOException { + ABCOutputStream aos = new ABCOutputStream(os); + aos.writeU16(major_version); + aos.writeU16(minor_version); + + aos.writeU30(constants.constant_int.length); + for (int i = 1; i < constants.constant_int.length; i++) { + try { + aos.writeS32(constants.constant_int[i]); + } catch (NotSameException nex) { + System.out.println("written:" + constants.constant_int[i]); + throw nex; + } + } + aos.writeU30(constants.constant_uint.length); + for (int i = 1; i < constants.constant_uint.length; i++) { + aos.writeU32(constants.constant_uint[i]); + } + + aos.writeU30(constants.constant_double.length); + for (int i = 1; i < constants.constant_double.length; i++) { + aos.writeDouble(constants.constant_double[i]); + } + + aos.writeU30(constants.constant_string.length); + for (int i = 1; i < constants.constant_string.length; i++) { + aos.writeString(constants.constant_string[i]); + } + + aos.writeU30(constants.constant_namespace.length); + for (int i = 1; i < constants.constant_namespace.length; i++) { + aos.writeNamespace(constants.constant_namespace[i]); + } + + aos.writeU30(constants.constant_namespace_set.length); + for (int i = 1; i < constants.constant_namespace_set.length; i++) { + aos.writeU30(constants.constant_namespace_set[i].namespaces.length); + for (int j = 0; j < constants.constant_namespace_set[i].namespaces.length; j++) { + aos.writeU30(constants.constant_namespace_set[i].namespaces[j]); + } + } + + aos.writeU30(constants.constant_multiname.length); + for (int i = 1; i < constants.constant_multiname.length; i++) { + aos.writeMultiname(constants.constant_multiname[i]); + } + + aos.writeU30(method_info.length); + for (int i = 0; i < method_info.length; i++) { + aos.writeMethodInfo(method_info[i]); + } + + aos.writeU30(metadata_info.length); + for (int i = 0; i < metadata_info.length; i++) { + aos.writeU30(metadata_info[i].name_index); + aos.writeU30(metadata_info[i].values.length); + for (int j = 0; j < metadata_info[i].values.length; j++) { + aos.writeU30(metadata_info[i].keys[j]); + } + for (int j = 0; j < metadata_info[i].values.length; j++) { + aos.writeU30(metadata_info[i].values[j]); + } + } + + aos.writeU30(class_info.length); + for (int i = 0; i < instance_info.length; i++) { + aos.writeInstanceInfo(instance_info[i]); + } + for (int i = 0; i < class_info.length; i++) { + aos.writeU30(class_info[i].cinit_index); + aos.writeTraits(class_info[i].static_traits); + } + aos.writeU30(script_info.length); + for (int i = 0; i < script_info.length; i++) { + aos.writeU30(script_info[i].init_index); + aos.writeTraits(script_info[i].traits); + } + + aos.writeU30(bodies.length); + for (int i = 0; i < bodies.length; i++) { + aos.writeU30(bodies[i].method_info); + aos.writeU30(bodies[i].max_stack); + aos.writeU30(bodies[i].max_regs); + aos.writeU30(bodies[i].scope_depth); + aos.writeU30(bodies[i].max_scope); + byte codeBytes[] = bodies[i].code.getBytes(); + aos.writeU30(codeBytes.length); + try { + aos.write(codeBytes); + } catch (NotSameException ex) { + System.out.println(bodies[i].code.toString(constants)); + System.exit(0); + return; + } + aos.writeU30(bodies[i].exceptions.length); + for (int j = 0; j < bodies[i].exceptions.length; j++) { + aos.writeU30(bodies[i].exceptions[j].start); + aos.writeU30(bodies[i].exceptions[j].end); + aos.writeU30(bodies[i].exceptions[j].target); + aos.writeU30(bodies[i].exceptions[j].type_index); + aos.writeU30(bodies[i].exceptions[j].name_index); + } + aos.writeTraits(bodies[i].traits); + } + } + + private void parseImportFromMultiname(List imports, Multiname m) { + if (m != null) { + Namespace ns = m.getNamespace(constants); + String name = m.getName(constants); + if (ns != null) { + String newimport = ns.getName(constants); + if (!newimport.equals("")) { + newimport += "." + name; + if (newimport.contains(":")) { + return; + } + if (!imports.contains(newimport)) { + imports.add(newimport); + } + } + } + } + } + + private List getImports(int instanceIndex) { + List imports = new ArrayList(); + + //constructor + + //parseImportFromMultiname(imports, constants.constant_multiname[instance_info[instanceIndex].name_index]); + + if (instance_info[instanceIndex].super_index > 0) { + parseImportFromMultiname(imports, constants.constant_multiname[instance_info[instanceIndex].super_index]); + } + for (int i : instance_info[instanceIndex].interfaces) { + parseImportFromMultiname(imports, constants.constant_multiname[i]); + } + //static + for (Trait t : class_info[instanceIndex].static_traits.traits) { + //parseImportFromMultiname(imports, t.getMultiName(constants)); + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; + if (tm.method_info != 0) { + MethodBody body = findBody(tm.method_info); + if (body != null) { + for (AVM2Instruction ins : body.code.code) { + for (int k = 0; k < ins.definition.operands.length; k++) { + if (ins.definition.operands[k] == AVM2Code.DAT_MULTINAME_INDEX) { + int multinameIndex = ins.operands[k]; + parseImportFromMultiname(imports, constants.constant_multiname[multinameIndex]); + } + } + } + } + for (int p = 0; p < method_info[tm.method_info].param_types.length; p++) { + if (method_info[tm.method_info].param_types[p] != 0) { + parseImportFromMultiname(imports, constants.constant_multiname[method_info[tm.method_info].param_types[p]]); + } + if (method_info[tm.method_info].ret_type != 0) { + parseImportFromMultiname(imports, constants.constant_multiname[method_info[tm.method_info].ret_type]); + } + } + } + } + + } + //instance + for (Trait t : instance_info[instanceIndex].instance_traits.traits) { + //parseImportFromMultiname(imports, t.getMultiName(constants)); + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; + if (tm.method_info != 0) { + MethodBody body = findBody(tm.method_info); + if (body != null) { + for (AVM2Instruction ins : body.code.code) { + for (int k = 0; k < ins.definition.operands.length; k++) { + if (ins.definition.operands[k] == AVM2Code.DAT_MULTINAME_INDEX) { + int multinameIndex = ins.operands[k]; + parseImportFromMultiname(imports, constants.constant_multiname[multinameIndex]); + } + } + } + } + for (int p = 0; p < method_info[tm.method_info].param_types.length; p++) { + if (method_info[tm.method_info].param_types[p] != 0) { + parseImportFromMultiname(imports, constants.constant_multiname[method_info[tm.method_info].param_types[p]]); + } + if (method_info[tm.method_info].ret_type != 0) { + parseImportFromMultiname(imports, constants.constant_multiname[method_info[tm.method_info].ret_type]); + } + } + } + } + } + return imports; + } + + public MethodBody findBody(int methodInfo) { + int pos = findBodyIndex(methodInfo); + if (pos == -1) { + return null; + } else { + return bodies[pos]; + } + } + + public int findBodyIndex(int methodInfo) { + if (methodInfo == -1) { + return -1; + } + for (int b = 0; b < bodies.length; b++) { + if (bodies[b].method_info == methodInfo) { + return b; + } + } + return -1; + } + + public MethodBody findBodyByClassAndName(String className, String methodName) { + for (int i = 0; i < instance_info.length; i++) { + if (className.equals(constants.constant_multiname[instance_info[i].name_index].getName(constants))) { + for (Trait t : instance_info[i].instance_traits.traits) { + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t; + if (methodName.equals(t2.getMethodName(constants))) { + for (MethodBody body : bodies) { + if (body.method_info == t2.method_info) { + return body; + } + } + } + } + } + //break; + } + } + for (int i = 0; i < class_info.length; i++) { + if (className.equals(constants.constant_multiname[instance_info[i].name_index].getName(constants))) { + for (Trait t : class_info[i].static_traits.traits) { + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t; + if (methodName.equals(t2.getMethodName(constants))) { + for (MethodBody body : bodies) { + if (body.method_info == t2.method_info) { + return body; + } + } + } + } + } + //break; + } + } + + + return null; + } + + private String addTabs(String s, int tabs) { + String parts[] = s.split("\r\n"); + String ret = ""; + for (int i = 0; i < parts.length; i++) { + for (int t = 0; t < tabs; t++) { + ret += IDENT_STRING; + } + ret += parts[i]; + if (i < parts.length - 1) { + ret += "\r\n"; + } + } + return ret; + } + + public int findMethodIdByTraitId(int classIndex, int traitId) { + if (traitId < class_info[classIndex].static_traits.traits.length) { + if (class_info[classIndex].static_traits.traits[traitId] instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) class_info[classIndex].static_traits.traits[traitId]).method_info; + } else { + return -1; + } + } else if (traitId < class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length) { + traitId -= class_info[classIndex].static_traits.traits.length; + if (instance_info[classIndex].instance_traits.traits[traitId] instanceof TraitMethodGetterSetter) { + return ((TraitMethodGetterSetter) instance_info[classIndex].instance_traits.traits[traitId]).method_info; + } else { + return -1; + } + } else { + traitId -= class_info[classIndex].static_traits.traits.length + instance_info[classIndex].instance_traits.traits.length; + if (traitId == 0) { + return instance_info[classIndex].iinit_index; + } else if (traitId == 1) { + return class_info[classIndex].cinit_index; + } else { + return -1; + } + } + } + + public String classToString(int i, boolean highlight) { + String ret = ""; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(baos); + String packageName = instance_info[i].getName(constants).getNamespace(constants).getName(constants); + out.println("package " + packageName); + out.println("{"); + + //imports + List imports = getImports(i); + for (String imp : imports) { + out.println(IDENT_STRING + "import " + imp + ";"); + } + out.println(); + + //class header + String classHeader = instance_info[i].getClassHeaderStr(constants); + if (classHeader.startsWith("private ")) + classHeader = "public " + classHeader.substring("private ".length()); + out.println(IDENT_STRING + classHeader); + out.println(IDENT_STRING + "{"); + + + if (class_info[i].cinit_index != 0) { + int bodyIndex = findBodyIndex(class_info[i].cinit_index); + List initializer = bodies[bodyIndex].code.toTree(true, i, this, constants, method_info, bodies[bodyIndex]); + for (TreeItem ti : initializer) { + if (ti instanceof SetPropertyTreeItem) { + int multinameIndex = ((SetPropertyTreeItem) ti).propertyName.multinameIndex; + TreeItem value = ((SetPropertyTreeItem) ti).value; + for (Trait t : class_info[i].static_traits.traits) { + if (t.name_index == multinameIndex) { + if (t instanceof TraitSlotConst) { + ((TraitSlotConst) t).assignedValue = value; + } + } + } + } + if (ti instanceof InitPropertyTreeItem) { + int multinameIndex = ((InitPropertyTreeItem) ti).propertyName.multinameIndex; + TreeItem value = ((InitPropertyTreeItem) ti).value; + for (Trait t : class_info[i].static_traits.traits) { + if (t.name_index == multinameIndex) { + if (t instanceof TraitSlotConst) { + ((TraitSlotConst) t).assignedValue = value; + } + } + } + } + } + /*String bodyStr = ""; + int bodyIndex = findBodyIndex(class_info[i].cinit_index); + if (bodyIndex != -1) { + bodyStr = addTabs(bodies[bodyIndex].toString(this, constants, method_info, hilight), 3); + } + if (!bodyStr.equals("")) { + String toPrint = IDENT_STRING + IDENT_STRING + "static {\r\n" + bodyStr + "\r\n" + IDENT_STRING + IDENT_STRING + "}"; + if (hilight) { + toPrint = Highlighting.hilighTrait(toPrint, class_info[i].static_traits.traits.length + instance_info[i].instance_traits.traits.length + 1); + } + out.println(toPrint); + }*/ + } + + //constructor + if (instance_info[i].iinit_index != 0) { + String modifier = ""; + Multiname m = constants.constant_multiname[instance_info[i].name_index]; + if (m != null) { + Namespace ns = m.getNamespace(constants); + if (ns != null) { + modifier = ns.getPrefix(constants) + " "; + if (modifier.equals(" ")) { + modifier = ""; + } + } + } + String constructorParams = method_info[instance_info[i].iinit_index].getParamStr(constants); + String bodyStr = ""; + int bodyIndex = findBodyIndex(instance_info[i].iinit_index); + if (bodyIndex != -1) { + bodyStr = addTabs(bodies[bodyIndex].toString(false, i, this, constants, method_info, highlight), 3); + } + String toPrint = IDENT_STRING + IDENT_STRING + modifier + "function " + constants.constant_multiname[instance_info[i].name_index].getName(constants) + "(" + constructorParams + ") {\r\n" + bodyStr + "\r\n" + IDENT_STRING + IDENT_STRING + "}"; + if (highlight) { + toPrint = Highlighting.hilighTrait(toPrint, class_info[i].static_traits.traits.length + instance_info[i].instance_traits.traits.length); + } + out.println(toPrint); + } + + //static variables,constants & methods + for (int ti = 0; ti < class_info[i].static_traits.traits.length; ti++) { + Trait t = class_info[i].static_traits.traits[ti]; + String toPrint = ""; + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; + String bodyStr = ""; + int bodyIndex = findBodyIndex(tm.method_info); + if (bodyIndex != -1) { + bodyStr = addTabs(bodies[bodyIndex].toString(true, i, this, constants, method_info, highlight), 3); + } + toPrint = IDENT_STRING + IDENT_STRING + tm.convert(constants, method_info, true) + " {\r\n" + bodyStr + "\r\n" + IDENT_STRING + IDENT_STRING + "}"; + } + if (t instanceof TraitSlotConst) { + TraitSlotConst ts = (TraitSlotConst) t; + + toPrint = IDENT_STRING + IDENT_STRING + ts.convert(constants, method_info, true) + ";"; + } + if (highlight) { + toPrint = Highlighting.hilighTrait(toPrint, ti); + } else { + toPrint = Highlighting.stripHilights(toPrint); + } + out.println(toPrint); + } + for (int ti = 0; ti < instance_info[i].instance_traits.traits.length; ti++) { + Trait t = instance_info[i].instance_traits.traits[ti]; + String toPrint = ""; + if (t instanceof TraitSlotConst) { + TraitSlotConst ts = (TraitSlotConst) t; + toPrint = IDENT_STRING + IDENT_STRING + ts.convert(constants, method_info, false) + ";"; + } + + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; + String bodyStr = ""; + int bodyIndex = findBodyIndex(tm.method_info); + if (bodyIndex != -1) { + bodyStr = addTabs(bodies[bodyIndex].toString(false, i, this, constants, method_info, highlight), 3); + } + toPrint = IDENT_STRING + IDENT_STRING + tm.convert(constants, method_info, false) + " {\r\n" + bodyStr + "\r\n" + IDENT_STRING + IDENT_STRING + "}"; + } + if (highlight) { + toPrint = Highlighting.hilighTrait(toPrint, class_info[i].static_traits.traits.length + ti); + } else { + toPrint = Highlighting.stripHilights(toPrint); + } + out.println(toPrint); + } + + + out.println(IDENT_STRING + "}");//class + out.println("}");//package + out.flush(); + + return baos.toString(); + } + + public void export(String directory) throws IOException { + for (int i = 0; i < instance_info.length; i++) { + String packageName = instance_info[i].getName(constants).getNamespace(constants).getName(constants); + String className = instance_info[i].getName(constants).getName(constants); + Main.startWork("Exporting " + (i + 1) + "/" + instance_info.length + " " + packageName + "." + className + "..."); + File outDir = new File(directory + File.separatorChar + packageName.replace('.', File.separatorChar)); + if (!outDir.exists()) { + outDir.mkdirs(); + } + String fileName = outDir.toString() + File.separator + className + ".as"; + FileOutputStream fos = new FileOutputStream(fileName); + fos.write(classToString(i, false).getBytes()); + fos.close(); + } + + } + + public void dump(OutputStream os) { + PrintStream output = new PrintStream(os); + constants.dump(output); + for (int i = 0; i < method_info.length; i++) { + output.println("MethodInfo[" + i + "]:" + method_info[i].toString(constants)); + } + for (int i = 0; i < metadata_info.length; i++) { + output.println("MetadataInfo[" + i + "]:" + metadata_info[i].toString(constants)); + } + for (int i = 0; i < instance_info.length; i++) { + output.println("InstanceInfo[" + i + "]:" + instance_info[i].toString(constants)); + } + for (int i = 0; i < class_info.length; i++) { + output.println("ClassInfo[" + i + "]:" + class_info[i].toString(constants)); + } + for (int i = 0; i < script_info.length; i++) { + output.println("ScriptInfo[" + i + "]:" + script_info[i].toString(constants)); + } + for (int i = 0; i < bodies.length; i++) { + output.println("MethodBody[" + i + "]:"); //+ bodies[i].toString(this, constants, method_info)); + } + } + + public static final String[] reservedWords = { + "as", "break", "case", "catch", "class", "const", "continue", /*"default",*/ "delete", "do", "each", "else", + "extends", "false", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", + "interface", "internal", "is", "native", "new", "null", "package", "private", "protected", "public", + "return", "super", "switch", "this", "throw", "true", "try", "typeof", "use", "var", /*"void",*/ "while", + "with"}; + public int unknownCount = 0; + + public void cleanOneName(int index) { + cleanNamespace(index); + } + + public void cleanNamespace(int index) { + if (index <= 0) { + return; + } + String s = constants.constant_string[index]; + boolean isValid = true; + boolean isReserved = false; + for (String rw : reservedWords) { + if (rw.equals(s.trim())) { + isValid = false; + isReserved = true; + break; + } + } + if (isValid) { + for (int i = 0; i < s.length(); i++) { + if (s.charAt(i) > 127) { + isValid = false; + break; + } + } + } + + if (!isValid) { + if (isReserved) { + constants.constant_string[index] = "name_" + s.replace(" ", "_"); + } else { + unknownCount++; + constants.constant_string[index] = "_name" + unknownCount; + } + } + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java b/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java new file mode 100644 index 000000000..7b763fdc9 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/ABCInputStream.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc; + +import com.jpexs.asdec.abc.types.*; +import com.jpexs.asdec.abc.types.traits.*; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; + + +public class ABCInputStream extends InputStream { + + private InputStream is; + private long bytesRead = 0; + private ByteArrayOutputStream bufferOs = null; + + public void startBuffer() { + bufferOs = new ByteArrayOutputStream(); + } + + public byte[] stopBuffer() { + if (bufferOs == null) return new byte[0]; + byte ret[] = bufferOs.toByteArray(); + bufferOs = null; + return ret; + } + + public ABCInputStream(InputStream is) { + this.is = is; + } + + @Override + public int read() throws IOException { + bytesRead++; + int i = is.read(); + if (bufferOs != null) { + if (i != -1) + bufferOs.write(i); + } + return i; + } + + public int readU8() throws IOException { + return read(); + } + + public int readU32() throws IOException { + int i = 0; + int ret = 0; + int bytePos = 0; + int byteCount = 0; + boolean nextByte = false; + do { + i = read(); + nextByte = (i >> 7) == 1; + i = i & 0x7f; + ret = ret + (i << bytePos); + byteCount++; + bytePos += 7; + } while (nextByte); + return ret; + } + + public int readU30() throws IOException { + return readU32(); + } + + public int readS24() throws IOException { + int ret = (read()) + (read() << 8) + (read() << 16); + + if ((ret >> 23) == 1) { + ret = ret | 0xff000000; + } + + return ret; + } + + public int readU16() throws IOException { + return (read()) + (read() << 8); + } + + public long readS32() throws IOException { + int i = 0; + long ret = 0; + int bytePos = 0; + int byteCount = 0; + boolean nextByte = false; + do { + i = read(); + nextByte = (i >> 7) == 1; + i = i & 0x7f; + ret = ret + (i << bytePos); + byteCount++; + bytePos += 7; + if (bytePos == 35) { + if ((ret >> 31) == 1) + ret = -(ret & 0x7fffffff); + break; + } + } while (nextByte); + return ret; + } + + @Override + public int available() throws IOException { + return is.available(); + } + + + public final long readLong() throws IOException { + byte readBuffer[] = safeRead(8); + return (((long) readBuffer[7] << 56) + + ((long) (readBuffer[6] & 255) << 48) + + ((long) (readBuffer[5] & 255) << 40) + + ((long) (readBuffer[4] & 255) << 32) + + ((long) (readBuffer[3] & 255) << 24) + + ((readBuffer[2] & 255) << 16) + + ((readBuffer[1] & 255) << 8) + + ((readBuffer[0] & 255) << 0)); + } + + public double readDouble() throws IOException { + long el = readLong(); + double ret = Double.longBitsToDouble(el); + return ret; + } + + + private byte[] safeRead(int count) throws IOException { + byte ret[] = new byte[count]; + for (int i = 0; i < count; i++) { + ret[i] = (byte) read(); + } + return ret; + } + + public Namespace readNamespace() throws IOException { + int kind = read(); + int name_index = 0; + for (int k = 0; k < Namespace.nameSpaceKinds.length; k++) { + if (Namespace.nameSpaceKinds[k] == kind) { + name_index = readU30(); + break; + } + } + return new Namespace(kind, name_index); + } + + public Multiname readMultiname() throws IOException { + int kind = read(); + int namespace_index = -1; + int name_index = -1; + int namespace_set_index = -1; + + if ((kind == 7) || (kind == 0xd)) { // CONSTANT_QName and CONSTANT_QNameA. + namespace_index = readU30(); + name_index = readU30(); + } + if ((kind == 9) || (kind == 0xe)) { // CONSTANT_Multiname and CONSTANT_MultinameA. + name_index = readU30(); + namespace_set_index = readU30(); + } + if ((kind == 0xf) || (kind == 0x10)) { //CONSTANT_RTQName and CONSTANT_RTQNameA + name_index = readU30(); + } + if ((kind == 0x1B) || (kind == 0x1C)) { //CONSTANT_MultinameL and CONSTANT_MultinameLA + namespace_set_index = readU30(); + } + //kind==0x11,0x12 nothing CONSTANT_RTQNameL and CONSTANT_RTQNameLA. + return new Multiname(kind, name_index, namespace_index, namespace_set_index); + } + + public MethodInfo readMethodInfo() throws IOException { + int param_count = readU30(); + int ret_type = readU30(); + int param_types[] = new int[param_count]; + for (int i = 0; i < param_count; i++) { + param_types[i] = readU30(); + } + int name_index = readU30(); + int flags = read(); + + //// 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional (16=ignore_rest, 32=explicit,) 64=setsdxns, 128=has_paramnames + + ValueKind optional[] = new ValueKind[0]; + if ((flags & 8) == 8) { //if has_optional + int optional_count = readU30(); + optional = new ValueKind[optional_count]; + for (int i = 0; i < optional_count; i++) { + optional[i] = new ValueKind(readU30(), read()); + } + } + + int param_names[] = new int[param_count]; + if ((flags & 128) == 128) { //if has_paramnames + for (int i = 0; i < param_count; i++) { + param_names[i] = readU30(); + } + } + return new MethodInfo(param_types, ret_type, name_index, flags, optional, param_names); + } + + public Trait readTrait() throws IOException { + long pos = getPosition(); + startBuffer(); + int name_index = readU30(); + int kind = read(); + int kindType = 0xf & kind; + int kindFlags = kind >> 4; + Trait trait = new Trait(); + + switch (kindType) { + case 0: //slot + case 6: //const + TraitSlotConst t1 = new TraitSlotConst(); + t1.slot_id = readU30(); + t1.type_index = readU30(); + t1.value_index = readU30(); + if (t1.value_index != 0) + t1.value_kind = read(); + trait = t1; + break; + case 1: //method + case 2: //getter + case 3: //setter + TraitMethodGetterSetter t2 = new TraitMethodGetterSetter(); + t2.disp_id = readU30(); + t2.method_info = readU30(); + trait = t2; + break; + case 4: //class + TraitClass t3 = new TraitClass(); + t3.slot_id = readU30(); + t3.class_info = readU30(); + trait = t3; + break; + case 5: //function + TraitFunction t4 = new TraitFunction(); + t4.slot_index = readU30(); + t4.method_info = readU30(); + trait = t4; + break; + } + trait.fileOffset = pos; + trait.kindType = kindType; + trait.kindFlags = kindFlags; + trait.name_index = name_index; + if ((kindFlags & 4) == 4) { + int metadata_count = readU30(); + trait.metadata = new int[metadata_count]; + for (int i = 0; i < metadata_count; i++) { + trait.metadata[i] = readU30(); + } + } + trait.bytes = stopBuffer(); + return trait; + } + + public Traits readTraits() throws IOException { + int count = readU30(); + Traits traits = new Traits(); + traits.traits = new Trait[count]; + for (int i = 0; i < count; i++) { + traits.traits[i] = readTrait(); + } + return traits; + } + + public InstanceInfo readInstanceInfo() throws IOException { + InstanceInfo ret = new InstanceInfo(); + ret.name_index = readU30(); + ret.super_index = readU30(); + ret.flags = read(); + if ((ret.flags & 8) == 8) { + ret.protectedNS = readU30(); + } + int interfaces_count = readU30(); + ret.interfaces = new int[interfaces_count]; + for (int i = 0; i < interfaces_count; i++) { + ret.interfaces[i] = readU30(); + } + ret.iinit_index = readU30(); + ret.instance_traits = readTraits(); + return ret; + } + + public String readString() throws IOException { + int length = readU30(); + return new String(safeRead(length), "utf8"); + } + + + /*public void markStart(){ + bytesRead=0; + }*/ + + public long getPosition() { + return bytesRead; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java b/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java new file mode 100644 index 000000000..68b10a350 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/ABCOutputStream.java @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc; + +import com.jpexs.asdec.abc.types.InstanceInfo; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.Namespace; +import com.jpexs.asdec.abc.types.traits.*; + +import java.io.IOException; +import java.io.OutputStream; + +public class ABCOutputStream extends OutputStream { + + private OutputStream os; + + public ABCOutputStream(OutputStream os) { + this.os = os; + } + + @Override + public void write(int b) throws IOException { + os.write(b); + } + + public void writeU30(long value) throws IOException { + writeS32(value); + /*boolean loop = true; + boolean underZero=value<0; + + if(underZero){ + value = value & 0xFFFFFFFF; + }else{ + value = value & 0x7FFFFFFF; + } + do { + int ret = (int) (value & 0x7F); + if (value < 0x80) { + loop = false; + } + if (value > 0x7F) { + ret += 0x80; + } + write(ret); + value = value >> 7; + } while (loop); +*/ + } + + public void writeU32(long value) throws IOException { + boolean loop = true; + value = value & 0xFFFFFFFF; + do { + int ret = (int) (value & 0x7F); + if (value < 0x80) { + loop = false; + } + if (value > 0x7F) { + ret += 0x80; + } + write(ret); + value = value >> 7; + } while (loop); + } + + public void writeS24(long value) throws IOException { + int ret = (int) (value & 0xff); + write(ret); + value = value >> 8; + ret = (int) (value & 0xff); + write(ret); + value = value >> 8; + ret = (int) (value & 0xff); + write(ret); + value = value >> 8; + } + + public void writeS32(long value) throws IOException { + boolean belowZero = value < 0; + /*if (belowZero) { + value = -value; + }*/ + int bitcount = 0; + boolean loop = true; + //value = value & 0xFFFFFFFF; + do { + bitcount += 7; + int ret = (int) (value & 0x7F); + if (value < 0x80) { + if (belowZero) { //&& bitcount < 35 + ret += 0x80; + } else { + loop = false; + } + } else { + ret += 0x80; + } + + if (bitcount == 35) { + ret = ret & 0xf; + } + write(ret); + if (bitcount == 35) { + break; + } + value = value >> 7; + } while (loop); + } + + public void writeLong(long value) throws IOException { + byte writeBuffer[] = new byte[8]; + writeBuffer[7] = (byte) (value >>> 56); + writeBuffer[6] = (byte) (value >>> 48); + writeBuffer[5] = (byte) (value >>> 40); + writeBuffer[4] = (byte) (value >>> 32); + writeBuffer[3] = (byte) (value >>> 24); + writeBuffer[2] = (byte) (value >>> 16); + writeBuffer[1] = (byte) (value >>> 8); + writeBuffer[0] = (byte) (value >>> 0); + write(writeBuffer); + } + + public void writeDouble(double value) throws IOException { + writeLong(Double.doubleToLongBits(value)); + } + + public void writeU8(int value) throws IOException { + write(value); + } + + public void writeU16(int value) throws IOException { + write(value & 0xff); + write((value >> 8) & 0xff); + } + + public void writeString(String s) throws IOException { + byte sbytes[] = s.getBytes("utf8"); + writeU30(sbytes.length); + write(sbytes); + } + + public void writeNamespace(Namespace ns) throws IOException { + write(ns.kind); + for (int k = 0; k < Namespace.nameSpaceKinds.length; k++) { + if (Namespace.nameSpaceKinds[k] == ns.kind) { + writeU30(ns.name_index); + break; + } + } + } + + public void writeMultiname(Multiname m) throws IOException { + write(m.kind); + if ((m.kind == 7) || (m.kind == 0xd)) { // CONSTANT_QName and CONSTANT_QNameA. + writeU30(m.namespace_index); + writeU30(m.name_index); + } + if ((m.kind == 9) || (m.kind == 0xe)) { // CONSTANT_Multiname and CONSTANT_MultinameA. + writeU30(m.name_index); + writeU30(m.namespace_set_index); + } + if ((m.kind == 0xf) || (m.kind == 0x10)) { //CONSTANT_RTQName and CONSTANT_RTQNameA + writeU30(m.name_index); + } + if ((m.kind == 0x1B) || (m.kind == 0x1C)) { //CONSTANT_MultinameL and CONSTANT_MultinameLA + writeU30(m.namespace_set_index); + } + //kind==0x11,0x12 nothing CONSTANT_RTQNameL and CONSTANT_RTQNameLA. + } + + public void writeMethodInfo(MethodInfo mi) throws IOException { + writeU30(mi.param_types.length); + writeU30(mi.ret_type); + for (int i = 0; i < mi.param_types.length; i++) { + writeU30(mi.param_types[i]); + } + writeU30(mi.name_index); + write(mi.flags); + if ((mi.flags & 8) == 8) { + writeU30(mi.optional.length); + for (int i = 0; i < mi.optional.length; i++) { + writeU30(mi.optional[i].value_index); + write(mi.optional[i].value_kind); + } + } + + if ((mi.flags & 128) == 128) { //if has_paramnames + for (int i = 0; i < mi.paramNames.length; i++) { + writeU30(mi.paramNames[i]); + } + } + } + + public void writeTrait(Trait t) throws IOException { + writeU30(t.name_index); + write((t.kindFlags << 4) + t.kindType); + if (t instanceof TraitSlotConst) { + TraitSlotConst t1 = (TraitSlotConst) t; + writeU30(t1.slot_id); + writeU30(t1.type_index); + writeU30(t1.value_index); + if (t1.value_index != 0) { + write(t1.value_kind); + } + } + if (t instanceof TraitMethodGetterSetter) { + TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t; + writeU30(t2.disp_id); + writeU30(t2.method_info); + } + if (t instanceof TraitClass) { + TraitClass t3 = (TraitClass) t; + writeU30(t3.slot_id); + writeU30(t3.class_info); + } + if (t instanceof TraitFunction) { + TraitFunction t4 = (TraitFunction) t; + writeU30(t4.slot_index); + writeU30(t4.method_info); + } + if ((t.kindFlags & 4) == 4) { + writeU30(t.metadata.length); + for (int i = 0; i < t.metadata.length; i++) { + writeU30(t.metadata[i]); + } + } + } + + public void writeTraits(Traits t) throws IOException { + writeU30(t.traits.length); + for (int i = 0; i < t.traits.length; i++) { + writeTrait(t.traits[i]); + } + } + + public void writeInstanceInfo(InstanceInfo ii) throws IOException { + writeU30(ii.name_index); + writeU30(ii.super_index); + write(ii.flags); + if ((ii.flags & 8) == 8) { + writeU30(ii.protectedNS); + } + writeU30(ii.interfaces.length); + for (int i = 0; i < ii.interfaces.length; i++) { + writeU30(ii.interfaces[i]); + } + writeU30(ii.iinit_index); + writeTraits(ii.instance_traits); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/CopyOutputStream.java b/trunk/src/com/jpexs/asdec/abc/CopyOutputStream.java new file mode 100644 index 000000000..9e5d1416b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/CopyOutputStream.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class CopyOutputStream extends OutputStream { + private OutputStream os; + private InputStream is; + private long pos = 0; + private int TEMPSIZE = 5; + private int temp[] = new int[TEMPSIZE]; + private int tempPos = 0; + + public CopyOutputStream(OutputStream os, InputStream is) { + this.os = os; + this.is = is; + } + + @Override + public void write(int b) throws IOException { + temp[tempPos] = b; + tempPos = (tempPos + 1) % TEMPSIZE; + + pos++; + int r = is.read(); + if ((b & 0xff) != r) { + os.flush(); + + boolean output = false; + + if (output) { + System.out.print("Last written:"); + for (int i = 0; i < TEMPSIZE; i++) { + System.out.print("" + Integer.toHexString(temp[(tempPos + i) % TEMPSIZE]) + " "); + } + System.out.println(""); + System.out.println("More expected:"); + for (int i = 0; i < TEMPSIZE; i++) { + System.out.println("" + Integer.toHexString(is.read())); + } + + System.out.println(""); + System.out.println(Integer.toHexString(r) + " expected but " + Integer.toHexString(b) + " found"); + } + throw new NotSameException(pos); + } + os.write(b); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/NotSameException.java b/trunk/src/com/jpexs/asdec/abc/NotSameException.java new file mode 100644 index 000000000..568cd8791 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/NotSameException.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc; + + +public class NotSameException extends RuntimeException { + public NotSameException(long pos) { + super("Streams are not the same at pos:" + pos); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java new file mode 100644 index 000000000..dc1101aa7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -0,0 +1,1681 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.ABCInputStream; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.arithmetic.*; +import com.jpexs.asdec.abc.avm2.instructions.bitwise.*; +import com.jpexs.asdec.abc.avm2.instructions.comparsion.*; +import com.jpexs.asdec.abc.avm2.instructions.construction.*; +import com.jpexs.asdec.abc.avm2.instructions.debug.DebugFileIns; +import com.jpexs.asdec.abc.avm2.instructions.debug.DebugIns; +import com.jpexs.asdec.abc.avm2.instructions.debug.DebugLineIns; +import com.jpexs.asdec.abc.avm2.instructions.executing.*; +import com.jpexs.asdec.abc.avm2.instructions.jumps.*; +import com.jpexs.asdec.abc.avm2.instructions.localregs.*; +import com.jpexs.asdec.abc.avm2.instructions.other.*; +import com.jpexs.asdec.abc.avm2.instructions.stack.*; +import com.jpexs.asdec.abc.avm2.instructions.types.*; +import com.jpexs.asdec.abc.avm2.instructions.xml.*; +import com.jpexs.asdec.abc.avm2.treemodel.*; +import com.jpexs.asdec.abc.avm2.treemodel.clauses.*; +import com.jpexs.asdec.abc.avm2.treemodel.operations.AndTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.OrTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.PreDecrementTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.PreIncrementTreeItem; +import com.jpexs.asdec.abc.types.ABCException; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.helpers.Helper; +import com.jpexs.asdec.helpers.Highlighting; + +import java.io.*; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class AVM2Code { + + public List code = new LinkedList(); + public static final int OPT_U30 = 0x100; + public static final int OPT_U8 = 0x200; + public static final int OPT_S24 = 0x300; + public static final int OPT_CASE_OFFSETS = 0x400; + public static final int OPT_BYTE = 0x500; + public static final int DAT_MULTINAME_INDEX = OPT_U30 + 0x01; + public static final int DAT_ARG_COUNT = OPT_U30 + 0x02; + public static final int DAT_METHOD_INDEX = OPT_U30 + 0x03; + public static final int DAT_STRING_INDEX = OPT_U30 + 0x04; + public static final int DAT_DEBUG_TYPE = OPT_U8 + 0x05; + public static final int DAT_REGISTER_INDEX = OPT_U8 + 0x06; + public static final int DAT_LINENUM = OPT_U30 + 0x07; + public static final int DAT_LOCAL_REG_INDEX = OPT_U30 + 0x08; + public static final int DAT_SLOT_INDEX = OPT_U30 + 0x09; + public static final int DAT_SLOT_SCOPE_INDEX = OPT_U30 + 0x0A; + public static final int DAT_OFFSET = OPT_S24 + 0x0B; + public static final int DAT_EXCEPTION_INDEX = OPT_U30 + 0x0C; + public static final int DAT_CLASS_INDEX = OPT_U30 + 0x0D; + public static final int DAT_INT_INDEX = OPT_U30 + 0x0E; + public static final int DAT_UINT_INDEX = OPT_U30 + 0x0F; + public static final int DAT_DOUBLE_INDEX = OPT_U30 + 0x10; + public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x11; + public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{ + new AddIns(), + new AddIIns(), + new AsTypeIns(), + new AsTypeLateIns(), + new BitAndIns(), + new BitNotIns(), + new BitOrIns(), + new BitXorIns(), + new CallIns(), + new CallMethodIns(), + new CallPropertyIns(), + new CallPropLexIns(), + new CallPropVoidIns(), + new CallStaticIns(), + new CallSuperIns(), + new CallSuperVoidIns(), + new CheckFilterIns(), + new CoerceIns(), + new CoerceAIns(), + new CoerceSIns(), + new ConstructIns(), + new ConstructPropIns(), + new ConstructSuperIns(), + new ConvertBIns(), + new ConvertIIns(), + new ConvertDIns(), + new ConvertOIns(), + new ConvertUIns(), + new ConvertSIns(), + new DebugIns(), + new DebugFileIns(), + new DebugLineIns(), + new DecLocalIns(), + new DecLocalIIns(), + new DecrementIns(), + new DecrementIIns(), + new DeletePropertyIns(), + new DivideIns(), + new DupIns(), + new DXNSIns(), + new DXNSLateIns(), + new EqualsIns(), + new EscXAttrIns(), + new EscXElemIns(), + new FindPropertyIns(), + new FindPropertyStrictIns(), + new GetDescendantsIns(), + new GetGlobalScopeIns(), + new GetGlobalSlotIns(), + new GetLexIns(), + new GetLocalIns(), + new GetLocal0Ins(), + new GetLocal1Ins(), + new GetLocal2Ins(), + new GetLocal3Ins(), + new GetPropertyIns(), + new GetScopeObjectIns(), + new GetSlotIns(), + new GetSuperIns(), + new GreaterEqualsIns(), + new GreaterThanIns(), + new HasNextIns(), + new HasNext2Ins(), + new IfEqIns(), + new IfFalseIns(), + new IfGeIns(), + new IfGtIns(), + new IfLeIns(), + new IfLtIns(), + new IfNGeIns(), + new IfNGtIns(), + new IfNLeIns(), + new IfNLtIns(), + new IfNeIns(), + new IfStrictEqIns(), + new IfStrictNeIns(), + new IfTrueIns(), + new InIns(), + new IncLocalIns(), + new IncLocalIIns(), + new IncrementIns(), + new IncrementIIns(), + new InitPropertyIns(), + new InstanceOfIns(), + new IsTypeIns(), + new IsTypeLateIns(), + new JumpIns(), + new KillIns(), + new LabelIns(), + new LessEqualsIns(), + new LessThanIns(), + new LookupSwitchIns(), + new LShiftIns(), + new ModuloIns(), + new MultiplyIns(), + new MultiplyIIns(), + new NegateIns(), + new NegateIIns(), + new NewActivationIns(), + new NewArrayIns(), + new NewCatchIns(), + new NewClassIns(), + new NewFunctionIns(), + new NewObjectIns(), + new NextNameIns(), + new NextValueIns(), + new NopIns(), + new NotIns(), + new PopIns(), + new PopScopeIns(), + new PushByteIns(), + new PushDoubleIns(), + new PushFalseIns(), + new PushIntIns(), + new PushNamespaceIns(), + new PushNanIns(), + new PushNullIns(), + new PushScopeIns(), + new PushShortIns(), + new PushStringIns(), + new PushTrueIns(), + new PushUIntIns(), + new PushUndefinedIns(), + new PushWithIns(), + new ReturnValueIns(), + new ReturnVoidIns(), + new RShiftIns(), + new SetLocalIns(), + new SetLocal0Ins(), + new SetLocal1Ins(), + new SetLocal2Ins(), + new SetLocal3Ins(), + new SetGlobalSlotIns(), + new SetPropertyIns(), + new SetSlotIns(), + new SetSuperIns(), + new StrictEqualsIns(), + new SubtractIns(), + new SubtractIIns(), + new SwapIns(), + new ThrowIns(), + new TypeOfIns(), + new URShiftIns()}; + //endoflist + public static final String IDENTOPEN = "/*IDENTOPEN*/"; + public static final String IDENTCLOSE = "/*IDENTCLOSE*/"; + + private class ConvertOutput { + + public Stack stack; + public List output; + + public ConvertOutput(Stack stack, List output) { + this.stack = stack; + this.output = output; + } + } + + public AVM2Code() { + } + + public AVM2Code(InputStream is) throws IOException { + ABCInputStream ais = new ABCInputStream(is); + while (ais.available() > 0) { + long startOffset = ais.getPosition(); + ais.startBuffer(); + int instructionCode = ais.read(); + boolean known = false; + loopi: + for (int i = 0; i < instructionSet.length; i++) { + if (instructionSet[i].instructionCode == instructionCode) { + known = true; + int actualOperands[]; + if (instructionCode == 0x1b) { //switch + int firstOperand = ais.readS24(); + int case_count = ais.readU30(); + actualOperands = new int[case_count + 3]; + actualOperands[0] = firstOperand; + actualOperands[1] = case_count; + for (int c = 0; c < case_count + 1; c++) { + actualOperands[2 + c] = ais.readS24(); + } + } else { + actualOperands = new int[instructionSet[i].operands.length]; + for (int op = 0; op < instructionSet[i].operands.length; op++) { + switch (instructionSet[i].operands[op] & 0xff00) { + case OPT_U30: + actualOperands[op] = ais.readU30(); + break; + case OPT_U8: + actualOperands[op] = ais.read(); + break; + case OPT_BYTE: + actualOperands[op] = (byte) ais.read(); + break; + case OPT_S24: + actualOperands[op] = ais.readS24(); + break; + } + } + } + + code.add(new AVM2Instruction(startOffset, instructionSet[i], actualOperands, ais.stopBuffer())); + break loopi; + } + } + if (!known) { + throw new UnknownInstructionCode(instructionCode); + } + } + } + + public byte[] getBytes() { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + for (AVM2Instruction instruction : code) { + bos.write(instruction.getBytes()); + } + } catch (IOException ex) { + } + return bos.toByteArray(); + } + + @Override + public String toString() { + String s = ""; + for (AVM2Instruction instruction : code) { + s += instruction.toString() + "\r\n"; + } + return s; + } + + public String toString(ConstantPool constants) { + String s = ""; + int i = 0; + for (AVM2Instruction instruction : code) { + s += Helper.formatAddress(i) + " " + instruction.toString(constants) + "\r\n"; + i++; + } + return s; + } + + private static String popStack(Stack stack) { + for (int i = stack.size() - 1; i >= 0; i--) { + String s = stack.get(i); + if (!s.startsWith("//")) { + stack.remove(i); + return s; + } + } + return null; + } + + public String toASMSource(ConstantPool constants) { + String ret = ""; + List offsets = new ArrayList(); + for (AVM2Instruction ins : code) { + offsets.addAll(ins.getOffsets()); + } + long ofs = 0; + for (AVM2Instruction ins : code) { + if (offsets.contains(ofs)) { + ret += "ofs" + Helper.formatAddress(ofs) + ":"; + } + ret += ins.toStringNoAddress(constants) + "\n"; + ofs += ins.getBytes().length; + } + + return ret; + } + + public int adr2pos(long address) throws ConvertException { + int a = 0; + for (int i = 0; i < code.size(); i++) { + if (a == address) { + return i; + } + a += code.get(i).getBytes().length; + } + if (a == address) { + return code.size(); + } + throw new ConvertException("Bad jump", -1); + } + + public int pos2adr(int pos) { + int a = 0; + for (int i = 0; i < pos; i++) { + a += code.get(i).getBytes().length; + } + + return a; + } + + private static String listToString(List stack, ConstantPool constants) { + String ret = ""; + for (int d = 0; d < stack.size(); d++) { + TreeItem o = stack.get(d); + ret += o.toString(constants) + "\r\n"; + } + return ret; + } + + private static String innerStackToString(List stack) { + String ret = ""; + for (int d = 0; d < stack.size(); d++) { + Object o = stack.get(d); + ret += o.toString(); + if (d < stack.size() - 1) { + if (!ret.endsWith("\r\n")) { + ret += "\r\n"; + } + } + } + return ret; + } + + private class Loop { + + public int loopContinue; + public int loopBreak; + public int continueCount = 0; + public int breakCount = 0; + + public Loop(int loopContinue, int loopBreak) { + this.loopContinue = loopContinue; + this.loopBreak = loopBreak; + } + } + + private List loopList; + private List unknownJumps; + private List finallyJumps; + private List parsedExceptions; + + private String stripBrackets(String s) { + if (s.startsWith("(") && (s.endsWith(")"))) { + s = s.substring(1, s.length() - 1); + } + return s; + } + + private int checkCatches(ABC abc, ConstantPool constants, MethodInfo method_info[], Stack stack, Stack scopeStack, List output, MethodBody body, int ip) throws ConvertException { + /*int newip = ip; + loope: + for (int e = 0; e < body.exceptions.length; e++) { + if (pos2adr(ip) == body.exceptions[e].end) { + for (int f = 0; f < e; f++) { + if (body.exceptions[e].startServer == body.exceptions[f].startServer) { + if (body.exceptions[e].end == body.exceptions[f].end) { + continue loope; + } + } + } + output.add("}"); + if (!(code.get(ip).definition instanceof JumpIns)) { + throw new ConvertException("No jump to skip catches"); + } + int addrAfterCatches = pos2adr(ip + 1) + code.get(ip).operands[0]; + int posAfterCatches = adr2pos(addrAfterCatches); + for (int g = 0; g < body.exceptions.length; g++) { + if (body.exceptions[e].startServer == body.exceptions[g].startServer) { + if (body.exceptions[e].end == body.exceptions[g].end) { + if (body.exceptions[g].isFinally()) { + output.add("finally"); + } else { + output.add("catch(" + body.exceptions[g].getVarName(constants) + ":" + body.exceptions[g].getTypeName(constants) + ")"); + } + output.add("{"); + + if (body.exceptions[g].isFinally()) { + int jumppos = adr2pos(body.exceptions[g].target) - 1; + AVM2Instruction jumpIns = code.get(jumppos); + if (!(jumpIns.definition instanceof JumpIns)) { + throw new ConvertException("No jump in finally block"); + } + int nextAddr = pos2adr(jumppos + 1) + jumpIns.operands[0]; + int nextins = adr2pos(nextAddr); + int pos = nextins; + Integer uj = new Integer(nextins); + if (unknownJumps.contains(uj)) { + unknownJumps.remove(uj); + } + int endpos = 0; + do { + if (code.get(pos).definition instanceof LookupSwitchIns) { + if (code.get(pos).operands[0] == 0) { + if (adr2pos(pos2adr(pos) + code.get(pos).operands[2]) < pos) { + endpos = pos - 1; + newip = endpos + 1; + break; + } + } + } + pos++; + } while (pos < code.size()); + output.addAll(toSource(stack, scopeStack, abc, constants, method_info, body, nextins, endpos).output); + } else { + + int pos = adr2pos(body.exceptions[g].target); + int endpos = posAfterCatches - 1; + for (int p = pos; p < posAfterCatches; p++) { + if (code.get(p).definition instanceof JumpIns) { + int nextAddr = pos2adr(p + 1) + code.get(p).operands[0]; + int nextPos = adr2pos(nextAddr); + if (nextPos == posAfterCatches) { + endpos = p - 1; + break; + } + } + } + Stack cstack = new Stack(); + cstack.push("catched " + body.exceptions[g].getVarName(constants)); + List outcatch = toSource(cstack, new Stack(), abc, constants, method_info, body, pos, endpos).output; + output.addAll(outcatch); + newip = endpos + 1; + } + output.add("}"); + } + } + } + } + } + return newip;*/ + return ip; + } + + boolean isCatched = false; + + private boolean isKilled(int regName, int start, int end) { + for (int k = start; k <= end; k++) { + if (code.get(k).definition instanceof KillIns) { + if (code.get(k).operands[0] == regName) { + return true; + } + } + } + return false; + } + + private int toSourceCount = 0; + + private ConvertOutput toSource(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, int start, int end) throws ConvertException { + boolean debugMode = false; + if (debugMode) + System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); + //if(true) return ""; + toSourceCount++; + if (toSourceCount > 255) { + throw new ConvertException("StackOverflow", start); + } + List output = new ArrayList(); + String ret = ""; + int ip = start; + try { + int addr; + iploop: + while (ip <= end) { + + addr = pos2adr(ip); + int maxend = -1; + List catchedExceptions = new ArrayList(); + for (int e = 0; e < body.exceptions.length; e++) { + if (addr == body.exceptions[e].start) { + if (!body.exceptions[e].isFinally()) { + if ((body.exceptions[e].end > maxend) && (!parsedExceptions.contains(body.exceptions[e]))) { + catchedExceptions.clear(); + maxend = body.exceptions[e].end; + catchedExceptions.add(body.exceptions[e]); + } else if (body.exceptions[e].end == maxend) { + catchedExceptions.add(body.exceptions[e]); + } + } + } + } + if (catchedExceptions.size() > 0) { + parsedExceptions.addAll(catchedExceptions); + int endpos = adr2pos(catchedExceptions.get(0).end); + + + List> catchedCommands = new ArrayList>(); + if (code.get(endpos).definition instanceof JumpIns) { + int afterCatchAddr = pos2adr(endpos + 1) + code.get(endpos).operands[0]; + int afterCatchPos = adr2pos(afterCatchAddr); + Collections.sort(catchedExceptions, new Comparator() { + + public int compare(ABCException o1, ABCException o2) { + return o1.target - o2.target; + } + }); + + + List finallyCommands = new ArrayList(); + int returnPos = afterCatchPos; + for (int e = 0; e < body.exceptions.length; e++) { + if (body.exceptions[e].isFinally()) { + if (addr == body.exceptions[e].start) { + if (afterCatchPos + 1 == adr2pos(body.exceptions[e].end)) { + AVM2Instruction jmpIns = code.get(adr2pos(body.exceptions[e].end)); + if (jmpIns.definition instanceof JumpIns) { + int finStart = adr2pos(body.exceptions[e].end + jmpIns.getBytes().length + jmpIns.operands[0]); + finallyJumps.add(finStart); + if (unknownJumps.contains(finStart)) { + unknownJumps.remove((Integer) finStart); + } + for (int f = finStart; f <= end; f++) { + if (code.get(f).definition instanceof LookupSwitchIns) { + AVM2Instruction swins = code.get(f); + if (swins.operands.length >= 3) { + if (swins.operands[0] == swins.getBytes().length) { + if (adr2pos(pos2adr(f) + swins.operands[2]) < finStart) { + finallyCommands = toSource(isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, finStart, f - 1).output; + returnPos = f + 1; + break; + } + } + } + } + } + + break; + } + } + } + } + } + + for (int e = 0; e < catchedExceptions.size(); e++) { + int eendpos = 0; + if (e < catchedExceptions.size() - 1) { + eendpos = adr2pos(catchedExceptions.get(e + 1).target) - 2; + } else { + eendpos = afterCatchPos - 1; + } + Stack substack = new Stack(); + substack.add(new ExceptionTreeItem(catchedExceptions.get(e))); + catchedCommands.add(toSource(isStatic, classIndex, localRegs, substack, new Stack(), abc, constants, method_info, body, adr2pos(catchedExceptions.get(e).target), eendpos).output); + } + + List tryCommands = toSource(isStatic, classIndex, localRegs, stack, scopeStack, abc, constants, method_info, body, ip, endpos - 1).output; + + + output.add(new TryTreeItem(tryCommands, catchedExceptions, catchedCommands, finallyCommands)); + ip = returnPos; + addr = pos2adr(ip); + } + + } + + if (ip > end) + break; + + if (unknownJumps.contains(ip)) { + unknownJumps.remove(new Integer(ip)); + throw new UnknownJumpException(stack, ip, output); + } + AVM2Instruction ins = code.get(ip); + //Ify s vice podminkama + if (ins.definition instanceof JumpIns) { + if (ins.operands[0] == 0) { + ip++; + addr = pos2adr(ip); + } else if (ins.operands[0] > 0) { + int secondAddr = addr + ins.getBytes().length; + int jumpAddr = secondAddr + ins.operands[0]; + int jumpPos = adr2pos(jumpAddr);// + + if (finallyJumps.contains(jumpPos)) { + if (code.get(ip + 1).definition instanceof LabelIns) { + if (code.get(ip + 2).definition instanceof PopIns) { + if (code.get(ip + 3).definition instanceof LabelIns) { + if (code.get(ip + 4).definition instanceof GetLocalTypeIns) { + if (code.get(ip - 1).definition instanceof PushByteIns) { + if (code.get(ip - 2).definition instanceof SetLocalTypeIns) { + if (((SetLocalTypeIns) code.get(ip - 2).definition).getRegisterId(code.get(ip - 2)) == ((GetLocalTypeIns) code.get(ip + 4).definition).getRegisterId(code.get(ip + 4))) { + SetLocalTreeItem ti = (SetLocalTreeItem) output.remove(output.size() - 1); + stack.add(ti.value); + ip = ip + 5; + continue; + } + } + } + } + } + } + } + //continue; + ip++; + continue; + } + for (Loop l : loopList) { + if (l.loopBreak == jumpPos) { + output.add(new BreakTreeItem(ins, l.loopBreak)); + addr = secondAddr; + ip = ip + 1; + continue iploop; + } + if (l.loopContinue == jumpPos) { + l.continueCount++; + output.add(new ContinueTreeItem(ins, l.loopBreak)); + addr = secondAddr; + ip = ip + 1; + continue iploop; + } + } + + + boolean backJumpFound = false; + int afterBackJumpAddr = 0; + AVM2Instruction backJumpIns = null; + boolean isSwitch = false; + int switchPos = 0; + loopj: + for (int j = jumpPos; j <= end; j++) { + if (code.get(j).definition instanceof IfTypeIns) { + afterBackJumpAddr = pos2adr(j + 1); + + if (afterBackJumpAddr + code.get(j).operands[0] == secondAddr) { + backJumpFound = true; + backJumpIns = code.get(j); + break; + } + } + if (code.get(j).definition instanceof LookupSwitchIns) { + for (int h = 2; h < code.get(j).operands.length; h++) { + int ofs = code.get(j).operands[h] + pos2adr(j); + if (ofs == secondAddr) { + isSwitch = true; + switchPos = j; + break loopj; + } + } + } + } + if (isSwitch) { + AVM2Instruction killIns = code.get(switchPos - 1); + if (!(killIns.definition instanceof KillIns)) { + throw new ConvertException("Unknown pattern: no kill before lookupswitch", switchPos - 1); + } + int userReg = killIns.operands[0]; + int evalTo = -1; + for (int g = jumpPos; g < switchPos; g++) { + if ((code.get(g).definition instanceof SetLocal0Ins) && (userReg == 0)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof SetLocal1Ins) && (userReg == 1)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof SetLocal2Ins) && (userReg == 2)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof SetLocal3Ins) && (userReg == 3)) { + evalTo = g; + break; + } + if ((code.get(g).definition instanceof SetLocalIns) && (userReg == code.get(g).operands[0])) { + evalTo = g; + break; + } + } + if (evalTo == -1) { + throw new ConvertException("Unknown pattern: no setlocal before lookupswitch", switchPos); + } + loopList.add(new Loop(ip, switchPos + 1)); + Stack substack = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, evalTo - 1).stack; + TreeItem switchedValue = substack.pop(); + //output.add("loop" + (switchPos + 1) + ":"); + int switchBreak = switchPos + 1; + List casesList = new ArrayList(); + List> caseCommands = new ArrayList>(); + List defaultCommands = new ArrayList(); + //output.add("switch(" + switchedValue + ")"); + //output.add("{"); + int curPos = evalTo + 1; + int casePos = 0; + do { + evalTo = -1; + for (int g = curPos; g < switchPos; g++) { + if ((code.get(g).definition instanceof GetLocal0Ins) && (userReg == 0)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof GetLocal1Ins) && (userReg == 1)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof GetLocal2Ins) && (userReg == 2)) { + evalTo = g; + break; + } else if ((code.get(g).definition instanceof GetLocal3Ins) && (userReg == 3)) { + evalTo = g; + break; + } + if ((code.get(g).definition instanceof GetLocalIns) && (userReg == code.get(g).operands[0])) { + evalTo = g; + break; + } + } + + + if (evalTo > -1) { + substack = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, curPos, evalTo - 1).stack; + casesList.add(substack.pop()); + } + int substart = adr2pos(code.get(switchPos).operands[2 + casePos] + pos2adr(switchPos)); + int subend = jumpPos - 1; + if (casePos + 1 < code.get(switchPos).operands.length - 2) { + subend = adr2pos(code.get(switchPos).operands[2 + casePos + 1] + pos2adr(switchPos)) - 1; + } + + if (evalTo == -1) + subend--; + List commands = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, substart, subend).output; + if ((evalTo == -1) && (casePos < code.get(switchPos).operands.length - 2)) { + if (commands.size() == 1) { + commands.remove(0); + } + if (commands.size() > 0) { + //hasDefault=true; + } + } + List caseCommandPart = new ArrayList(); + if (evalTo == -1) { + defaultCommands.addAll(commands); + } else { + caseCommandPart.addAll(commands); + caseCommands.add(caseCommandPart); + } + curPos = evalTo + 4; + casePos++; + if (evalTo == -1) { + break; + } + } while (true); + output.add(new SwitchTreeItem(code.get(switchPos), switchBreak, switchedValue, casesList, caseCommands, defaultCommands)); + ip = switchPos + 1; + addr = pos2adr(ip); + continue; + } + + if (!backJumpFound) { + if (jumpPos <= end + 1) { //probably skipping catch + ip = jumpPos; + addr = pos2adr(ip); + continue; + } + output.add(new ContinueTreeItem(ins, jumpPos, false)); + addr = secondAddr; + ip = ip + 1; + if (!unknownJumps.contains(jumpPos)) { + unknownJumps.add(jumpPos); + } + continue; + //throw new ConvertException("Unknown pattern: forjump with no backjump"); + } + Loop currentLoop = new Loop(jumpPos, adr2pos(afterBackJumpAddr)); + loopList.add(currentLoop); + + + ConvertOutput co = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, jumpPos, adr2pos(afterBackJumpAddr) - 2); + Stack substack = co.stack; + backJumpIns.definition.translate(isStatic, classIndex, localRegs, substack, scopeStack, constants, backJumpIns, method_info, output, body, abc); + + TreeItem expression = substack.pop(); + List subins = new ArrayList(); + boolean isFor = false; + List finalExpression = new ArrayList(); + try { + subins = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, adr2pos(secondAddr) + 1/*label*/, jumpPos - 1).output; + } catch (UnknownJumpException uje) { + if ((uje.ip >= start) && (uje.ip <= end)) { + currentLoop.loopContinue = uje.ip; + subins = uje.output; + + List contList = new ArrayList(); + for (TreeItem ti : subins) { + if (ti instanceof ContinueTreeItem) { + contList.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + contList.addAll(((Block) ti).getContinues()); + } + } + for (int u = 0; u < contList.size(); u++) { + if (contList.get(u) instanceof ContinueTreeItem) { + if (((ContinueTreeItem) contList.get(u)).loopPos == uje.ip) { + if (!((ContinueTreeItem) contList.get(u)).isKnown) { + ((ContinueTreeItem) contList.get(u)).isKnown = true; + ((ContinueTreeItem) contList.get(u)).loopPos = currentLoop.loopBreak; + } + } + } + } + finalExpression = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, uje.ip, jumpPos - 1).output; + isFor = true; + } else { + throw new ConvertException("Unknown pattern: jump to nowhere", ip); + } + } + boolean isDoWhile = false; + + if (jumpPos == ip + 2) { + if (code.get(ip + 1).definition instanceof LabelIns) { + isDoWhile = true; + } + } + if (!isDoWhile) { + if (!isFor) { + for (Loop l : loopList) { + if (l.loopContinue == jumpPos) { + if (l.continueCount == 0) { + //isFor = true; + //finalExpression = subins.remove(subins.size() - 1).toString(); + } + break; + } + } + } + } + + String firstIns = ""; + if (isFor) { + if (output.size() > 0) { + //firstIns = output.remove(output.size() - 1).toString(); + } + } + + List loopBody = new ArrayList(); + loopBody.addAll(co.output); + loopBody.addAll(subins); + + if (isFor) { + output.add(new ForTreeItem(ins, currentLoop.loopBreak, currentLoop.loopContinue, new ArrayList(), expression, finalExpression, loopBody)); + } else if (isDoWhile) { + output.add(new DoWhileTreeItem(ins, currentLoop.loopBreak, currentLoop.loopContinue, loopBody, expression)); + } else { + if (expression instanceof EachTreeItem) { + output.add(new ForEachTreeItem(ins, currentLoop.loopBreak, currentLoop.loopContinue, (EachTreeItem) expression, loopBody)); + } else { + output.add(new WhileTreeItem(ins, currentLoop.loopBreak, currentLoop.loopContinue, expression, loopBody)); + } + } + addr = afterBackJumpAddr; + ip = adr2pos(addr); + } else { + throw new ConvertException("Unknown pattern: back jump ", ip); + } + } else if (ins.definition instanceof DupIns) { + int nextPos = 0; + do { + AVM2Instruction insAfter = code.get(ip + 1); + AVM2Instruction insBefore = ins; + if (ip - 1 >= start) { + insBefore = code.get(ip - 1); + } + boolean isAnd = false; + if (insAfter.definition instanceof IfFalseIns) { + //stack.add("(" + stack.pop() + ")&&"); + isAnd = true; + } else if (insAfter.definition instanceof IfTrueIns) { + //stack.add("(" + stack.pop() + ")||"); + isAnd = false; + } else if ((insAfter.definition instanceof IncrementIIns) || ((insAfter.definition instanceof IncrementIns))) { + if (((ip - 1 >= start) && (ip + 2 <= end)) && ((code.get(ip + 2).definition instanceof SetLocalTypeIns) && (code.get(ip - 1).definition instanceof GetLocalTypeIns))) { + stack.add(new PostIncrementTreeItem(insAfter, stack.pop())); + ip += 3; + addr = pos2adr(ip); + break; + } + if (((ip - 1 >= start) && (ip + 2 <= end)) + && (code.get(ip + 2).definition instanceof SetLocalTypeIns) + && (isKilled(((SetLocalTypeIns) code.get(ip + 2).definition).getRegisterId(code.get(ip + 2)), ip + 3, end))) { + int pos = -1; + for (int d = ip + 3; d <= end; d++) { + if (!((code.get(d).definition instanceof GetLocalTypeIns) + && (isKilled(((GetLocalTypeIns) code.get(d).definition).getRegisterId(code.get(d)), d + 1, end)))) { + pos = d; + break; + } + } + if (pos > -1) { + if (code.get(pos).definition instanceof SetTypeIns) { + stack.push(new PostIncrementTreeItem(insAfter, stack.pop())); + ip = pos + 1; + addr = pos2adr(ip); + break; + } + } + + } + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + } else if ((insAfter.definition instanceof DecrementIIns) || ((insAfter.definition instanceof DecrementIns))) { + if (((ip - 1 >= start) && (ip + 2 <= end)) && ((code.get(ip + 2).definition instanceof SetLocalTypeIns) && (code.get(ip - 1).definition instanceof GetLocalTypeIns))) { + stack.add(new PostDecrementTreeItem(insAfter, stack.pop())); + ip += 3; + addr = pos2adr(ip); + break; + } + if (((ip - 1 >= start) && (ip + 2 <= end)) + && (code.get(ip + 2).definition instanceof SetLocalTypeIns) + && (isKilled(((SetLocalTypeIns) code.get(ip + 2).definition).getRegisterId(code.get(ip + 2)), ip + 3, end))) { + int pos = -1; + for (int d = ip + 3; d <= end; d++) { + if (!((code.get(d).definition instanceof GetLocalTypeIns) + && (isKilled(((GetLocalTypeIns) code.get(d).definition).getRegisterId(code.get(d)), d + 1, end)))) { + pos = d; + break; + } + } + if (pos > -1) { + if (code.get(pos).definition instanceof SetTypeIns) { + stack.push(new PostDecrementTreeItem(insAfter, stack.pop())); + ip = pos + 1; + addr = pos2adr(ip); + break; + } + } + + } + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + } else if ((insBefore.definition instanceof IncrementIIns) || ((insBefore.definition instanceof IncrementIns))) { + if (((ip - 2 >= start) && (ip + 2 <= end)) && (code.get(ip + 1).definition instanceof ConvertIIns) && (code.get(ip + 2).definition instanceof SetLocalTypeIns) && (code.get(ip - 2).definition instanceof GetLocalTypeIns)) { + stack.pop(); + int regId = ((SetLocalTypeIns) code.get(ip + 2).definition).getRegisterId(code.get(ip + 2)); + stack.add(new PreIncrementTreeItem(insBefore, new LocalRegTreeItem(code.get(ip + 2), regId, localRegs.get(regId)))); + ip += 3; + addr = pos2adr(ip); + break; + } + if (((ip - 1 >= start) && (ip + 2 <= end)) + && (code.get(ip + 1).definition instanceof SetLocalTypeIns) + && (isKilled(((SetLocalTypeIns) code.get(ip + 1).definition).getRegisterId(code.get(ip + 1)), ip + 2, end))) { + int pos = -1; + for (int d = ip + 2; d <= end; d++) { + if (!((code.get(d).definition instanceof GetLocalTypeIns) + && (isKilled(((GetLocalTypeIns) code.get(d).definition).getRegisterId(code.get(d)), d + 1, end)))) { + pos = d; + break; + } + } + if (pos > -1) { + if (code.get(pos).definition instanceof SetTypeIns) { + TreeItem s = stack.pop(); + if (s instanceof IncrementTreeItem) { + stack.push(new PreIncrementTreeItem(insBefore, ((IncrementTreeItem) s).object)); + } + ip = pos + 1; + addr = pos2adr(ip); + break; + } + } + + } + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + } else if ((insBefore.definition instanceof DecrementIIns) || ((insBefore.definition instanceof DecrementIns))) { + if (((ip - 2 >= start) && (ip + 2 <= end)) && (code.get(ip + 1).definition instanceof ConvertIIns) && (code.get(ip + 2).definition instanceof SetLocalTypeIns) && (code.get(ip - 2).definition instanceof GetLocalTypeIns)) { + stack.pop(); + int regId = ((SetLocalTypeIns) code.get(ip + 2).definition).getRegisterId(code.get(ip + 2)); + stack.add(new PreDecrementTreeItem(insBefore, new LocalRegTreeItem(code.get(ip + 2), regId, localRegs.get(regId)))); + ip += 3; + addr = pos2adr(ip); + break; + } + if (((ip - 1 >= start) && (ip + 2 <= end)) + && (code.get(ip + 1).definition instanceof SetLocalTypeIns) + && (isKilled(((SetLocalTypeIns) code.get(ip + 1).definition).getRegisterId(code.get(ip + 1)), ip + 2, end))) { + int pos = -1; + for (int d = ip + 2; d <= end; d++) { + if (!((code.get(d).definition instanceof GetLocalTypeIns) + && (isKilled(((GetLocalTypeIns) code.get(d).definition).getRegisterId(code.get(d)), d + 1, end)))) { + pos = d; + break; + } + } + if (pos > -1) { + if (code.get(pos).definition instanceof SetTypeIns) { + TreeItem s = stack.pop(); + if (s instanceof DecrementTreeItem) { + stack.push(new PreDecrementTreeItem(insBefore, ((DecrementTreeItem) s).object)); + } + ip = pos + 1; + addr = pos2adr(ip); + break; + } + } + + } + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + } else if (insAfter.definition instanceof SetLocalTypeIns) { + /*if (isKilled(((SetLocalTypeIns) insAfter.definition).getRegisterId(insAfter), ip + 2, end)) { + ip += 2; + addr = pos2adr(ip); + break; + } else {*/ + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + //} + + } else { + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip++; + addr = pos2adr(ip); + break; + //throw new ConvertException("Unknown pattern after DUP:" + insComparsion.toString()); + } + addr = addr + ins.getBytes().length + insAfter.getBytes().length + insAfter.operands[0]; + nextPos = adr2pos(addr) - 1; + if (isAnd) { + stack.add(new AndTreeItem(insAfter, stack.pop(), toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos).stack.pop())); + } else { + stack.add(new OrTreeItem(insAfter, stack.pop(), toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 3, nextPos).stack.pop())); + } + ins = code.get(nextPos + 1); + ip = nextPos + 1; + } while (ins.definition instanceof DupIns); + } else if (ins.definition instanceof IfTypeIns) { + int targetAddr = pos2adr(ip) + ins.getBytes().length + ins.operands[0]; + int targetIns = adr2pos(targetAddr); + ((IfTypeIns) ins.definition).translateInverted(localRegs, stack, ins); + + TreeItem condition = stack.pop(); + + if (condition.isFalse()) { + //ins.definition = new JumpIns(); + //continue; + } + if (condition.isTrue()) { + //ip = targetIns; + //continue; + } + //stack.add("if"+stack.pop()); + //stack.add("{"); + boolean hasElse = false; + boolean hasReturn = false; + if (code.get(targetIns - 1).definition instanceof JumpIns) { + + if ((targetIns - 2 > ip) && ((code.get(targetIns - 2).definition instanceof ReturnValueIns) || (code.get(targetIns - 2).definition instanceof ReturnVoidIns) || (code.get(targetIns - 2).definition instanceof ThrowIns))) { + hasElse = false; + hasReturn = true; + } else { + int jumpAddr = targetAddr + code.get(targetIns - 1).operands[0]; + int jumpPos = adr2pos(jumpAddr); + hasElse = true; + + for (Loop l : loopList) { + if (l.loopBreak == jumpPos) { + hasElse = false; + break; + } + } + if (hasElse) { + if (adr2pos(jumpAddr) > end + 1) { + hasElse = false; + //throw new ConvertException("Unknown pattern: forward jump outside of the block"); + } + } + } + } + ConvertOutput onTrue = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, ip + 1, targetIns - 1 - ((hasElse || hasReturn) ? 1 : 0)); + addr = targetAddr; + ip = targetIns; + ConvertOutput onFalse = new ConvertOutput(new Stack(), new ArrayList()); + if (hasElse) { + int finalAddr = targetAddr + code.get(targetIns - 1).operands[0]; + int finalIns = adr2pos(finalAddr); + onFalse = toSource(isStatic, classIndex, localRegs, new Stack(), scopeStack, abc, constants, method_info, body, targetIns, finalIns - 1); + addr = finalAddr; + ip = finalIns; + } + if ((onTrue.stack.size() > 0) && (onFalse != null) && (onFalse.stack.size() > 0)) { + stack.add(new TernarOpTreeItem(ins, condition, onTrue.stack.pop(), onFalse.stack.pop())); + } else { + output.add(new IfTreeItem(ins, condition, onTrue.output, onFalse.output)); + } + + } else if ((ins.definition instanceof ReturnValueIns) || (ins.definition instanceof ReturnVoidIns) || (ins.definition instanceof ThrowIns)) { + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + ip = end + 1; + break; + } else { + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc); + + addr += ins.getBytes().length; + ip++; + } + + } + if (debugMode) + System.out.println("CLOSE SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); + + return new ConvertOutput(stack, output); + } catch (ConvertException cex) { + throw cex; + } catch (Exception ex) { + if (ex instanceof UnknownJumpException) { + throw (UnknownJumpException) ex; + } + throw new ConvertException(ex.toString(), ip); + } + } + + public String tabString(int len) { + String ret = ""; + for (int i = 0; i < len; i++) { + ret += ABC.IDENT_STRING; + } + return ret; + } + + public String toSource(boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body) { + return toSource(isStatic, classIndex, abc, constants, method_info, body, false); + } + + public List toTree(boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body) { + toSourceCount = 0; + loopList = new ArrayList(); + unknownJumps = new ArrayList(); + parsedExceptions = new ArrayList(); + finallyJumps = new ArrayList(); + HashMap localRegs = new HashMap(); + try { + return toSource(isStatic, classIndex, localRegs, new Stack(), new Stack(), abc, constants, method_info, body, 0, code.size() - 1).output; + } catch (ConvertException ex) { + return new ArrayList(); + } + } + + public String toSource(boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, boolean hilighted) { + toSourceCount = 0; + loopList = new ArrayList(); + unknownJumps = new ArrayList(); + finallyJumps = new ArrayList(); + parsedExceptions = new ArrayList(); + List list; + String s = ""; + try { + HashMap localRegs = new HashMap(); + list = toSource(isStatic, classIndex, localRegs, new Stack(), new Stack(), abc, constants, method_info, body, 0, code.size() - 1).output; + s = listToString(list, constants); + } catch (Exception ex) { + ex.printStackTrace(); + s = "Convert error - " + ex.toString(); + return s; + } + + String parts[] = s.split("\r\n"); + String sub = ""; + int level = 0; + for (int t = 0; t < body.traits.traits.length; t++) { + sub += body.traits.traits[t].convert(constants, method_info) + ";\r\n"; + } + try { + Stack loopStack = new Stack(); + for (int p = 0; p < parts.length; p++) { + String stripped = Highlighting.stripHilights(parts[p]); + if (stripped.endsWith(":") && (!stripped.startsWith("case ")) && (!stripped.equals("default:"))) { + loopStack.add(stripped.substring(0, stripped.length() - 1)); + } + if (stripped.startsWith("break ")) { + if (stripped.equals("break " + loopStack.peek() + ";")) { + parts[p] = parts[p].replace(" " + loopStack.peek(), ""); + } + } + if (stripped.startsWith("continue ")) { + if (loopStack.size() > 0) { + if (stripped.equals("continue " + loopStack.peek() + ";")) { + parts[p] = parts[p].replace(" " + loopStack.peek(), ""); + } + } + } + if (stripped.startsWith(":")) { + loopStack.pop(); + } + } + } catch (Exception ex) { + } + for (int p = 0; p < parts.length; p++) { + String strippedP = Highlighting.stripHilights(parts[p]); + if (strippedP.endsWith(":") && (!strippedP.startsWith("case ")) && (!strippedP.equals("default:"))) { + String loopname = strippedP.substring(0, strippedP.length() - 1); + boolean dorefer = false; + for (int q = p + 1; q < parts.length; q++) { + String strippedQ = Highlighting.stripHilights(parts[q]); + if (strippedQ.equals("break " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals("continue " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals(":" + loopname)) { + break; + } + } + if (!dorefer) { + continue; + } + } + if (strippedP.startsWith(":")) { + continue; + } + if (strippedP.equals(IDENTOPEN)) { + level++; + } else if (strippedP.equals(IDENTCLOSE)) { + level--; + } else if (strippedP.equals("{")) { + level++; + sub += tabString(level) + parts[p] + "\r\n"; + level++; + } else if (strippedP.equals("}")) { + level--; + sub += tabString(level) + parts[p] + "\r\n"; + level--; + } else { + sub += tabString(level) + parts[p] + "\r\n"; + } + } + if (!hilighted) { + sub = Highlighting.stripHilights(sub); + } + return sub; + } + + public static void main(String[] args) { + FileInputStream fis = null; + try { + fis = new FileInputStream("src/asdec/abc/avm2/AVM2Code.java"); + byte[] data = new byte[fis.available()]; + fis.read(data); + + String content = new String(data); + Pattern partPat = Pattern.compile("private static InstructionDefinition instructionSet(.*)endoflist", Pattern.MULTILINE | Pattern.DOTALL); + Matcher m = partPat.matcher(content); + if (m.find()) { + System.out.println("1 found"); + content = m.group(1); + System.out.println(content); + Pattern part2Pat = Pattern.compile("new InstructionDefinition(\\([^\\)]*\"([^\"]*)\"[^\\)]*\\))\\{(.*)\\},", Pattern.MULTILINE | Pattern.DOTALL); + m = part2Pat.matcher(content); + while (m.find()) { + System.out.println("2 found"); + String superCall = m.group(1); + String name = m.group(2); + String methods = m.group(3); + FileOutputStream fos = new FileOutputStream("src/asdec/abc/avm2/instructions/generated/" + name + "Ins.java"); + String out = "public class " + name + "Ins extends InstructionDefinition {\r\n public " + name + "Ins(){\r\nsuper" + superCall + ";\r\n}" + methods + "}"; + fos.write(out.getBytes()); + fos.close(); + } + } + } catch (IOException ex) { + } finally { + try { + fis.close(); + } catch (IOException ex) { + Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void removeInstruction(int pos, MethodBody body) { + if ((pos < 0) || (pos >= code.size())) { + throw new IndexOutOfBoundsException(); + } + int byteCount = code.get(pos).getBytes().length; + long remOffset = code.get(pos).offset; + for (int i = pos + 1; i < code.size(); i++) { + code.get(i).offset -= byteCount; + } + + for (ABCException ex : body.exceptions) { + if (ex.start > remOffset) { + ex.start -= byteCount; + } + if (ex.end > remOffset) { + ex.start -= byteCount; + } + if (ex.target > remOffset) { + ex.start -= byteCount; + } + } + + + for (int i = 0; i < pos; i++) { + if (code.get(i).definition instanceof LookupSwitchIns) { + long target = code.get(i).offset + code.get(i).operands[0]; + if (target > remOffset) { + code.get(i).operands[0] -= byteCount; + } + for (int k = 2; k < code.get(i).operands.length; k++) { + target = code.get(i).offset + code.get(i).operands[k]; + if (target > remOffset) { + code.get(i).operands[k] -= byteCount; + } + } + } else { + for (int j = 0; j < code.get(i).definition.operands.length; j++) { + if (code.get(i).definition.operands[j] == AVM2Code.DAT_OFFSET) { + long target = code.get(i).offset + code.get(i).getBytes().length + code.get(i).operands[j]; + if (target > remOffset) { + code.get(i).operands[j] -= byteCount; + } + } + } + } + } + for (int i = pos + 1; i < code.size(); i++) { + if (code.get(i).definition instanceof LookupSwitchIns) { + long target = code.get(i).offset + code.get(i).operands[0]; + if (target < remOffset) { + code.get(i).operands[0] += byteCount; + } + for (int k = 2; k < code.get(i).operands.length; k++) { + target = code.get(i).offset + code.get(i).operands[k]; + if (target < remOffset) { + code.get(i).operands[k] += byteCount; + } + } + } else { + for (int j = 0; j < code.get(i).definition.operands.length; j++) { + if (code.get(i).definition.operands[j] == AVM2Code.DAT_OFFSET) { + long target = code.get(i).offset + code.get(i).getBytes().length + code.get(i).operands[j]; + if (target < remOffset) { + code.get(i).operands[j] += byteCount; + } + } + } + } + } + + code.remove(pos); + + } + + public void insertInstruction(int pos, AVM2Instruction instruction) { + if (pos < 0) { + pos = 0; + } + if (pos > code.size()) { + pos = code.size(); + } + int byteCount = instruction.getBytes().length; + if (pos == code.size()) { + instruction.offset = code.get(pos - 1).offset + code.get(pos - 1).getBytes().length; + } else { + instruction.offset = code.get(pos).offset; + } + + for (int i = 0; i < pos; i++) { + for (int j = 0; j < code.get(i).definition.operands.length; j++) { + if (code.get(i).definition.operands[j] == AVM2Code.DAT_OFFSET) { + long target = code.get(i).offset + code.get(i).getBytes().length + code.get(i).operands[j]; + if (target >= instruction.offset) { + code.get(i).operands[j] += byteCount; + } + } + } + } + for (int i = pos; i < code.size(); i++) { + for (int j = 0; j < code.get(i).definition.operands.length; j++) { + if (code.get(i).definition.operands[j] == AVM2Code.DAT_OFFSET) { + long target = code.get(i).offset + code.get(i).getBytes().length + code.get(i).operands[j]; + if (target < instruction.offset) { + code.get(i).operands[j] -= byteCount; + } + } + } + } + + for (int i = pos + 1; i < code.size(); i++) { + code.get(i).offset += byteCount; + } + code.add(pos, instruction); + } + + private void removeFreeBlocks(ConstantPool constants, MethodBody body) throws ConvertException { + List offsets = new ArrayList(); + for (AVM2Instruction ins : code) { + offsets.addAll(ins.getOffsets()); + } + for (ABCException ex : body.exceptions) { + offsets.add((long) ex.start); + offsets.add((long) ex.end); + offsets.add((long) ex.target); + } + + int clearedCount = 0; + loopip: + for (int ip = 0; ip < code.size(); ip++) { + AVM2Instruction ins = code.get(ip); + if (ins.definition instanceof JumpIns) { + int secondAddr = pos2adr(ip + 1); + int jumpAddr = secondAddr + ins.operands[0]; + int jumpPos = adr2pos(jumpAddr); + if (jumpPos <= ip) { + continue; + } + if (jumpPos > code.size()) { + continue; + } + for (int k = ip + 1; k < jumpPos; k++) { + if (offsets.contains((long) pos2adr(k))) { + continue loopip; + } + } + for (int k = ip; k < jumpPos; k++) { + removeInstruction(ip, body); + clearedCount++; + } + offsets.clear(); + for (AVM2Instruction ins2 : code) { + offsets.addAll(ins2.getOffsets()); + } + for (ABCException ex : body.exceptions) { + offsets.add((long) ex.start); + offsets.add((long) ex.end); + offsets.add((long) ex.target); + } + ip--; + //ip=jumpPos; + } + } + if (clearedCount > 0) { + //System.out.println("Cleared " + clearedCount + " lines of code TO:"); + //System.out.println(toASMSource(constants)); + //System.exit(1); + } + } + + public void clearSecureSWF(ConstantPool constants, MethodBody body) throws ConvertException { + if (code.size() > 4) { + AVM2Instruction first = code.get(0); + AVM2Instruction second = code.get(1); + boolean firstValue = false; + boolean secondValue = false; + boolean isSecure = true; + if (first.definition instanceof PushFalseIns) { + firstValue = false; + } else if (first.definition instanceof PushTrueIns) { + firstValue = true; + } else { + isSecure = false; + } + if (isSecure) { + if (second.definition instanceof PushFalseIns) { + secondValue = false; + } else if (second.definition instanceof PushTrueIns) { + secondValue = true; + } else { + isSecure = false; + } + if (isSecure) { + AVM2Instruction third = code.get(2); + int pos = 2; + if (third.definition instanceof SwapIns) { + pos++; + boolean dup = firstValue; + firstValue = secondValue; + secondValue = dup; + } + AVM2Instruction firstSet = code.get(pos); + AVM2Instruction secondSet = code.get(pos + 1); + int trueIndex = -1; + int falseIndex = -1; + if (firstSet.definition instanceof SetLocalTypeIns) { + if (secondValue == true) { + trueIndex = ((SetLocalTypeIns) firstSet.definition).getRegisterId(firstSet); + } + if (secondValue == false) { + falseIndex = ((SetLocalTypeIns) firstSet.definition).getRegisterId(firstSet); + } + } else { + isSecure = false; + } + if (isSecure) { + if (secondSet.definition instanceof SetLocalTypeIns) { + if (firstValue == true) { + trueIndex = ((SetLocalTypeIns) secondSet.definition).getRegisterId(firstSet); + } + if (firstValue == false) { + falseIndex = ((SetLocalTypeIns) secondSet.definition).getRegisterId(firstSet); + } + + //Yes, secure + pos += 2; + for (int i = 0; i < pos; i++) { + code.get(i).ignored = true; + //removeInstruction(0, body); + } + System.out.println("trueIndex:" + trueIndex); + System.out.println("falseIndex:" + falseIndex); + boolean found = false; + do { + found = false; + for (int ip = pos; ip < code.size(); ip++) { + if (code.get(ip).ignored) continue; + if (code.get(ip).definition instanceof GetLocalTypeIns) { + int regIndex = ((GetLocalTypeIns) code.get(ip).definition).getRegisterId(code.get(ip)); + if ((regIndex == trueIndex) || (regIndex == falseIndex)) { + found = true; + Stack myStack = new Stack(); + do { + AVM2Instruction ins = code.get(ip); + if (ins.ignored) { + ip++; + continue; + } else if (ins.definition instanceof GetLocalTypeIns) { + regIndex = ((GetLocalTypeIns) ins.definition).getRegisterId(ins); + if (regIndex == trueIndex) myStack.push(true); + if (regIndex == falseIndex) myStack.push(false); + ip++; + ins.ignored = true; + } else if (ins.definition instanceof DupIns) { + Boolean b = myStack.pop(); + myStack.push(b); + myStack.push(b); + ins.ignored = true; + ip++; + } else if (ins.definition instanceof PopIns) { + myStack.pop(); + ins.ignored = true; + ip++; + } else if (ins.definition instanceof IfTrueIns) { + System.out.println("iftrue found"); + boolean val = myStack.pop(); + if (val) { + code.get(ip).definition = new JumpIns(); + System.out.println("changed to jump"); + ip = adr2pos(pos2adr(ip + 1) + code.get(ip).operands[0]); + } else { + code.get(ip).ignored = true; + ip++; + } + } else if (ins.definition instanceof IfFalseIns) { + boolean val = myStack.pop(); + if (!val) { + code.get(ip).definition = new JumpIns(); + ip = adr2pos(pos2adr(ip + 1) + code.get(ip).operands[0]); + } else { + code.get(ip).ignored = true; + ip++; + } + } else if (ins.definition instanceof JumpIns) { + ip = adr2pos(pos2adr(ip + 1) + code.get(ip).operands[0]); + } else { + + } + + } while (myStack.size() > 0); + + /*for(int rem=code.size();rem>=0;rem--){ + if(code.get(rem).ignored){ + code.remove(rem); + } + } */ + break; + } + + } + } + } + while (found); + } else { + isSecure = false; + } + } + + } + } + } + } + + public void clearCode(ConstantPool constants, MethodBody body) throws ConvertException { + + if (code.size() > 3) { + if (code.get(0).definition instanceof PushByteIns) { + if (code.get(1).definition instanceof PushByteIns) { + if (code.get(2).definition instanceof IfNeIns) { + if (code.get(0).operands[0] != code.get(1).operands[0]) { + int targetAddr = pos2adr(2) + code.get(2).getBytes().length + code.get(2).operands[0]; + int targetPos = adr2pos(targetAddr); + for (int i = 0; i < targetPos; i++) { + removeInstruction(0, body); + } + } + } + } + } + } + + removeFreeBlocks(constants, body); + //clearSecureSWF(constants, body); + + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/ConstantPool.java b/trunk/src/com/jpexs/asdec/abc/avm2/ConstantPool.java new file mode 100644 index 000000000..71f97fb2f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/ConstantPool.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.Namespace; +import com.jpexs.asdec.abc.types.NamespaceSet; + +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.Arrays; + + +public class ConstantPool { + public long constant_int[]; + public long constant_uint[]; + public double constant_double[]; + public String constant_string[]; + public Namespace constant_namespace[]; + public NamespaceSet constant_namespace_set[]; + public Multiname constant_multiname[]; + + public int addInt(long value) { + constant_int = Arrays.copyOf(constant_int, constant_int.length + 1); + constant_int[constant_int.length - 1] = value; + return constant_int.length - 1; + } + + public int addUInt(long value) { + constant_uint = Arrays.copyOf(constant_uint, constant_uint.length + 1); + constant_uint[constant_uint.length - 1] = value; + return constant_uint.length - 1; + } + + public int addDouble(double value) { + constant_double = Arrays.copyOf(constant_double, constant_double.length + 1); + constant_double[constant_double.length - 1] = value; + return constant_double.length - 1; + } + + public int addString(String value) { + constant_string = Arrays.copyOf(constant_string, constant_string.length + 1); + constant_string[constant_string.length - 1] = value; + return constant_string.length - 1; + } + + public int getIntId(long value) { + for (int i = 1; i < constant_int.length; i++) { + if (constant_int[i] == value) { + return i; + } + } + return 0; + } + + public int getUIntId(long value) { + for (int i = 1; i < constant_uint.length; i++) { + if (constant_uint[i] == value) { + return i; + } + } + return 0; + } + + public int getDoubleId(double value) { + for (int i = 1; i < constant_double.length; i++) { + if (constant_double[i] == value) { + return i; + } + } + return 0; + } + + public int getStringId(String s) { + for (int i = 1; i < constant_string.length; i++) { + if (constant_string[i].equals(s)) { + return i; + } + } + return 0; + } + + public int getMultiNameId(String s) { + for (int i = 1; i < constant_multiname.length; i++) { + if (constant_multiname[i].getName(this).equals(s)) { + return i; + } + } + return 0; + } + + public void dump(OutputStream os) { + PrintStream output = new PrintStream(os); + String s = ""; + for (int i = 1; i < constant_int.length; i++) { + output.println("INT[" + i + "]=" + constant_int[i]); + } + for (int i = 1; i < constant_uint.length; i++) { + output.println("UINT[" + i + "]=" + constant_uint[i]); + } + for (int i = 1; i < constant_double.length; i++) { + output.println("Double[" + i + "]=" + constant_double[i]); + } + for (int i = 1; i < constant_string.length; i++) { + output.println("String[" + i + "]=" + constant_string[i]); + } + for (int i = 1; i < constant_namespace.length; i++) { + output.println("Namespace[" + i + "]=" + constant_namespace[i].toString(this)); + } + for (int i = 1; i < constant_namespace_set.length; i++) { + output.println("NamespaceSet[" + i + "]=" + constant_namespace_set[i].toString(this)); + } + + for (int i = 1; i < constant_multiname.length; i++) { + output.println("Multiname[" + i + "]=" + constant_multiname[i].toString(this)); + } + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/ConvertException.java b/trunk/src/com/jpexs/asdec/abc/avm2/ConvertException.java new file mode 100644 index 000000000..dceb09739 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/ConvertException.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + + +public class ConvertException extends Exception { + public int line; + public ConvertException(String s,int line) { + super(s+" on line "+line); + this.line=line; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/InvalidInstructionArguments.java b/trunk/src/com/jpexs/asdec/abc/avm2/InvalidInstructionArguments.java new file mode 100644 index 000000000..eb484d2f5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/InvalidInstructionArguments.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + + +public class InvalidInstructionArguments extends RuntimeException { + + public InvalidInstructionArguments() { + super("Invalid method arguments"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/LocalDataArea.java b/trunk/src/com/jpexs/asdec/abc/avm2/LocalDataArea.java new file mode 100644 index 000000000..4d6d1c459 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/LocalDataArea.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class LocalDataArea { + public Stack operandStack = new Stack(); + public Stack scopeStack = new Stack(); + public List localRegisters = new ArrayList(); + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/UnknownInstructionCode.java b/trunk/src/com/jpexs/asdec/abc/avm2/UnknownInstructionCode.java new file mode 100644 index 000000000..1e996f77c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/UnknownInstructionCode.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + + +public class UnknownInstructionCode extends RuntimeException { + public int code; + + public UnknownInstructionCode(int code) { + super("Unknown instruction code:" + Integer.toHexString(code)); + this.code = code; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/UnknownJumpException.java b/trunk/src/com/jpexs/asdec/abc/avm2/UnknownJumpException.java new file mode 100644 index 000000000..23f655cd5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/UnknownJumpException.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2; + +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.List; +import java.util.Stack; + + +public class UnknownJumpException extends RuntimeException { + public Stack stack; + public int ip; + public List output; + + public UnknownJumpException(Stack stack, int ip, List output) { + this.stack = stack; + this.ip = ip; + this.output = output; + } + + @Override + public String toString() { + return "Unknown jump to " + ip; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java new file mode 100644 index 000000000..fc4ec9900 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/AVM2Instruction.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions; + +import com.jpexs.asdec.abc.ABCOutputStream; +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.helpers.Helper; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + + +public class AVM2Instruction { + + public InstructionDefinition definition; + public int operands[]; + public long offset; + public byte bytes[]; + public String comment; + public boolean ignored = false; + + public AVM2Instruction(long offset, InstructionDefinition definition, int[] operands, byte bytes[]) { + this.definition = definition; + this.operands = operands; + this.offset = offset; + this.bytes = bytes; + } + + public byte[] getBytes() { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + ABCOutputStream aos = new ABCOutputStream(bos); + aos.write(definition.instructionCode); + for (int i = 0; i < definition.operands.length; i++) { + int opt = definition.operands[i] & 0xff00; + switch (opt) { + case AVM2Code.OPT_S24: + aos.writeS24(operands[i]); + break; + case AVM2Code.OPT_U30: + aos.writeU30(operands[i]); + break; + case AVM2Code.OPT_U8: + aos.writeU8(operands[i]); + break; + case AVM2Code.OPT_BYTE: + aos.writeU8(0xff & operands[i]); + break; + case AVM2Code.OPT_CASE_OFFSETS: + + aos.writeU30(operands[i]); //case count + for (int j = i + 1; j < operands.length; j++) { + aos.writeS24(operands[j]); + } + break; + } + } + } catch (IOException ex) { + //ignored + } + return bos.toByteArray(); + } + + @Override + public String toString() { + String s = definition.instructionName; + for (int i = 0; i < operands.length; i++) { + s += " " + operands[i]; + } + return s; + } + + public List getOffsets() { + List ret = new ArrayList(); + String s = ""; + for (int i = 0; i < definition.operands.length; i++) { + switch (definition.operands[i]) { + case AVM2Code.DAT_OFFSET: + ret.add(offset + operands[i] + getBytes().length); + break; + case AVM2Code.DAT_CASE_BASEOFFSET: + ret.add(offset + operands[i]); + break; + case AVM2Code.OPT_CASE_OFFSETS: + for (int j = i + 1; j < operands.length; j++) { + ret.add(offset + operands[j]); + } + break; + } + + } + return ret; + } + + public String getParams(ConstantPool constants) { + String s = ""; + for (int i = 0; i < definition.operands.length; i++) { + switch (definition.operands[i]) { + case AVM2Code.DAT_MULTINAME_INDEX: + s += " m[" + operands[i] + "]\"" + Helper.escapeString(constants.constant_multiname[operands[i]].toString(constants)) + "\""; + break; + case AVM2Code.DAT_STRING_INDEX: + s += " \"" + Helper.escapeString(constants.constant_string[operands[i]]) + "\""; + break; + case AVM2Code.DAT_INT_INDEX: + s += " " + constants.constant_int[operands[i]] + ""; + break; + case AVM2Code.DAT_UINT_INDEX: + s += " " + constants.constant_uint[operands[i]] + ""; + break; + case AVM2Code.DAT_DOUBLE_INDEX: + s += " " + constants.constant_double[operands[i]] + ""; + break; + case AVM2Code.DAT_OFFSET: + s += " "; + if (operands[i] > 0) { + //s += "+"; + }//operands[i] + s += "ofs" + Helper.formatAddress(offset + operands[i] + getBytes().length) + ""; + break; + case AVM2Code.DAT_CASE_BASEOFFSET: + s += " "; + if (operands[i] > 0) { + //s += "+"; + }//operands[i] + s += "ofs" + Helper.formatAddress(offset + operands[i]) + ""; + break; + case AVM2Code.OPT_CASE_OFFSETS: + s += " " + operands[i]; + for (int j = i + 1; j < operands.length; j++) { + s += " "; + if (operands[j] > 0) { + //s += "+"; + }//operands[j] + s += "ofs" + Helper.formatAddress(offset + operands[j]) + ""; + } + break; + default: + s += " " + operands[i]; + } + + } + return s; + } + + public String getComment() { + if (ignored) { + return " ;ignored"; + } + if ((comment == null) || comment.equals("")) { + return ""; + } + return " ;" + comment; + } + + public String toString(ConstantPool constants) { + String s = Helper.formatAddress(offset) + " " + Helper.padSpaceRight(Helper.byteArrToString(getBytes()), 30) + definition.instructionName; + s += getParams(constants) + getComment(); + return s; + } + + public String toStringNoAddress(ConstantPool constants) { + String s = definition.instructionName; + s += getParams(constants) + getComment(); + return s; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/IfTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/IfTypeIns.java new file mode 100644 index 000000000..312bea296 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/IfTypeIns.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions; + +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.Stack; + + +public interface IfTypeIns { + public abstract void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins); +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java new file mode 100644 index 000000000..4d3e6c685 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/InstructionDefinition.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.helpers.Highlighting; + +import java.util.List; +import java.util.Stack; + + +public class InstructionDefinition { + + + protected String hilighOffset(String text, long offset) { + return Highlighting.hilighOffset(text, offset); + } + + public int operands[]; + public String instructionName = ""; + public int instructionCode = 0; + + public static String localRegName(int reg) { + if (reg == 0) return "this"; + return "_loc" + reg + "_"; + } + + public InstructionDefinition(int instructionCode, String instructionName, int operands[]) { + this.instructionCode = instructionCode; + this.instructionName = instructionName; + this.operands = operands; + } + + @Override + public String toString() { + String s = instructionName; + for (int i = 0; i < operands.length; i++) { + if ((operands[i] & 0xff00) == AVM2Code.OPT_U30) { + s += " U30"; + } + if ((operands[i] & 0xff00) == AVM2Code.OPT_U8) { + s += " U8"; + } + if ((operands[i] & 0xff00) == AVM2Code.OPT_BYTE) { + s += " BYTE"; + } + if ((operands[i] & 0xff00) == AVM2Code.OPT_S24) { + s += " S24"; + } + if ((operands[i] & 0xff00) == AVM2Code.OPT_CASE_OFFSETS) { + s += " U30 S24,[S24]..."; + } + } + return s; + } + + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + } + + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + + } + + protected FullMultinameTreeItem resolveMultiname(Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { + TreeItem ns = null; + TreeItem name = null; + if (constants.constant_multiname[multinameIndex].needsNs()) { + ns = (TreeItem) stack.pop(); + } + if (constants.constant_multiname[multinameIndex].needsName()) { + name = (TreeItem) stack.pop(); + } + return new FullMultinameTreeItem(ins, multinameIndex, name, ns); + } + + protected int resolvedCount(ConstantPool constants, int multinameIndex) { + int pos = 0; + if (constants.constant_multiname[multinameIndex].needsNs()) { + pos++; + } + if (constants.constant_multiname[multinameIndex].needsName()) { + pos++; + } + return pos; + + } + + protected String resolveMultinameNoPop(int pos, Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { + String ns = ""; + String name = ""; + if (constants.constant_multiname[multinameIndex].needsNs()) { + ns = "[" + stack.get(pos) + "]"; + pos++; + } + if (constants.constant_multiname[multinameIndex].needsName()) { + name = stack.get(pos).toString(); + } else { + name = hilighOffset(constants.constant_multiname[multinameIndex].getName(constants), ins.offset); + } + return name + ns; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/SetTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/SetTypeIns.java new file mode 100644 index 000000000..66fc856d0 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/SetTypeIns.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public interface SetTypeIns { + public abstract String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body); +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIIns.java new file mode 100644 index 000000000..59de2f6d5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.AddTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class AddIIns extends AddIns { + + public AddIIns() { + instructionName = "add_i"; + instructionCode = 0xc5; + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new AddTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIns.java new file mode 100644 index 000000000..bd64e51af --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/AddIns.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.AddTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class AddIns extends InstructionDefinition { + + public AddIns() { + super(0xa0, "add", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object o1 = lda.operandStack.pop(); + Object o2 = lda.operandStack.pop(); + if ((o1 instanceof Long) && ((o2 instanceof Long))) { + Long ret = new Long(((Long) o1).longValue() + ((Long) o2).longValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Double) && ((o2 instanceof Double))) { + Double ret = new Double(((Double) o1).doubleValue() + ((Double) o2).doubleValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Long) && ((o2 instanceof Double))) { + Double ret = new Double(((Long) o1).longValue() + ((Double) o2).doubleValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Double) && ((o2 instanceof Long))) { + Double ret = new Double(((Double) o1).doubleValue() + ((Long) o2).longValue()); + lda.operandStack.push(ret); + } else { + String s = o1.toString() + o2.toString(); + lda.operandStack.push(s); + } + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new AddTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIIns.java new file mode 100644 index 000000000..f19cf7753 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIIns.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.DecrementTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DecrementIIns extends InstructionDefinition { + + public DecrementIIns() { + super(0xc1, "decrement_i", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj = lda.operandStack.pop(); + if (obj instanceof Long) { + Long obj2 = ((Long) obj).longValue() - 1; + lda.operandStack.push(obj2); + } else if (obj instanceof Double) { + Double obj2 = ((Double) obj).doubleValue() - 1; + lda.operandStack.push(obj2); + } + if (obj instanceof String) { + Double obj2 = Double.parseDouble((String) obj) - 1; + lda.operandStack.push(obj2); + } else { + throw new RuntimeException("Cannot decrement local register"); + } + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIns.java new file mode 100644 index 000000000..c64b96b30 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DecrementIns.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.DecrementTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DecrementIns extends InstructionDefinition { + + public DecrementIns() { + super(0x93, "decrement", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj = lda.operandStack.pop(); + if (obj instanceof Long) { + Long obj2 = ((Long) obj).longValue() - 1; + lda.operandStack.push(obj2); + } else if (obj instanceof Double) { + Double obj2 = ((Double) obj).doubleValue() - 1; + lda.operandStack.push(obj2); + } + if (obj instanceof String) { + Double obj2 = Double.parseDouble((String) obj) - 1; + lda.operandStack.push(obj2); + } else { + throw new RuntimeException("Cannot decrement local register"); + } + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DivideIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DivideIns.java new file mode 100644 index 000000000..635a63633 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/DivideIns.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.DivideTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DivideIns extends InstructionDefinition { + + public DivideIns() { + super(0xa3, "divide", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object o1 = lda.operandStack.pop(); + Object o2 = lda.operandStack.pop(); + if ((o1 instanceof Long) && ((o2 instanceof Long))) { + Long ret = new Long(((Long) o1).longValue() / ((Long) o2).longValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Double) && ((o2 instanceof Double))) { + Double ret = new Double(((Double) o1).doubleValue() / ((Double) o2).doubleValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Long) && ((o2 instanceof Double))) { + Double ret = new Double(((Long) o1).longValue() / ((Double) o2).doubleValue()); + lda.operandStack.push(ret); + } else if ((o1 instanceof Double) && ((o2 instanceof Long))) { + Double ret = new Double(((Double) o1).doubleValue() / ((Long) o2).longValue()); + lda.operandStack.push(ret); + } else { + throw new RuntimeException("Cannot divide"); + } + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new DivideTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIIns.java new file mode 100644 index 000000000..5192f1cbe --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IncrementTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IncrementIIns extends InstructionDefinition { + + public IncrementIIns() { + super(0xc0, "increment_i", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIns.java new file mode 100644 index 000000000..aebc0b4e6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/IncrementIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IncrementTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IncrementIns extends InstructionDefinition { + + public IncrementIns() { + super(0x91, "increment", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/ModuloIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/ModuloIns.java new file mode 100644 index 000000000..f3253b9c8 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/ModuloIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.ModuloTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ModuloIns extends InstructionDefinition { + + public ModuloIns() { + super(0xa4, "modulo", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new ModuloTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIIns.java new file mode 100644 index 000000000..6ad5ac346 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.MultiplyTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class MultiplyIIns extends InstructionDefinition { + + public MultiplyIIns() { + super(0xc7, "multiply_i", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new MultiplyTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIns.java new file mode 100644 index 000000000..3037173d2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/MultiplyIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.MultiplyTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class MultiplyIns extends InstructionDefinition { + + public MultiplyIns() { + super(0xa2, "multiply", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new MultiplyTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIIns.java new file mode 100644 index 000000000..179acf43e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NegTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NegateIIns extends InstructionDefinition { + + public NegateIIns() { + super(0xc4, "negate_i", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v = (TreeItem) stack.pop(); + stack.push(new NegTreeItem(ins, v)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIns.java new file mode 100644 index 000000000..6ad4e25ef --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NegateIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NegTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NegateIns extends InstructionDefinition { + + public NegateIns() { + super(0x90, "negate", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v = (TreeItem) stack.pop(); + stack.push(new NegTreeItem(ins, v)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NotIns.java new file mode 100644 index 000000000..164d26428 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/NotIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NotTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NotIns extends InstructionDefinition { + + public NotIns() { + super(0x96, "not", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v = (TreeItem) stack.pop(); + stack.push(new NotTreeItem(ins, v)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIIns.java new file mode 100644 index 000000000..43a7d16bf --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.SubtractTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SubtractIIns extends InstructionDefinition { + + public SubtractIIns() { + super(0xc6, "subtract_i", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new SubtractTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIns.java new file mode 100644 index 000000000..d52a0d3e3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/arithmetic/SubtractIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.arithmetic; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.SubtractTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SubtractIns extends InstructionDefinition { + + public SubtractIns() { + super(0xa1, "subtract", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new SubtractTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitAndIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitAndIns.java new file mode 100644 index 000000000..8fc5e88b6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitAndIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.BitAndTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class BitAndIns extends InstructionDefinition { + + public BitAndIns() { + super(0xa8, "bitand", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Long value2 = (Long) lda.operandStack.pop(); + Long value1 = (Long) lda.operandStack.pop(); + Long value3 = value1 & value2; + lda.operandStack.push(value3); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new BitAndTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitNotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitNotIns.java new file mode 100644 index 000000000..6bdd23517 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitNotIns.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.BitNotTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class BitNotIns extends InstructionDefinition { + + public BitNotIns() { + super(0x97, "bitnot", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Long value = (Long) lda.operandStack.pop(); + Long ret = new Long(-value.longValue()); + lda.operandStack.push(ret); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v = (TreeItem) stack.pop(); + stack.push(new BitNotTreeItem(ins, v)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitOrIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitOrIns.java new file mode 100644 index 000000000..cfc9162a2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitOrIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.BitOrTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class BitOrIns extends InstructionDefinition { + + public BitOrIns() { + super(0xa9, "bitor", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Long value2 = (Long) lda.operandStack.pop(); + Long value1 = (Long) lda.operandStack.pop(); + Long value3 = value1 | value2; + lda.operandStack.push(value3); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new BitOrTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitXorIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitXorIns.java new file mode 100644 index 000000000..642a3c4cc --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/BitXorIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.BitXorTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class BitXorIns extends InstructionDefinition { + + public BitXorIns() { + super(0xaa, "bitxor", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Long value2 = (Long) lda.operandStack.pop(); + Long value1 = (Long) lda.operandStack.pop(); + Long value3 = value1 ^ value2; + lda.operandStack.push(value3); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new BitXorTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/LShiftIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/LShiftIns.java new file mode 100644 index 000000000..75546b52d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/LShiftIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LShiftTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class LShiftIns extends InstructionDefinition { + + public LShiftIns() { + super(0xa5, "lshift", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LShiftTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/RShiftIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/RShiftIns.java new file mode 100644 index 000000000..a06dd270d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/RShiftIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.RShiftTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class RShiftIns extends InstructionDefinition { + + public RShiftIns() { + super(0xa6, "rshift", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new RShiftTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/URShiftIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/URShiftIns.java new file mode 100644 index 000000000..a8f7a639e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/bitwise/URShiftIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.bitwise; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.URShiftTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class URShiftIns extends InstructionDefinition { + + public URShiftIns() { + super(0xa7, "urshift", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new URShiftTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/EqualsIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/EqualsIns.java new file mode 100644 index 000000000..a8f3e1f1a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/EqualsIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.EqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class EqualsIns extends InstructionDefinition { + + public EqualsIns() { + super(0xab, "equals", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj1 = lda.operandStack.pop(); + Object obj2 = lda.operandStack.pop(); + Boolean res = obj1.equals(obj2); + lda.operandStack.push(res); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new EqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterEqualsIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterEqualsIns.java new file mode 100644 index 000000000..5da2c1df2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterEqualsIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GreaterEqualsIns extends InstructionDefinition { + + public GreaterEqualsIns() { + super(0xb0, "greaterequals", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterThanIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterThanIns.java new file mode 100644 index 000000000..a90b33d9f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/GreaterThanIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GreaterThanIns extends InstructionDefinition { + + public GreaterThanIns() { + super(0xaf, "greaterthan", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessEqualsIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessEqualsIns.java new file mode 100644 index 000000000..95cb78d6d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessEqualsIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class LessEqualsIns extends InstructionDefinition { + + public LessEqualsIns() { + super(0xae, "lessequals", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessThanIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessThanIns.java new file mode 100644 index 000000000..6a4c7c8a7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/LessThanIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class LessThanIns extends InstructionDefinition { + + public LessThanIns() { + super(0xad, "lessthan", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/StrictEqualsIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/StrictEqualsIns.java new file mode 100644 index 000000000..ed66e035f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/comparsion/StrictEqualsIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.comparsion; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.StrictEqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class StrictEqualsIns extends InstructionDefinition { + + public StrictEqualsIns() { + super(0xac, "strictequals", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new StrictEqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java new file mode 100644 index 000000000..b0deb7a02 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructIns.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConstructTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class ConstructIns extends InstructionDefinition { + + public ConstructIns() { + super(0x42, "construct", new int[]{AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int argCount = (int) ((Long) arguments.get(0)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + Object obj = lda.operandStack.pop(); + throw new RuntimeException("Cannot call constructor"); + //call construct property of obj + //push new instance + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int argCount = ins.operands[0]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + TreeItem obj = (TreeItem) stack.pop(); + stack.push(new ConstructTreeItem(ins, obj, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java new file mode 100644 index 000000000..0dc3eec84 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructPropIns.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConstructPropTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class ConstructPropIns extends InstructionDefinition { + + public ConstructPropIns() { + super(0x4a, "constructprop", new int[]{AVM2Code.DAT_MULTINAME_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + throw new RuntimeException("Cannot construct property"); + //create property + //push new instance + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + + + stack.push(new ConstructPropTreeItem(ins, obj, multiname, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java new file mode 100644 index 000000000..080120606 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConstructSuperTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class ConstructSuperIns extends InstructionDefinition { + + public ConstructSuperIns() { + super(0x49, "constructsuper", new int[]{AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int argCount = (int) ((Long) arguments.get(0)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + Object obj = lda.operandStack.pop(); + throw new RuntimeException("Cannot call super constructor"); + //call construct property of obj + //do not push anything + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int argCount = ins.operands[0]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + TreeItem obj = (TreeItem) stack.pop(); + output.add(new ConstructSuperTreeItem(ins, obj, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewActivationIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewActivationIns.java new file mode 100644 index 000000000..b8c0e8afd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewActivationIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NewActivationIns extends InstructionDefinition { + + public NewActivationIns() { + super(0x57, "newactivation", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new NewActivationTreeItem(ins)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewArrayIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewArrayIns.java new file mode 100644 index 000000000..d8f5ceb85 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewArrayIns.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NewArrayTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class NewArrayIns extends InstructionDefinition { + + public NewArrayIns() { + super(0x56, "newarray", new int[]{AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int argCount = ins.operands[0]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + stack.push(new NewArrayTreeItem(ins, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewCatchIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewCatchIns.java new file mode 100644 index 000000000..20f1daf4f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewCatchIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.clauses.ExceptionTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NewCatchIns extends InstructionDefinition { + + public NewCatchIns() { + super(0x5a, "newcatch", new int[]{AVM2Code.DAT_EXCEPTION_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int exInfo = ins.operands[0]; + stack.push(new ExceptionTreeItem(body.exceptions[exInfo])); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewClassIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewClassIns.java new file mode 100644 index 000000000..3c4939b38 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewClassIns.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.UnparsedTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NewClassIns extends InstructionDefinition { + + public NewClassIns() { + super(0x58, "newclass", new int[]{AVM2Code.DAT_CLASS_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int clsIndex = ins.operands[0]; + String baseType = stack.pop().toString(); + stack.push(new UnparsedTreeItem(ins, "new class(" + clsIndex + ") extends " + baseType)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java new file mode 100644 index 000000000..002113cfa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewFunctionIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NewFunctionTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NewFunctionIns extends InstructionDefinition { + + public NewFunctionIns() { + super(0x40, "newfunction", new int[]{AVM2Code.DAT_METHOD_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int methodIndex = ins.operands[0]; + MethodBody mybody = abc.findBody(methodIndex); + String bodyStr = ""; + if (mybody != null) { + bodyStr = mybody.toString(isStatic, classIndex, abc, constants, method_info, false); + } + stack.push(new NewFunctionTreeItem(ins, method_info[methodIndex].getParamStr(constants), method_info[methodIndex].getReturnTypeStr(constants), bodyStr)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewObjectIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewObjectIns.java new file mode 100644 index 000000000..b900e8cd7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/construction/NewObjectIns.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.construction; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NameValuePair; +import com.jpexs.asdec.abc.avm2.treemodel.NewObjectTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class NewObjectIns extends InstructionDefinition { + + public NewObjectIns() { + super(0x55, "newobject", new int[]{AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int argCount = ins.operands[0]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + TreeItem value = (TreeItem) stack.pop(); + TreeItem name = (TreeItem) stack.pop(); + args.add(0, new NameValuePair(name, value)); + } + stack.push(new NewObjectTreeItem(ins, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugFileIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugFileIns.java new file mode 100644 index 000000000..ccb164c6d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugFileIns.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.debug; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class DebugFileIns extends InstructionDefinition { + + public DebugFileIns() { + super(0xf1, "debugfile", new int[]{AVM2Code.DAT_STRING_INDEX}); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugIns.java new file mode 100644 index 000000000..4be88beb0 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugIns.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.debug; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class DebugIns extends InstructionDefinition { + + public DebugIns() { + super(0xef, "debug", new int[]{AVM2Code.DAT_DEBUG_TYPE, AVM2Code.DAT_STRING_INDEX, AVM2Code.DAT_REGISTER_INDEX, AVM2Code.OPT_U30}); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugLineIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugLineIns.java new file mode 100644 index 000000000..075d02dc1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/debug/DebugLineIns.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.debug; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class DebugLineIns extends InstructionDefinition { + + public DebugLineIns() { + super(0xf0, "debugline", new int[]{AVM2Code.DAT_LINENUM}); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java new file mode 100644 index 000000000..40d2b0044 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallIns.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallIns extends InstructionDefinition { + + public CallIns() { + super(0x41, "call", new int[]{AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int argCount = (int) ((Long) arguments.get(0)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + Object receiver = lda.operandStack.pop(); + Object function = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown function"); + //push(result) + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int argCount = ins.operands[0]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + TreeItem receiver = (TreeItem) stack.pop(); + TreeItem function = (TreeItem) stack.pop(); + stack.push(new CallTreeItem(ins, receiver, function, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java new file mode 100644 index 000000000..0ff297b48 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallMethodIns.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallMethodTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallMethodIns extends InstructionDefinition { + + public CallMethodIns() { + super(0x43, "callmethod", new int[]{AVM2Code.DAT_METHOD_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of object's method + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + Object receiver = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown method"); + //push(result) + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int methodIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + TreeItem receiver = (TreeItem) stack.pop(); + String methodName = method_info[methodIndex].getName(constants); + stack.push(new CallMethodTreeItem(ins, receiver, methodName, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropLexIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropLexIns.java new file mode 100644 index 000000000..3a0c0934f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropLexIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.CallPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallPropLexIns extends CallPropertyIns { + + public CallPropLexIns() { + instructionName = "callproplex"; + instructionCode = 0x4c; + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem receiver = (TreeItem) stack.pop(); + + stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java new file mode 100644 index 000000000..87a9c4b85 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallPropVoidIns extends InstructionDefinition { + + public CallPropVoidIns() { + super(0x4f, "callpropvoid", new int[]{AVM2Code.DAT_MULTINAME_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + //same as callproperty + + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + Object obj = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown property"); + //do not push anything + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + + TreeItem receiver = (TreeItem) stack.pop(); + + output.add(new CallPropertyTreeItem(ins, true, receiver, multiname, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java new file mode 100644 index 000000000..02158a55f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallPropertyIns.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallPropertyIns extends InstructionDefinition { + + public CallPropertyIns() { + super(0x46, "callproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + Object obj = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown property"); + //push(result) + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + + TreeItem receiver = (TreeItem) stack.pop(); + + stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java new file mode 100644 index 000000000..457a7002d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallStaticIns.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallStaticTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallStaticIns extends InstructionDefinition { + + public CallStaticIns() { + super(0x44, "callstatic", new int[]{AVM2Code.DAT_METHOD_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int methodIndex = (int) ((Long) arguments.get(0)).longValue(); //index of method_info + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + Object receiver = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown static method"); + //push(result) + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int methodIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + TreeItem receiver = (TreeItem) stack.pop(); + String methodName = method_info[methodIndex].getName(constants); + stack.push(new CallStaticTreeItem(ins, receiver, methodName, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java new file mode 100644 index 000000000..d68eac820 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperIns.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallSuperTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallSuperIns extends InstructionDefinition { + + public CallSuperIns() { + super(0x45, "callsuper", new int[]{AVM2Code.DAT_MULTINAME_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + Object receiver = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown super method"); + //push(result) + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add(0, (TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem receiver = (TreeItem) stack.pop(); + + stack.push(new CallSuperTreeItem(ins, false, receiver, multiname, args)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java new file mode 100644 index 000000000..9954ef838 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.executing; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CallSuperTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class CallSuperVoidIns extends InstructionDefinition { + + public CallSuperVoidIns() { + super(0x4e, "callsupervoid", new int[]{AVM2Code.DAT_MULTINAME_INDEX, AVM2Code.DAT_ARG_COUNT}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + int argCount = (int) ((Long) arguments.get(1)).longValue(); + List passArguments = new ArrayList(); + for (int i = argCount - 1; i >= 0; i--) { + passArguments.set(i, lda.operandStack.pop()); + } + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + Object receiver = lda.operandStack.pop(); + throw new RuntimeException("Call to unknown super method"); + //do not push anything + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + int argCount = ins.operands[1]; + List args = new ArrayList(); + for (int a = 0; a < argCount; a++) { + args.add((TreeItem) stack.pop()); + } + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem receiver = (TreeItem) stack.pop(); + + output.add(new CallSuperTreeItem(ins, true, receiver, multiname, args)); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfEqIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfEqIns.java new file mode 100644 index 000000000..1e5914384 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfEqIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.EqTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NeqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfEqIns extends InstructionDefinition implements IfTypeIns { + + public IfEqIns() { + super(0x13, "ifeq", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new EqTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new NeqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfFalseIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfFalseIns.java new file mode 100644 index 000000000..73423ca40 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfFalseIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NotTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfFalseIns extends InstructionDefinition implements IfTypeIns { + + public IfFalseIns() { + super(0x12, "iffalse", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new NotTreeItem(ins, v1)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + //String v1 = stack.pop().toString(); + //stack.push("(" + v1 + ")"); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGeIns.java new file mode 100644 index 000000000..6297fb4ae --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GeTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfGeIns extends InstructionDefinition implements IfTypeIns { + + public IfGeIns() { + super(0x18, "ifge", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GeTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGtIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGtIns.java new file mode 100644 index 000000000..078834cc1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfGtIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GtTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfGtIns extends InstructionDefinition implements IfTypeIns { + + public IfGtIns() { + super(0x17, "ifgt", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GtTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLeIns.java new file mode 100644 index 000000000..7d2aa779b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GtTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfLeIns extends InstructionDefinition implements IfTypeIns { + + public IfLeIns() { + super(0x16, "ifle", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LeTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLtIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLtIns.java new file mode 100644 index 000000000..0bc647593 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfLtIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GeTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfLtIns extends InstructionDefinition implements IfTypeIns { + + public IfLtIns() { + super(0x15, "iflt", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LtTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGeIns.java new file mode 100644 index 000000000..4a1731701 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GeTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfNGeIns extends InstructionDefinition implements IfTypeIns { + + public IfNGeIns() { + super(0x0f, "ifnge", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LtTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGtIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGtIns.java new file mode 100644 index 000000000..81495ce11 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNGtIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GtTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfNGtIns extends InstructionDefinition implements IfTypeIns { + + public IfNGtIns() { + super(0x0e, "ifngt", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LeTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLeIns.java new file mode 100644 index 000000000..bafb9c11b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GtTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfNLeIns extends InstructionDefinition implements IfTypeIns { + + public IfNLeIns() { + super(0x0d, "ifnle", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GtTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LeTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLtIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLtIns.java new file mode 100644 index 000000000..208ea73ee --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNLtIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.GeTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.LtTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfNLtIns extends InstructionDefinition implements IfTypeIns { + + public IfNLtIns() { + super(0x0c, "ifnlt", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new GeTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new LtTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNeIns.java new file mode 100644 index 000000000..19372f91e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfNeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.EqTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NeqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfNeIns extends InstructionDefinition implements IfTypeIns { + + public IfNeIns() { + super(0x14, "ifne", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new NeqTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new EqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictEqIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictEqIns.java new file mode 100644 index 000000000..141a4ae4c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictEqIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.StrictEqTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.StrictNeqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns { + + public IfStrictEqIns() { + super(0x19, "ifstricteq", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new StrictEqTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new StrictNeqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictNeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictNeIns.java new file mode 100644 index 000000000..f84c50411 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfStrictNeIns.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.StrictEqTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.StrictNeqTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns { + + public IfStrictNeIns() { + super(0x1A, "ifstrictne", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new StrictNeqTreeItem(ins, v1, v2)); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v2 = (TreeItem) stack.pop(); + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new StrictEqTreeItem(ins, v1, v2)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfTrueIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfTrueIns.java new file mode 100644 index 000000000..b99ff935a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/IfTrueIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.NotTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IfTrueIns extends InstructionDefinition implements IfTypeIns { + + public IfTrueIns() { + super(0x11, "iftrue", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + //String v1 = stack.pop().toString(); + //stack.push("(" + v1 + ")"); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + TreeItem v1 = (TreeItem) stack.pop(); + stack.push(new NotTreeItem(ins, v1)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/JumpIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/JumpIns.java new file mode 100644 index 000000000..1a7655c46 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/JumpIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.IfTypeIns; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.BooleanTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class JumpIns extends InstructionDefinition implements IfTypeIns { + + public JumpIns() { + super(0x10, "jump", new int[]{AVM2Code.DAT_OFFSET}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new BooleanTreeItem(ins, Boolean.TRUE));// + ins.operands[0]); + } + + public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/LookupSwitchIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/LookupSwitchIns.java new file mode 100644 index 000000000..c7467427d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/jumps/LookupSwitchIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.jumps; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class LookupSwitchIns extends InstructionDefinition { + + public LookupSwitchIns() { + super(0x1b, "lookupswitch", new int[]{AVM2Code.DAT_CASE_BASEOFFSET, AVM2Code.OPT_CASE_OFFSETS}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int defaultOffset = ins.operands[0]; + int caseCount = ins.operands[1]; + //stack.push("switch(...)"); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIIns.java new file mode 100644 index 000000000..a5c430b90 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIIns.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.DecLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DecLocalIIns extends InstructionDefinition { + + public DecLocalIIns() { + super(0xc3, "declocal_i", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int locRegIndex = (int) ((Long) arguments.get(0)).longValue(); + Object obj = lda.localRegisters.get(locRegIndex); + if (obj instanceof Long) { + Long obj2 = ((Long) obj).longValue() - 1; + lda.localRegisters.set(locRegIndex, obj2); + } else if (obj instanceof Double) { + Double obj2 = ((Double) obj).doubleValue() - 1; + lda.localRegisters.set(locRegIndex, obj2); + } + if (obj instanceof String) { + Double obj2 = Double.parseDouble((String) obj) - 1; + lda.localRegisters.set(locRegIndex, obj2); + } else { + throw new RuntimeException("Cannot decrement local register"); + } + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int regIndex = ins.operands[0]; + output.add(new DecLocalTreeItem(ins, regIndex)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIns.java new file mode 100644 index 000000000..0bb8a3378 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/DecLocalIns.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.DecLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DecLocalIns extends InstructionDefinition { + + public DecLocalIns() { + super(0x94, "declocal", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int locRegIndex = (int) ((Long) arguments.get(0)).longValue(); + Object obj = lda.localRegisters.get(locRegIndex); + if (obj instanceof Long) { + Long obj2 = ((Long) obj).longValue() - 1; + lda.localRegisters.set(locRegIndex, obj2); + } else if (obj instanceof Double) { + Double obj2 = ((Double) obj).doubleValue() - 1; + lda.localRegisters.set(locRegIndex, obj2); + } + if (obj instanceof String) { + Double obj2 = Double.parseDouble((String) obj) - 1; + lda.localRegisters.set(locRegIndex, obj2); + } else { + throw new RuntimeException("Cannot decrement local register"); + } + } + + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int regIndex = ins.operands[0]; + output.add(new DecLocalTreeItem(ins, regIndex)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal0Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal0Ins.java new file mode 100644 index 000000000..9d92f9c50 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal0Ins.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ClassTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.ThisTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetLocal0Ins extends InstructionDefinition implements GetLocalTypeIns { + + public GetLocal0Ins() { + super(0xd0, "getlocal_0", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + if (isStatic) { + stack.push(new ClassTreeItem(abc.instance_info[classIndex].getName(constants).getName(constants))); + } else { + stack.push(new ThisTreeItem()); + } + } + + public int getRegisterId(AVM2Instruction par0) { + return 0; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal1Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal1Ins.java new file mode 100644 index 000000000..c0e9aea2b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal1Ins.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetLocal1Ins extends InstructionDefinition implements GetLocalTypeIns { + + public GetLocal1Ins() { + super(0xd1, "getlocal_1", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new LocalRegTreeItem(ins, 1, localRegs.get(1))); + } + + public int getRegisterId(AVM2Instruction par0) { + return 1; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal2Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal2Ins.java new file mode 100644 index 000000000..b158ed173 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal2Ins.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetLocal2Ins extends InstructionDefinition implements GetLocalTypeIns { + + public GetLocal2Ins() { + super(0xd2, "getlocal_2", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new LocalRegTreeItem(ins, 2, localRegs.get(2))); + } + + public int getRegisterId(AVM2Instruction par0) { + return 2; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal3Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal3Ins.java new file mode 100644 index 000000000..526b3ed3f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocal3Ins.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetLocal3Ins extends InstructionDefinition implements GetLocalTypeIns { + + public GetLocal3Ins() { + super(0xd3, "getlocal_3", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new LocalRegTreeItem(ins, 3, localRegs.get(3))); + } + + public int getRegisterId(AVM2Instruction par0) { + return 3; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalIns.java new file mode 100644 index 000000000..3dc1b3fa9 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetLocalIns extends InstructionDefinition implements GetLocalTypeIns { + + public GetLocalIns() { + super(0x62, "getlocal", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int regIndex = ins.operands[0]; + stack.push(new LocalRegTreeItem(ins, regIndex, localRegs.get(regIndex))); + } + + public int getRegisterId(AVM2Instruction ins) { + return ins.operands[0]; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalTypeIns.java new file mode 100644 index 000000000..c59914f70 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/GetLocalTypeIns.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public interface GetLocalTypeIns { + public abstract int getRegisterId(AVM2Instruction ins); +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIIns.java new file mode 100644 index 000000000..acd13bbd5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IncLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IncLocalIIns extends InstructionDefinition { + + public IncLocalIIns() { + super(0xc2, "inclocal_i", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int regIndex = ins.operands[0]; + output.add(new IncLocalTreeItem(ins, regIndex)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIns.java new file mode 100644 index 000000000..333bb24ac --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/IncLocalIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IncLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IncLocalIns extends InstructionDefinition { + + public IncLocalIns() { + super(0x92, "inclocal", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int regIndex = ins.operands[0]; + output.add(new IncLocalTreeItem(ins, regIndex)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/KillIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/KillIns.java new file mode 100644 index 000000000..fca427d9c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/KillIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class KillIns extends InstructionDefinition { + + public KillIns() { + super(0x08, "kill", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + //kill local register + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java new file mode 100644 index 000000000..27325da0e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal0Ins.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetLocal0Ins extends InstructionDefinition implements SetTypeIns, SetLocalTypeIns { + + public SetLocal0Ins() { + super(0xd4, "setlocal_0", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + localRegs.put(0, val); + if (val instanceof NewActivationTreeItem) return; + if (val instanceof FindPropertyTreeItem) return; + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalTreeItem(ins, 0, val)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return localRegName(0); + } + + public int getRegisterId(AVM2Instruction ins) { + return 0; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java new file mode 100644 index 000000000..7cd3ed69a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal1Ins.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetLocal1Ins extends InstructionDefinition implements SetTypeIns, SetLocalTypeIns { + + public SetLocal1Ins() { + super(0xd5, "setlocal_1", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + localRegs.put(1, val); + if (val instanceof NewActivationTreeItem) return; + if (val instanceof FindPropertyTreeItem) return; + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalTreeItem(ins, 1, val)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return localRegName(1); + } + + public int getRegisterId(AVM2Instruction ins) { + return 1; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java new file mode 100644 index 000000000..d9b904f03 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal2Ins.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetLocal2Ins extends InstructionDefinition implements SetTypeIns, SetLocalTypeIns { + + public SetLocal2Ins() { + super(0xd6, "setlocal_2", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + localRegs.put(2, val); + if (val instanceof NewActivationTreeItem) return; + if (val instanceof FindPropertyTreeItem) return; + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalTreeItem(ins, 2, val)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return localRegName(2); + } + + public int getRegisterId(AVM2Instruction ins) { + return 2; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java new file mode 100644 index 000000000..c729c4e4f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocal3Ins.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetLocal3Ins extends InstructionDefinition implements SetTypeIns, SetLocalTypeIns { + + public SetLocal3Ins() { + super(0xd7, "setlocal_3", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + localRegs.put(3, val); + if (val instanceof NewActivationTreeItem) return; + if (val instanceof FindPropertyTreeItem) return; + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalTreeItem(ins, 3, val)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return localRegName(3); + } + + public int getRegisterId(AVM2Instruction ins) { + return 3; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java new file mode 100644 index 000000000..c48fdf2fd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalIns.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.NewActivationTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetLocalIns extends InstructionDefinition implements SetTypeIns, SetLocalTypeIns { + + public SetLocalIns() { + super(0x63, "setlocal", new int[]{AVM2Code.DAT_LOCAL_REG_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + localRegs.put(ins.operands[0], val); + if (val instanceof NewActivationTreeItem) return; + if (val instanceof FindPropertyTreeItem) return; + //if(val.startsWith("catchscope ")) return; + //if(val.startsWith("newactivation()")) return; + output.add(new SetLocalTreeItem(ins, ins.operands[0], val)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return localRegName(ins.operands[0]); + } + + public int getRegisterId(AVM2Instruction ins) { + return ins.operands[0]; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java new file mode 100644 index 000000000..a2871c412 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.localregs; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public interface SetLocalTypeIns { + public abstract int getRegisterId(AVM2Instruction ins); +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/DeletePropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/DeletePropertyIns.java new file mode 100644 index 000000000..129ef6848 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/DeletePropertyIns.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.BooleanTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.DeletePropertyTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DeletePropertyIns extends InstructionDefinition { + + public DeletePropertyIns() { + super(0x6a, "deleteproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multiIndex = (int) ((Long) arguments.get(0)).longValue(); + //if multiname[multinameIndex] is runtime + //pop(name) pop(ns) + Object obj = lda.operandStack.pop(); + //push true if removed + throw new RuntimeException("Cannot remove property"); + + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + stack.add(new BooleanTreeItem(ins, Boolean.TRUE));//property successfully deleted + output.add(new DeletePropertyTreeItem(ins, obj, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyIns.java new file mode 100644 index 000000000..c507c0468 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyIns.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class FindPropertyIns extends InstructionDefinition { + + public FindPropertyIns() { + super(0x5e, "findproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multiIndex = (int) ((Long) arguments.get(0)).longValue(); + //if is runtime + //pop(name), pop(ns) + throw new RuntimeException("Cannot find property"); + + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + stack.push(new FindPropertyTreeItem(ins, multiname)); //resolve right object + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyStrictIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyStrictIns.java new file mode 100644 index 000000000..3688dba3b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/FindPropertyStrictIns.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FindPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class FindPropertyStrictIns extends InstructionDefinition { + + public FindPropertyStrictIns() { + super(0x5d, "findpropstrict", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multiIndex = (int) ((Long) arguments.get(0)).longValue(); + //if is runtime + //pop(name), pop(ns) + throw new RuntimeException("Cannot find property"); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + stack.push(new FindPropertyTreeItem(ins, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetDescendantsIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetDescendantsIns.java new file mode 100644 index 000000000..5b8bbc77e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetDescendantsIns.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.GetDescendantsTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetDescendantsIns extends InstructionDefinition { + + public GetDescendantsIns() { + super(0x59, "getdescentants", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multiIndex = (int) ((Long) arguments.get(0)).longValue(); + //if is runtime + //pop(name), pop(ns) + Object obj = lda.operandStack.pop(); + throw new RuntimeException("getdescentants not working"); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + stack.push(new GetDescendantsTreeItem(ins, obj, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java new file mode 100644 index 000000000..92c0f75bf --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalScopeIns.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetGlobalScopeIns extends InstructionDefinition { + + public GetGlobalScopeIns() { + super(0x64, "getglobalscope", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + throw new RuntimeException("getglobalscope not working"); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(scopeStack.get(0)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalSlotIns.java new file mode 100644 index 000000000..86deb7119 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetGlobalSlotIns.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.GetSlotTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.clauses.ExceptionTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.traits.TraitSlotConst; + +import java.util.List; +import java.util.Stack; + + +public class GetGlobalSlotIns extends InstructionDefinition { + + public GetGlobalSlotIns() { + super(0x6e, "getglobalslot", new int[]{AVM2Code.DAT_SLOT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int slotIndex = ins.operands[0]; + TreeItem obj = (TreeItem) scopeStack.get(0); //scope + Multiname slotname = null; + if (obj instanceof ExceptionTreeItem) { + slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; + } else { + + for (int t = 0; t < body.traits.traits.length; t++) { + if (body.traits.traits[t] instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { + slotname = body.traits.traits[t].getMultiName(constants); + } + } + + } + } + stack.push(new GetSlotTreeItem(ins, obj, slotname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetLexIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetLexIns.java new file mode 100644 index 000000000..bf90a88f0 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetLexIns.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.GetLexTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; + +import java.util.List; +import java.util.Stack; + + +public class GetLexIns extends InstructionDefinition { + + public GetLexIns() { + super(0x60, "getlex", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + Multiname multiname = constants.constant_multiname[multinameIndex]; + stack.push(new GetLexTreeItem(ins, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetPropertyIns.java new file mode 100644 index 000000000..f2240f52a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetPropertyIns.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.GetPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetPropertyIns extends InstructionDefinition { + + public GetPropertyIns() { + super(0x66, "getproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + stack.push(new GetPropertyTreeItem(ins, obj, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java new file mode 100644 index 000000000..35964e164 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetScopeObjectIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetScopeObjectIns extends InstructionDefinition { + + + public GetScopeObjectIns() { + super(0x65, "getscopeobject", new int[]{AVM2Code.DAT_SLOT_SCOPE_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int index = ins.operands[0]; + /* System.out.println("Getting scope object"+index+":"); + for(TreeItem ti:scopeStack){ + System.out.println(ti.toString(constants)); + }*/ + stack.push(scopeStack.get(index)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java new file mode 100644 index 000000000..f65e90ee5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSlotIns.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.GetSlotTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.clauses.ExceptionTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.traits.TraitSlotConst; + +import java.util.List; +import java.util.Stack; + + +public class GetSlotIns extends InstructionDefinition { + + public GetSlotIns() { + super(0x6c, "getslot", new int[]{AVM2Code.DAT_SLOT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int slotIndex = ins.operands[0]; + TreeItem obj = (TreeItem) stack.pop(); //scope + Multiname slotname = null; + if (obj instanceof ExceptionTreeItem) { + slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; + } else { + + for (int t = 0; t < body.traits.traits.length; t++) { + if (body.traits.traits[t] instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { + slotname = body.traits.traits[t].getMultiName(constants); + } + } + + } + } + stack.push(new GetSlotTreeItem(ins, obj, slotname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSuperIns.java new file mode 100644 index 000000000..68e03e13f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/GetSuperIns.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.GetSuperTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class GetSuperIns extends InstructionDefinition { + + public GetSuperIns() { + super(0x04, "getsuper", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + stack.push(new GetSuperTreeItem(ins, obj, multiname)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java new file mode 100644 index 000000000..5daf7139b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNext2Ins.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.EachTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.LocalRegTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class HasNext2Ins extends InstructionDefinition { + + public HasNext2Ins() { + super(0x32, "hasnext2", new int[]{AVM2Code.OPT_U8, AVM2Code.OPT_U8}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int objectReg = ins.operands[0]; + int indexReg = ins.operands[1]; + //stack.push("_loc_" + objectReg + ".hasNext(cnt=_loc_" + indexReg + ")"); + stack.push(new EachTreeItem(ins, new LocalRegTreeItem(ins, indexReg, localRegs.get(indexReg)), new LocalRegTreeItem(ins, objectReg, localRegs.get(objectReg)))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java new file mode 100644 index 000000000..7289a155c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/HasNextIns.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.EachTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class HasNextIns extends InstructionDefinition { + + public HasNextIns() { + super(0x1f, "hasnext", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem curIndex = (TreeItem) stack.pop(); + TreeItem obj = (TreeItem) stack.pop(); + stack.push(new EachTreeItem(ins, curIndex, obj)); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InIns.java new file mode 100644 index 000000000..69a6fcccb --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.InTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class InIns extends InstructionDefinition { + + public InIns() { + super(0xb4, "in", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem obj = (TreeItem) stack.pop(); + TreeItem name = (TreeItem) stack.pop(); + stack.push(new InTreeItem(ins, name, obj)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InitPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InitPropertyIns.java new file mode 100644 index 000000000..33fbc9e7f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/InitPropertyIns.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.InitPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class InitPropertyIns extends InstructionDefinition { + + public InitPropertyIns() { + super(0x68, "initproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + + TreeItem val = (TreeItem) stack.pop(); + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + output.add(new InitPropertyTreeItem(ins, obj, multiname, val)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/LabelIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/LabelIns.java new file mode 100644 index 000000000..b77542adc --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/LabelIns.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class LabelIns extends InstructionDefinition { +//this can be target of branch + + public LabelIns() { + super(0x09, "label", new int[]{}); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextNameIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextNameIns.java new file mode 100644 index 000000000..7f19c5bc6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextNameIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NextNameIns extends InstructionDefinition { + + public NextNameIns() { + super(0x1e, "nextname", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem index = stack.pop(); + TreeItem obj = stack.pop(); + //stack.push(obj + ".nextName(" + index + ")"); + stack.push(index); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java new file mode 100644 index 000000000..c7bb5d23d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NextValueIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class NextValueIns extends InstructionDefinition { + + public NextValueIns() { + super(0x23, "nextvalue", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem index = stack.pop(); + TreeItem obj = stack.pop(); + //stack.push(obj + ".nextValue(" + index + ")"); + stack.push(index); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NopIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NopIns.java new file mode 100644 index 000000000..12c1196ea --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/NopIns.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class NopIns extends InstructionDefinition { + + public NopIns() { + super(0x02, "nop", new int[]{}); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnValueIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnValueIns.java new file mode 100644 index 000000000..3ea6a3936 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnValueIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ReturnValueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ReturnValueIns extends InstructionDefinition { + + public ReturnValueIns() { + super(0x48, "returnvalue", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + output.add(new ReturnValueTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnVoidIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnVoidIns.java new file mode 100644 index 000000000..0dda65fc4 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ReturnVoidIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ReturnVoidTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ReturnVoidIns extends InstructionDefinition { + + public ReturnVoidIns() { + super(0x47, "returnvoid", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + output.add(new ReturnVoidTreeItem(ins)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetGlobalSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetGlobalSlotIns.java new file mode 100644 index 000000000..27d5ee8ea --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetGlobalSlotIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.SetGlobalSlotTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetGlobalSlotIns extends InstructionDefinition implements SetTypeIns { + + public SetGlobalSlotIns() { + super(0x6f, "setglobalslot", new int[]{AVM2Code.DAT_SLOT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + output.add(new SetGlobalSlotTreeItem(ins, ins.operands[0], (TreeItem) stack.pop())); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + return "globalslot" + ins.operands[0]; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetPropertyIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetPropertyIns.java new file mode 100644 index 000000000..ccce9a88d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetPropertyIns.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetPropertyTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetPropertyIns extends InstructionDefinition implements SetTypeIns { + + public SetPropertyIns() { + super(0x61, "setproperty", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + TreeItem value = (TreeItem) stack.pop(); + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + output.add(new SetPropertyTreeItem(ins, obj, multiname, value)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + int multinameIndex = ins.operands[0]; + String multiname = resolveMultinameNoPop(0, stack, constants, multinameIndex, ins); + TreeItem obj = stack.get(1 + resolvedCount(constants, multinameIndex)); //pod vrcholem + if ((!obj.toString().equals(""))) multiname = "." + multiname; + return obj + multiname; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java new file mode 100644 index 000000000..56f9f4d7d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSlotIns.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.SetSlotTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.clauses.ExceptionTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.traits.TraitSlotConst; + +import java.util.List; +import java.util.Stack; + + +public class SetSlotIns extends InstructionDefinition implements SetTypeIns { + + public SetSlotIns() { + super(0x6d, "setslot", new int[]{AVM2Code.DAT_SLOT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int slotIndex = ins.operands[0]; + TreeItem value = (TreeItem) stack.pop(); + TreeItem obj = (TreeItem) stack.pop(); //scopeId + + if (obj instanceof ExceptionTreeItem) { + return; + } + //if(value.startsWith("catched ")) return; + Multiname slotname = null; + for (int t = 0; t < body.traits.traits.length; t++) { + if (body.traits.traits[t] instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { + slotname = body.traits.traits[t].getMultiName(constants); + } + } + + } + output.add(new SetSlotTreeItem(ins, obj, slotname, value)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + int slotIndex = ins.operands[0]; + ////String obj = stack.get(1); + String slotname = ""; + for (int t = 0; t < body.traits.traits.length; t++) { + if (body.traits.traits[t] instanceof TraitSlotConst) { + if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { + slotname = body.traits.traits[t].getMultiName(constants).getName(constants); + } + } + + } + return slotname; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSuperIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSuperIns.java new file mode 100644 index 000000000..a53c644b5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/SetSuperIns.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.instructions.SetTypeIns; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.SetSuperTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SetSuperIns extends InstructionDefinition implements SetTypeIns { + + public SetSuperIns() { + super(0x05, "setsuper", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + + TreeItem value = (TreeItem) stack.pop(); + FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); + TreeItem obj = (TreeItem) stack.pop(); + output.add(new SetSuperTreeItem(ins, value, obj, multiname)); + } + + public String getObject(Stack stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body) { + int multinameIndex = ins.operands[0]; + String multiname = resolveMultinameNoPop(1, stack, constants, multinameIndex, ins); + String obj = stack.get(1 + resolvedCount(constants, multinameIndex)).toString(constants); + return obj + ".super." + multiname; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ThrowIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ThrowIns.java new file mode 100644 index 000000000..941ee90d9 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/other/ThrowIns.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.other; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ThrowTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ThrowIns extends InstructionDefinition { + + public ThrowIns() { + super(0x03, "throw", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc) { + output.add(new ThrowTreeItem(ins, (TreeItem) stack.pop())); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java new file mode 100644 index 000000000..fb095bbaa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/DupIns.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DupIns extends InstructionDefinition { + + public DupIns() { + super(0x2a, "dup", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj = lda.operandStack.pop(); + lda.operandStack.push(obj); + lda.operandStack.push(obj); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem v = (TreeItem) stack.pop(); + stack.push(v); + stack.push(v); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopIns.java new file mode 100644 index 000000000..abaecbcfd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PopIns extends InstructionDefinition { + + public PopIns() { + super(0x29, "pop", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + if (stack.size() > 0) + stack.pop(); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java new file mode 100644 index 000000000..12ed08daa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PopScopeIns.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.WithTreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + + +public class PopScopeIns extends InstructionDefinition { + + public PopScopeIns() { + super(0x1d, "popscope", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc) { + TreeItem scope = (TreeItem) scopeStack.pop(); + for (int i = output.size() - 1; i >= 0; i--) { + if (output.get(i) instanceof WithTreeItem) { + WithTreeItem wti = (WithTreeItem) output.get(i); + if (wti.scope == scope) { + wti.items = new ArrayList(); + for (int k = i + 1; k < output.size(); k++) { + //output.subList(i+1, output.size()); + wti.items.add(output.get(k)); + } + while (output.size() > i + 1) { + output.remove(i + 1); + } + /*int count=output.size()-1-(i+1); + for(int c=0;c localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IntegerValueTreeItem(ins, new Long(ins.operands[0]))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushDoubleIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushDoubleIns.java new file mode 100644 index 000000000..63bd8d43a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushDoubleIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FloatValueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushDoubleIns extends InstructionDefinition { + + public PushDoubleIns() { + super(0x2f, "pushdouble", new int[]{AVM2Code.DAT_DOUBLE_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new FloatValueTreeItem(ins, constants.constant_double[ins.operands[0]])); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushFalseIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushFalseIns.java new file mode 100644 index 000000000..ed73b4621 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushFalseIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.BooleanTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushFalseIns extends InstructionDefinition { + + public PushFalseIns() { + super(0x27, "pushfalse", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new BooleanTreeItem(ins, Boolean.FALSE)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushIntIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushIntIns.java new file mode 100644 index 000000000..5da1ca584 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushIntIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IntegerValueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushIntIns extends InstructionDefinition { + + public PushIntIns() { + super(0x2d, "pushint", new int[]{AVM2Code.DAT_INT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IntegerValueTreeItem(ins, constants.constant_int[ins.operands[0]])); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNamespaceIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNamespaceIns.java new file mode 100644 index 000000000..e5b81100d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNamespaceIns.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NameSpaceTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushNamespaceIns extends InstructionDefinition { + + public PushNamespaceIns() { + super(0x31, "pushnamespace", new int[]{AVM2Code.OPT_U30}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc) { + stack.push(new NameSpaceTreeItem(ins, ins.operands[0])); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNanIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNanIns.java new file mode 100644 index 000000000..b39d602c5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNanIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NanTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushNanIns extends InstructionDefinition { + + public PushNanIns() { + super(0x28, "pushnan", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new NanTreeItem(ins)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNullIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNullIns.java new file mode 100644 index 000000000..7681a417a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushNullIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.NullTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushNullIns extends InstructionDefinition { + + public PushNullIns() { + super(0x20, "pushnull", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new NullTreeItem(ins)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushScopeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushScopeIns.java new file mode 100644 index 000000000..3107b1f92 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushScopeIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushScopeIns extends InstructionDefinition { + + public PushScopeIns() { + super(0x30, "pushscope", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + scopeStack.push(stack.pop()); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushShortIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushShortIns.java new file mode 100644 index 000000000..6cbef6a44 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushShortIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IntegerValueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushShortIns extends InstructionDefinition { + + public PushShortIns() { + super(0x25, "pushshort", new int[]{AVM2Code.OPT_U30}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IntegerValueTreeItem(ins, new Long(ins.operands[0]))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushStringIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushStringIns.java new file mode 100644 index 000000000..8de55f793 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushStringIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.StringTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushStringIns extends InstructionDefinition { + + public PushStringIns() { + super(0x2c, "pushstring", new int[]{AVM2Code.DAT_STRING_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new StringTreeItem(ins, constants.constant_string[ins.operands[0]])); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushTrueIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushTrueIns.java new file mode 100644 index 000000000..3970ca4ac --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushTrueIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.BooleanTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushTrueIns extends InstructionDefinition { + + public PushTrueIns() { + super(0x26, "pushtrue", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new BooleanTreeItem(ins, Boolean.TRUE)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUIntIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUIntIns.java new file mode 100644 index 000000000..43a1d5ca3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUIntIns.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.IntegerValueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushUIntIns extends InstructionDefinition { + + public PushUIntIns() { + super(0x2e, "pushuint", new int[]{AVM2Code.DAT_UINT_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new IntegerValueTreeItem(ins, constants.constant_uint[ins.operands[0]])); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUndefinedIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUndefinedIns.java new file mode 100644 index 000000000..6e112342e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushUndefinedIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.UndefinedTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushUndefinedIns extends InstructionDefinition { + + public PushUndefinedIns() { + super(0x21, "pushundefined", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new UndefinedTreeItem(ins)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushWithIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushWithIns.java new file mode 100644 index 000000000..906b2fcd6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/PushWithIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.WithTreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class PushWithIns extends InstructionDefinition { + + public PushWithIns() { + super(0x1c, "pushwith", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc) { + TreeItem w = (TreeItem) stack.pop(); + scopeStack.push(w); + output.add(new WithTreeItem(ins, w)); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/SwapIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/SwapIns.java new file mode 100644 index 000000000..37e111653 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/stack/SwapIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.stack; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodBody; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class SwapIns extends InstructionDefinition { + + public SwapIns() { + super(0x2b, "swap", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc) { + + TreeItem o1 = stack.pop(); + TreeItem o2 = stack.pop(); + stack.push(o1); + stack.push(o2); + + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeIns.java new file mode 100644 index 000000000..38dc6892b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeIns.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.AsTypeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class AsTypeIns extends InstructionDefinition { + + public AsTypeIns() { + super(0x86, "astype", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Long typeIndex = (Long) arguments.get(0); + Object obj = lda.operandStack.pop(); + //if multiname[typeIndex]==obj + lda.operandStack.push(obj); + //else push null + + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem val = (TreeItem) stack.pop(); + + stack.push(new AsTypeTreeItem(ins, val, new FullMultinameTreeItem(ins, ins.operands[0]))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeLateIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeLateIns.java new file mode 100644 index 000000000..4d8b16ba2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/AsTypeLateIns.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.AsTypeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class AsTypeLateIns extends InstructionDefinition { + + public AsTypeLateIns() { + super(0x87, "astypelate", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object objClass = lda.operandStack.pop(); + Object obj = lda.operandStack.pop(); + //if obj.class=objClass + lda.operandStack.push(obj); + //else push null + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem cls = (TreeItem) stack.pop(); + TreeItem val = (TreeItem) stack.pop(); + stack.push(new AsTypeTreeItem(ins, val, cls)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceAIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceAIns.java new file mode 100644 index 000000000..49c83d265 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceAIns.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CoerceTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class CoerceAIns extends InstructionDefinition { + + public CoerceAIns() { + super(0x82, "coerce_a", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + //coerce any type + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), "*")); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceIns.java new file mode 100644 index 000000000..7f6b48eee --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceIns.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CoerceTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class CoerceIns extends InstructionDefinition { + + public CoerceIns() { + super(0x80, "coerce", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int multinameIndex = (int) ((Long) arguments.get(0)).longValue(); + //push and pop coerced value to specified type + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), constants.constant_multiname[multinameIndex].getName(constants))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceSIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceSIns.java new file mode 100644 index 000000000..2c632baf6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/CoerceSIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.CoerceTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class CoerceSIns extends InstructionDefinition { + + public CoerceSIns() { + super(0x85, "coerce_s", new int[]{}); + } + + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj = lda.operandStack.pop(); + lda.operandStack.push(obj.toString()); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), "string")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java new file mode 100644 index 000000000..3a46889c2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertBIns.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertBIns extends InstructionDefinition { + + public ConvertBIns() { + super(0x76, "convert_b", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object value = lda.operandStack.pop(); + boolean bval = false; + if (value instanceof Boolean) { + bval = (Boolean) value; + } else if (value instanceof Long) { + bval = ((Long) value).longValue() != 0; + } else if (value instanceof String) { + bval = !((String) value).equals(""); + } else { + bval = true; + } + lda.operandStack.push(new Boolean(bval)); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "boolean")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java new file mode 100644 index 000000000..306a9823b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertDIns.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertDIns extends InstructionDefinition { + + public ConvertDIns() { + super(0x75, "convert_d", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object value = lda.operandStack.pop(); + double ret = 0; + if (value == null) { + ret = 0; + } else if (value instanceof Boolean) { + if (((Boolean) value).booleanValue()) { + ret = 1; + } else { + ret = 0; + } + } else if (value instanceof Long) { + ret = ((Long) value).longValue(); + } else if (value instanceof Double) { + ret = ((Double) value).doubleValue(); + } else if (value instanceof String) { + ret = Double.parseDouble((String) value); + } else { + ret = 1; //must call toPrimitive + } + lda.operandStack.push(new Double(ret)); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "double")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java new file mode 100644 index 000000000..46f916475 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertIIns.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertIIns extends InstructionDefinition { + + public ConvertIIns() { + super(0x73, "convert_i", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object value = lda.operandStack.pop(); + long ret = 0; + if (value == null) { + ret = 0; + } else if (value instanceof Boolean) { + if (((Boolean) value).booleanValue()) { + ret = 1; + } else { + ret = 0; + } + } else if (value instanceof Long) { + ret = ((Long) value).longValue(); + } else if (value instanceof String) { + ret = Long.parseLong((String) value); + } else { + ret = 1; //must call toPrimitive + } + lda.operandStack.push(new Long(ret)); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "int")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertOIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertOIns.java new file mode 100644 index 000000000..1fc873cd8 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertOIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertOIns extends InstructionDefinition { + + public ConvertOIns() { + super(0x77, "convert_o", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + //throw if pop is not object + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "Object")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertSIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertSIns.java new file mode 100644 index 000000000..fb4ccc6d5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertSIns.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertSIns extends InstructionDefinition { + + public ConvertSIns() { + super(0x70, "convert_s", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + Object obj = lda.operandStack.pop(); + lda.operandStack.push(obj.toString()); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "string")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertUIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertUIns.java new file mode 100644 index 000000000..4e368a92a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/ConvertUIns.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.ConvertTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class ConvertUIns extends InstructionDefinition { + + public ConvertUIns() { + super(0x74, "convert_u", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + throw new UnsupportedOperationException("Cannot convert to uint "); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), "uint")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/InstanceOfIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/InstanceOfIns.java new file mode 100644 index 000000000..8b035c971 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/InstanceOfIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.InstanceOfTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class InstanceOfIns extends InstructionDefinition { + + public InstanceOfIns() { + super(0xb1, "instanceof", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem type = (TreeItem) stack.pop(); + TreeItem value = (TreeItem) stack.pop(); + stack.push(new InstanceOfTreeItem(ins, value, type)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeIns.java new file mode 100644 index 000000000..d676f103c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeIns.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.IsTypeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IsTypeIns extends InstructionDefinition { + + public IsTypeIns() { + super(0xb2, "istype", new int[]{AVM2Code.DAT_MULTINAME_INDEX}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + int multinameIndex = ins.operands[0]; + TreeItem value = (TreeItem) stack.pop(); + stack.push(new IsTypeTreeItem(ins, value, new FullMultinameTreeItem(ins, multinameIndex))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeLateIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeLateIns.java new file mode 100644 index 000000000..3ea630b4b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/IsTypeLateIns.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.IsTypeTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class IsTypeLateIns extends InstructionDefinition { + + public IsTypeLateIns() { + super(0xb3, "istypelate", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem type = (TreeItem) stack.pop(); + TreeItem value = (TreeItem) stack.pop(); + stack.push(new IsTypeTreeItem(ins, value, type)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/TypeOfIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/TypeOfIns.java new file mode 100644 index 000000000..705461ea9 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/types/TypeOfIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.operations.TypeOfTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class TypeOfIns extends InstructionDefinition { + + public TypeOfIns() { + super(0x95, "typeof", new int[]{}); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new TypeOfTreeItem(ins, (TreeItem) stack.pop())); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/CheckFilterIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/CheckFilterIns.java new file mode 100644 index 000000000..9bdbbaf36 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/CheckFilterIns.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.xml; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class CheckFilterIns extends InstructionDefinition { + + public CheckFilterIns() { + super(0x78, "checkfilter", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + //if pop() is not XML|XMLList throw + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSIns.java new file mode 100644 index 000000000..c29613072 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSIns.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.xml; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + +import java.util.List; + + +public class DXNSIns extends InstructionDefinition { + + public DXNSIns() { + super(0x06, "dxns", new int[]{AVM2Code.DAT_STRING_INDEX}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + int strIndex = (int) ((Long) arguments.get(0)).longValue(); + String s = constants.constant_string[strIndex]; + System.out.println("Set default XML space " + s); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSLateIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSLateIns.java new file mode 100644 index 000000000..b6534b1ca --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/DXNSLateIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.xml; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.UnparsedTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class DXNSLateIns extends InstructionDefinition { + + public DXNSLateIns() { + super(0x07, "dxnslate", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + String s = lda.operandStack.pop().toString(); + System.out.println("Set default XML space " + s); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + TreeItem xmlns = stack.pop(); + stack.push(new UnparsedTreeItem(ins, "XMLNS:" + xmlns.toString(constants))); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXAttrIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXAttrIns.java new file mode 100644 index 000000000..3a0d59f43 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXAttrIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.xml; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.UnparsedTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class EscXAttrIns extends InstructionDefinition { + + public EscXAttrIns() { + super(0x72, "esc_xattr", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + String s = lda.operandStack.pop().toString(); + //escape + lda.operandStack.push(s); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new UnparsedTreeItem(ins, "esc_xattr(" + stack.pop().toString(constants) + ")")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXElemIns.java b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXElemIns.java new file mode 100644 index 000000000..c5b9eae34 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/instructions/xml/EscXElemIns.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.instructions.xml; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.LocalDataArea; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.UnparsedTreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; + +import java.util.List; +import java.util.Stack; + + +public class EscXElemIns extends InstructionDefinition { + + public EscXElemIns() { + super(0x71, "esc_xelem", new int[]{}); + } + + @Override + public void execute(LocalDataArea lda, ConstantPool constants, List arguments) { + String s = lda.operandStack.pop().toString(); + //escape + lda.operandStack.push(s); + } + + @Override + public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) { + stack.push(new UnparsedTreeItem(ins, "esc_xelem(" + stack.pop().toString(constants) + ")")); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java new file mode 100644 index 000000000..dfc8c7a7b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ASM3Parser.java @@ -0,0 +1,443 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.parser; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + + +public class ASM3Parser { + + private static class OffsetItem { + + public String label = ""; + public long insPosition; + public int insOperandIndex; + + public OffsetItem(String label, long insOffset, int insOperandIndex) { + this.label = label; + this.insPosition = insOffset; + this.insOperandIndex = insOperandIndex; + } + } + + private static class CaseOffsetItem extends OffsetItem { + + public CaseOffsetItem(String label, long insOffset, int insOperandIndex) { + super(label, insOffset, insOperandIndex); + } + } + + private static class LabelItem { + + public String label = ""; + public int offset; + + public LabelItem(String label, int offset) { + this.label = label; + this.offset = offset; + } + } + + public static AVM2Code parse(InputStream is, ConstantPool constants) throws IOException, ParseException { + return parse(is, constants, null); + } + + public static AVM2Code parse(InputStream is, ConstantPool constants, MissingSymbolHandler missingHandler) throws IOException, ParseException { + AVM2Code code = new AVM2Code(); + + List offsetItems = new ArrayList(); + List labelItems = new ArrayList(); + int offset = 0; + + Flasm3Lexer lexer = new Flasm3Lexer(is); + + ParsedSymbol symb; + AVM2Instruction lastIns = null; + do { + symb = lexer.yylex(); + if (symb.type == ParsedSymbol.TYPE_EOF) break; + if (symb.type == ParsedSymbol.TYPE_COMMENT) { + if (lastIns != null) { + lastIns.comment = (String) symb.value; + } + continue; + } + if (symb.type == ParsedSymbol.TYPE_INSTRUCTION_NAME) { + boolean insFound = false; + for (InstructionDefinition def : AVM2Code.instructionSet) { + if (def.instructionName.equals((String) symb.value)) { + insFound = true; + List operandsList = new ArrayList(); + + for (int i = 0; i < def.operands.length; i++) { + ParsedSymbol parsedOperand = lexer.yylex(); + switch (def.operands[i]) { + case AVM2Code.DAT_MULTINAME_INDEX: + if (parsedOperand.type == ParsedSymbol.TYPE_MULTINAME) { + operandsList.add((int) (long) (Long) parsedOperand.value); + } else { + throw new ParseException("Multiname expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_STRING_INDEX: + if (parsedOperand.type == ParsedSymbol.TYPE_STRING) { + int sid = constants.getStringId((String) parsedOperand.value); + if (sid == 0) { + if ((missingHandler != null) && (missingHandler.missingString((String) parsedOperand.value))) { + sid = constants.addString((String) parsedOperand.value); + } else { + throw new ParseException("Unknown String", lexer.yyline()); + } + } + operandsList.add(sid); + } else { + throw new ParseException("String expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_INT_INDEX: + + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + long intVal = (Long) parsedOperand.value; + int iid = constants.getIntId(intVal); + if (iid == 0) { + if ((missingHandler != null) && (missingHandler.missingInt(intVal))) { + iid = constants.addInt(intVal); + } else { + throw new ParseException("Unknown int", lexer.yyline()); + } + } + operandsList.add(iid); + } else { + throw new ParseException("Integer expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_UINT_INDEX: + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + long intVal = (Long) parsedOperand.value; + int iid = constants.getUIntId(intVal); + if (iid == 0) { + if ((missingHandler != null) && (missingHandler.missingUInt(intVal))) { + iid = constants.addUInt(intVal); + } else { + throw new ParseException("Unknown uint", lexer.yyline()); + } + } + operandsList.add(iid); + } else { + throw new ParseException("Integer expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_DOUBLE_INDEX: + if ((parsedOperand.type == ParsedSymbol.TYPE_INTEGER) || (parsedOperand.type == ParsedSymbol.TYPE_FLOAT)) { + + double doubleVal = 0; + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) + doubleVal = (Long) parsedOperand.value; + if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) + doubleVal = (Double) parsedOperand.value; + int did = constants.getDoubleId(doubleVal); + if (did == 0) { + if ((missingHandler != null) && (missingHandler.missingDouble(doubleVal))) { + did = constants.addDouble(doubleVal); + } else { + throw new ParseException("Unknown double", lexer.yyline()); + } + } + operandsList.add(did); + } else { + throw new ParseException("Float value expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_OFFSET: + if (parsedOperand.type == ParsedSymbol.TYPE_IDENTIFIER) { + offsetItems.add(new OffsetItem((String) parsedOperand.value, code.code.size(), i)); + operandsList.add(0); + } else { + throw new ParseException("Offset expected", lexer.yyline()); + } + break; + case AVM2Code.DAT_CASE_BASEOFFSET: + if (parsedOperand.type == ParsedSymbol.TYPE_IDENTIFIER) { + offsetItems.add(new CaseOffsetItem((String) parsedOperand.value, code.code.size(), i)); + operandsList.add(0); + } else { + throw new ParseException("Offset expected", lexer.yyline()); + } + break; + case AVM2Code.OPT_CASE_OFFSETS: + + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + int patCount = (int) (long) (Long) parsedOperand.value; + operandsList.add(patCount); + + for (int c = 0; c <= patCount; c++) { + parsedOperand = lexer.yylex(); + if (parsedOperand.type == ParsedSymbol.TYPE_IDENTIFIER) { + offsetItems.add(new CaseOffsetItem((String) parsedOperand.value, code.code.size(), i + (c + 1))); + operandsList.add(0); + } else { + throw new ParseException("Offset expected", lexer.yyline()); + } + } + } else { + throw new ParseException("Case count expected", lexer.yyline()); + } + break; + default: + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + operandsList.add((int) (long) (Long) parsedOperand.value); + } else { + throw new ParseException("Integer expected", lexer.yyline()); + } + } + } + + int operands[] = new int[operandsList.size()]; + for (int i = 0; i < operandsList.size(); i++) { + operands[i] = operandsList.get(i); + } + lastIns = new AVM2Instruction(offset, def, operands, new byte[0]); + code.code.add(lastIns); + offset += lastIns.getBytes().length; + break; + } + } + if (!insFound) { + throw new ParseException("Invalid instruction name:" + (String) symb.value, lexer.yyline()); + } + } else if (symb.type == ParsedSymbol.TYPE_LABEL) { + labelItems.add(new LabelItem((String) symb.value, offset)); + + } else { + throw new ParseException("Unexpected symbol", lexer.yyline()); + } + } while (symb.type != ParsedSymbol.TYPE_EOF); + + for (OffsetItem oi : offsetItems) { + for (LabelItem li : labelItems) { + if (oi.label.equals(li.label)) { + AVM2Instruction ins = code.code.get((int) oi.insPosition); + int relOffset = 0; + if (oi instanceof CaseOffsetItem) { + relOffset = li.offset - (int) ins.offset; + } else { + relOffset = li.offset - ((int) ins.offset + ins.getBytes().length); + } + ins.operands[oi.insOperandIndex] = relOffset; + } + } + } + + /* BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String s = ""; + Pattern patInsName = Pattern.compile("^([a-z0-9_]+) "); + Pattern patLabelName = Pattern.compile("^([a-zA-Z_0-9]+): "); + Pattern patInt = Pattern.compile("^([+-]?[0-9]+) "); + Pattern patDouble = Pattern.compile("^([+-]?[0-9e.]+) "); + Pattern patMultiname = Pattern.compile("^m\\[([0-9]+)\\]\"[^\"]*\" "); + Pattern patString = Pattern.compile("\"([^\"]*)\" "); + Pattern patofs = Pattern.compile("^([a-zA-Z_0-9]+) "); + + + long line = 0; + + while ((s = br.readLine()) != null) { + line++; + s += " "; + Matcher m = patInsName.matcher(s); + if (m.find()) { + String insName = m.group(1); + boolean insFound = false; + for (InstructionDefinition def : AVM2Code.instructionSet) { + if (def.instructionName.equals(insName)) { + insFound = true; + s = s.substring(insName.length() + 1); + List operandsList = new ArrayList(); + + for (int i = 0; i < def.operands.length; i++) { + switch (def.operands[i]) { + case AVM2Code.DAT_MULTINAME_INDEX: + m = patMultiname.matcher(s); + if (m.find()) { + operandsList.add(Integer.parseInt(m.group(1))); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid multiname", line); + } + break; + case AVM2Code.DAT_STRING_INDEX: + m = patString.matcher(s); + if (m.find()) { + String str = m.group(1); + int sid = constants.getStringId(str); + if (sid == 0) { + if((missingHandler!=null)&&(missingHandler.missingString(str))){ + sid=constants.addString(str); + }else{ + throw new ParseException("Unknown String", line); + } + } + operandsList.add(sid); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid String", line); + } + break; + case AVM2Code.DAT_INT_INDEX: + m = patInt.matcher(s); + if (m.find()) { + long intVal=Integer.parseInt(m.group(1)); + int iid = constants.getIntId(intVal); + if (iid == 0) { + if((missingHandler!=null)&&(missingHandler.missingInt(intVal))){ + iid=constants.addInt(intVal); + }else{ + throw new ParseException("Unknown int", line); + } + } + operandsList.add(iid); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid int value", line); + } + break; + case AVM2Code.DAT_UINT_INDEX: + m = patInt.matcher(s); + if (m.find()) { + long intVal=Integer.parseInt(m.group(1)); + int iid = constants.getUIntId(intVal); + if (iid == 0) { + if((missingHandler!=null)&&(missingHandler.missingUInt(intVal))){ + iid=constants.addUInt(intVal); + }else{ + throw new ParseException("Unknown uint", line); + } + } + operandsList.add(iid); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid uint value", line); + } + break; + case AVM2Code.DAT_DOUBLE_INDEX: + m = patDouble.matcher(s); + if (m.find()) { + double doubleVal=Double.parseDouble(m.group(1)); + int did = constants.getDoubleId(doubleVal); + if (did == 0) { + if((missingHandler!=null)&&(missingHandler.missingDouble(doubleVal))){ + did=constants.addDouble(doubleVal); + }else{ + throw new ParseException("Unknown double", line); + } + } + operandsList.add(did); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid double value", line); + } + break; + case AVM2Code.DAT_OFFSET: + m = patofs.matcher(s); + if (m.find()) { + offsetItems.add(new OffsetItem(m.group(1), code.code.size(), i)); + operandsList.add(0); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid offset value", line); + } + break; + case AVM2Code.DAT_CASE_BASEOFFSET: + m = patofs.matcher(s); + if (m.find()) { + offsetItems.add(new CaseOffsetItem(m.group(1), code.code.size(), i)); + operandsList.add(0); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid offset value", line); + } + break; + case AVM2Code.OPT_CASE_OFFSETS: + m = patInt.matcher(s); + if (m.find()) { + int patCount = Integer.parseInt(m.group(1)); + operandsList.add(patCount); + s = s.substring(m.group(0).length()); + m = patofs.matcher(s); + int k = 1; + for (int c = 0; c <= patCount; c++) { + if (m.find()) { + offsetItems.add(new CaseOffsetItem(m.group(1), code.code.size(), i + k)); + operandsList.add(0); + s = s.substring(m.group(0).length()); + m = patofs.matcher(s); + k++; + } else { + throw new ParseException("Invalid case count", line); + } + } + } else { + throw new ParseException("Invalid case count", line); + } + break; + default: + m = patInt.matcher(s); + if (m.find()) { + operandsList.add(Integer.parseInt(m.group(1))); + s = s.substring(m.group(0).length()); + } else { + throw new ParseException("Invalid value", line); + } + } + } + + int operands[] = new int[operandsList.size()]; + for (int i = 0; i < operandsList.size(); i++) { + operands[i] = operandsList.get(i); + } + AVM2Instruction ins = new AVM2Instruction(offset, def, operands, new byte[0]); + code.code.add(ins); + offset += ins.getBytes().length; + break; + } + } + if (!insFound) { + throw new ParseException("Invalid instruction name:" + insName, line); + } + } else { + m = patLabelName.matcher(s); + if (m.find()) { + labelItems.add(new LabelItem(m.group(1), offset)); + } else { + throw new ParseException("Invalid instruction name", line); + } + } + } + + for (OffsetItem oi : offsetItems) { + for (LabelItem li : labelItems) { + if (oi.label.equals(li.label)) { + AVM2Instruction ins = code.code.get((int) oi.insPosition); + int relOffset = 0; + if (oi instanceof CaseOffsetItem) { + relOffset = li.offset - (int) ins.offset; + } else { + relOffset = li.offset - ((int) ins.offset + ins.getBytes().length); + } + ins.operands[oi.insOperandIndex] = relOffset; + } + } + }*/ + return code; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/Flasm3Lexer.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/Flasm3Lexer.java new file mode 100644 index 000000000..26cec68fd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/Flasm3Lexer.java @@ -0,0 +1,890 @@ +/* The following code was generated by JFlex 1.4.3 on 18.8.10 12:17 */ + +/* Flash assembler language lexer specification */ + +package com.jpexs.asdec.abc.avm2.parser; + + +/** + * This class is a scanner generated by + * JFlex 1.4.3 + * on 18.8.10 12:17 from the specification file + * D:/Dokumenty/Programovani/JavaSE/ASDec/trunk/src/com/jpexs/asdec/abc/avm2/parser/flasm3.flex + */ +public final class Flasm3Lexer { + + /** + * This character denotes the end of file + */ + public static final int YYEOF = -1; + + /** + * initial size of the lookahead buffer + */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** + * lexical states + */ + public static final int STRING = 2; + public static final int YYINITIAL = 0; + public static final int PARAMETERS = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + */ + private static final String ZZ_CMAP_PACKED = + "\11\12\1\4\1\2\1\0\1\4\1\1\16\12\4\0\1\4\1\0" + + "\1\26\1\0\1\11\2\0\1\34\3\0\1\23\1\0\1\17\1\20" + + "\1\0\1\16\3\35\4\24\2\7\1\15\1\3\5\0\4\11\1\21" + + "\25\11\1\6\1\25\1\10\1\0\1\14\1\0\1\13\1\27\2\13" + + "\1\22\1\32\6\13\1\5\1\31\3\13\1\33\1\13\1\30\6\13" + + "\4\0\41\12\2\0\4\11\4\0\1\11\2\0\1\12\7\0\1\11" + + "\4\0\1\11\5\0\27\11\1\0\37\11\1\0\u013f\11\31\0\162\11" + + "\4\0\14\11\16\0\5\11\11\0\1\11\21\0\130\12\5\0\23\12" + + "\12\0\1\11\13\0\1\11\1\0\3\11\1\0\1\11\1\0\24\11" + + "\1\0\54\11\1\0\46\11\1\0\5\11\4\0\202\11\1\0\4\12" + + "\3\0\105\11\1\0\46\11\2\0\2\11\6\0\20\11\41\0\46\11" + + "\2\0\1\11\7\0\47\11\11\0\21\12\1\0\27\12\1\0\3\12" + + "\1\0\1\12\1\0\2\12\1\0\1\12\13\0\33\11\5\0\3\11" + + "\15\0\4\12\14\0\6\12\13\0\32\11\5\0\13\11\16\12\7\0" + + "\12\12\4\0\2\11\1\12\143\11\1\0\1\11\10\12\1\0\6\12" + + "\2\11\2\12\1\0\4\12\2\11\12\12\3\11\2\0\1\11\17\0" + + "\1\12\1\11\1\12\36\11\33\12\2\0\3\11\60\0\46\11\13\12" + + "\1\11\u014f\0\3\12\66\11\2\0\1\12\1\11\20\12\2\0\1\11" + + "\4\12\3\0\12\11\2\12\2\0\12\12\21\0\3\12\1\0\10\11" + + "\2\0\2\11\2\0\26\11\1\0\7\11\1\0\1\11\3\0\4\11" + + "\2\0\1\12\1\11\7\12\2\0\2\12\2\0\3\12\11\0\1\12" + + "\4\0\2\11\1\0\3\11\2\12\2\0\12\12\4\11\15\0\3\12" + + "\1\0\6\11\4\0\2\11\2\0\26\11\1\0\7\11\1\0\2\11" + + "\1\0\2\11\1\0\2\11\2\0\1\12\1\0\5\12\4\0\2\12" + + "\2\0\3\12\13\0\4\11\1\0\1\11\7\0\14\12\3\11\14\0" + + "\3\12\1\0\11\11\1\0\3\11\1\0\26\11\1\0\7\11\1\0" + + "\2\11\1\0\5\11\2\0\1\12\1\11\10\12\1\0\3\12\1\0" + + "\3\12\2\0\1\11\17\0\2\11\2\12\2\0\12\12\1\0\1\11" + + "\17\0\3\12\1\0\10\11\2\0\2\11\2\0\26\11\1\0\7\11" + + "\1\0\2\11\1\0\5\11\2\0\1\12\1\11\6\12\3\0\2\12" + + "\2\0\3\12\10\0\2\12\4\0\2\11\1\0\3\11\4\0\12\12" + + "\1\0\1\11\20\0\1\12\1\11\1\0\6\11\3\0\3\11\1\0" + + "\4\11\3\0\2\11\1\0\1\11\1\0\2\11\3\0\2\11\3\0" + + "\3\11\3\0\10\11\1\0\3\11\4\0\5\12\3\0\3\12\1\0" + + "\4\12\11\0\1\12\17\0\11\12\11\0\1\11\7\0\3\12\1\0" + + "\10\11\1\0\3\11\1\0\27\11\1\0\12\11\1\0\5\11\4\0" + + "\7\12\1\0\3\12\1\0\4\12\7\0\2\12\11\0\2\11\4\0" + + "\12\12\22\0\2\12\1\0\10\11\1\0\3\11\1\0\27\11\1\0" + + "\12\11\1\0\5\11\2\0\1\12\1\11\7\12\1\0\3\12\1\0" + + "\4\12\7\0\2\12\7\0\1\11\1\0\2\11\4\0\12\12\22\0" + + "\2\12\1\0\10\11\1\0\3\11\1\0\27\11\1\0\20\11\4\0" + + "\6\12\2\0\3\12\1\0\4\12\11\0\1\12\10\0\2\11\4\0" + + "\12\12\22\0\2\12\1\0\22\11\3\0\30\11\1\0\11\11\1\0" + + "\1\11\2\0\7\11\3\0\1\12\4\0\6\12\1\0\1\12\1\0" + + "\10\12\22\0\2\12\15\0\60\11\1\12\2\11\7\12\4\0\10\11" + + "\10\12\1\0\12\12\47\0\2\11\1\0\1\11\2\0\2\11\1\0" + + "\1\11\2\0\1\11\6\0\4\11\1\0\7\11\1\0\3\11\1\0" + + "\1\11\1\0\1\11\2\0\2\11\1\0\4\11\1\12\2\11\6\12" + + "\1\0\2\12\1\11\2\0\5\11\1\0\1\11\1\0\6\12\2\0" + + "\12\12\2\0\2\11\42\0\1\11\27\0\2\12\6\0\12\12\13\0" + + "\1\12\1\0\1\12\1\0\1\12\4\0\2\12\10\11\1\0\42\11" + + "\6\0\24\12\1\0\2\12\4\11\4\0\10\12\1\0\44\12\11\0" + + "\1\12\71\0\42\11\1\0\5\11\1\0\2\11\1\0\7\12\3\0" + + "\4\12\6\0\12\12\6\0\6\11\4\12\106\0\46\11\12\0\51\11" + + "\7\0\132\11\5\0\104\11\5\0\122\11\6\0\7\11\1\0\77\11" + + "\1\0\1\11\1\0\4\11\2\0\7\11\1\0\1\11\1\0\4\11" + + "\2\0\47\11\1\0\1\11\1\0\4\11\2\0\37\11\1\0\1\11" + + "\1\0\4\11\2\0\7\11\1\0\1\11\1\0\4\11\2\0\7\11" + + "\1\0\7\11\1\0\27\11\1\0\37\11\1\0\1\11\1\0\4\11" + + "\2\0\7\11\1\0\47\11\1\0\23\11\16\0\11\12\56\0\125\11" + + "\14\0\u026c\11\2\0\10\11\12\0\32\11\5\0\113\11\3\0\3\11" + + "\17\0\15\11\1\0\4\11\3\12\13\0\22\11\3\12\13\0\22\11" + + "\2\12\14\0\15\11\1\0\3\11\1\0\2\12\14\0\64\11\40\12" + + "\3\0\1\11\3\0\2\11\1\12\2\0\12\12\41\0\3\12\2\0" + + "\12\12\6\0\130\11\10\0\51\11\1\12\126\0\35\11\3\0\14\12" + + "\4\0\14\12\12\0\12\12\36\11\2\0\5\11\u038b\0\154\11\224\0" + + "\234\11\4\0\132\11\6\0\26\11\2\0\6\11\2\0\46\11\2\0" + + "\6\11\2\0\10\11\1\0\1\11\1\0\1\11\1\0\1\11\1\0" + + "\37\11\2\0\65\11\1\0\7\11\1\0\1\11\3\0\3\11\1\0" + + "\7\11\3\0\4\11\2\0\6\11\4\0\15\11\5\0\3\11\1\0" + + "\7\11\17\0\4\12\32\0\5\12\20\0\2\11\23\0\1\11\13\0" + + "\4\12\6\0\6\12\1\0\1\11\15\0\1\11\40\0\22\11\36\0" + + "\15\12\4\0\1\12\3\0\6\12\27\0\1\11\4\0\1\11\2\0" + + "\12\11\1\0\1\11\3\0\5\11\6\0\1\11\1\0\1\11\1\0" + + "\1\11\1\0\4\11\1\0\3\11\1\0\7\11\3\0\3\11\5\0" + + "\5\11\26\0\44\11\u0e81\0\3\11\31\0\11\11\6\12\1\0\5\11" + + "\2\0\5\11\4\0\126\11\2\0\2\12\2\0\3\11\1\0\137\11" + + "\5\0\50\11\4\0\136\11\21\0\30\11\70\0\20\11\u0200\0\u19b6\11" + + "\112\0\u51a6\11\132\0\u048d\11\u0773\0\u2ba4\11\u215c\0\u012e\11\2\0\73\11" + + "\225\0\7\11\14\0\5\11\5\0\1\11\1\12\12\11\1\0\15\11" + + "\1\0\5\11\1\0\1\11\1\0\2\11\1\0\2\11\1\0\154\11" + + "\41\0\u016b\11\22\0\100\11\2\0\66\11\50\0\15\11\3\0\20\12" + + "\20\0\4\12\17\0\2\11\30\0\3\11\31\0\1\11\6\0\5\11" + + "\1\0\207\11\2\0\1\12\4\0\1\11\13\0\12\12\7\0\32\11" + + "\4\0\1\11\1\0\32\11\12\0\132\11\3\0\6\11\2\0\6\11" + + "\2\0\6\11\2\0\3\11\3\0\2\11\3\0\2\11\22\0\3\12" + + "\4\0"; + + /** + * Translates characters to character classes + */ + private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + + /** + * Translates DFA states to action switch labels. + */ + private static final int[] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\2\1\1\2\1\1\1\3\2\4\1\1\1\5" + + "\2\6\1\7\1\10\1\11\1\10\1\11\2\1\1\12" + + "\1\0\1\13\1\14\2\15\1\16\1\17\1\20\1\21" + + "\1\22\1\23\1\24\1\25\1\0\1\26\1\0\1\26" + + "\1\0\1\15\1\0\1\26\2\0\1\27"; + + private static int[] zzUnpackAction() { + int[] result = new int[46]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\36\0\74\0\132\0\170\0\226\0\264\0\322" + + "\0\360\0\132\0\u010e\0\132\0\u012c\0\132\0\u014a\0\u0168" + + "\0\u0186\0\u01a4\0\u01c2\0\u01e0\0\u01fe\0\132\0\264\0\132" + + "\0\132\0\u021c\0\u023a\0\132\0\132\0\132\0\132\0\132" + + "\0\132\0\132\0\132\0\u0258\0\u0276\0\u0294\0\u01c2\0\u01fe" + + "\0\132\0\u02b2\0\u02d0\0\u02d0\0\u02ee\0\132"; + + private static int[] zzUnpackRowMap() { + int[] result = new int[46]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int[] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\4\4\1\5\1\6\3\4\1\7\1\4\1\6\1\7" + + "\4\4\1\7\1\6\4\4\5\6\2\4\1\10\1\11" + + "\1\12\22\10\1\13\1\14\7\10\1\4\1\15\1\16" + + "\1\17\1\4\1\20\1\4\1\21\1\4\1\22\1\4" + + "\2\22\1\4\1\23\1\24\1\25\2\22\1\4\1\21" + + "\1\4\1\26\5\22\1\4\1\21\42\0\1\5\36\0" + + "\1\6\1\0\1\6\1\0\2\27\2\6\1\30\1\6" + + "\2\0\1\27\1\6\1\0\1\6\2\0\5\6\1\0" + + "\1\6\5\0\1\27\1\0\1\27\1\0\4\27\1\30" + + "\1\27\2\0\2\27\1\0\1\27\2\0\5\27\1\0" + + "\1\27\1\10\2\0\22\10\2\0\7\10\2\0\1\12" + + "\33\0\2\31\1\0\13\31\1\32\5\31\1\33\1\34" + + "\1\35\1\36\1\37\1\40\1\41\1\42\1\43\1\32" + + "\2\0\1\16\33\0\1\17\2\0\33\17\5\0\1\22" + + "\1\44\1\22\1\0\4\22\1\0\1\22\2\0\2\22" + + "\1\0\1\22\2\0\5\22\1\0\1\22\7\0\1\21" + + "\6\0\1\21\1\0\1\45\2\46\1\0\1\21\10\0" + + "\1\21\5\0\1\22\1\0\1\22\1\0\4\22\1\0" + + "\1\22\2\0\2\22\1\0\1\22\2\0\5\22\1\0" + + "\1\22\7\0\1\47\6\0\1\47\1\0\1\45\2\46" + + "\1\0\1\47\10\0\1\47\7\0\1\21\6\0\1\47" + + "\1\0\1\50\3\0\1\21\10\0\1\21\7\0\1\45" + + "\6\0\1\45\5\0\1\45\10\0\1\45\16\0\1\33" + + "\5\0\1\33\10\0\1\33\16\0\1\51\5\0\1\51" + + "\10\0\1\51\7\0\1\52\6\0\1\52\5\0\1\52" + + "\10\0\1\52\7\0\1\45\6\0\1\45\2\0\2\46" + + "\1\0\1\45\10\0\1\45\7\0\1\53\6\0\1\53" + + "\1\54\3\0\1\54\1\53\10\0\1\53\7\0\1\52" + + "\1\55\5\0\1\52\5\0\1\52\10\0\1\52\7\0" + + "\1\53\6\0\1\53\5\0\1\53\10\0\1\53\26\0" + + "\1\56\7\0"; + + private static int[] zzUnpackTrans() { + int[] result = new int[780]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { + "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\1\11\5\1\1\11\1\1\1\11\1\1\1\11" + + "\7\1\1\11\1\0\2\11\2\1\10\11\1\0\1\1" + + "\1\0\1\1\1\0\1\11\1\0\1\1\2\0\1\11"; + + private static int[] zzUnpackAttribute() { + int[] result = new int[46]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int[] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** + * the input device + */ + private java.io.Reader zzReader; + + /** + * the current state of the DFA + */ + private int zzState; + + /** + * the current lexical state + */ + private int zzLexicalState = YYINITIAL; + + /** + * this buffer contains the current text to be matched and is + * the source of the yytext() string + */ + private char zzBuffer[] = new char[ZZ_BUFFERSIZE]; + + /** + * the textposition at the last accepting state + */ + private int zzMarkedPos; + + /** + * the current text position in the buffer + */ + private int zzCurrentPos; + + /** + * startRead marks the beginning of the yytext() string in the buffer + */ + private int zzStartRead; + + /** + * endRead marks the last character in the buffer, that has been read + * from input + */ + private int zzEndRead; + + /** + * number of newlines encountered up to the start of the matched text + */ + private int yyline; + + /** + * the number of characters up to the start of the matched text + */ + private int yychar; + + /** + * the number of characters from the last newline up to the start of the + * matched text + */ + private int yycolumn; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** + * zzAtEOF == true <=> the scanner is at the EOF + */ + private boolean zzAtEOF; + + /** + * denotes if the user-EOF-code has already been executed + */ + private boolean zzEOFDone; + + /* user code: */ + + StringBuffer string = new StringBuffer(); + boolean isMultiname = false; + long multinameId = 0; + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public Flasm3Lexer() { + + } + + public int yychar() { + return yychar; + } + + public int yyline() { + return yyline + 1; + } + + + /** + * Creates a new scanner + * There is also a java.io.InputStream version of this constructor. + * + * @param in the java.io.Reader to read input from. + */ + public Flasm3Lexer(java.io.Reader in) { + this.zzReader = in; + } + + /** + * Creates a new scanner. + * There is also java.io.Reader version of this constructor. + * + * @param in the java.io.Inputstream to read input from. + */ + public Flasm3Lexer(java.io.InputStream in) { + this(new java.io.InputStreamReader(in)); + } + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char[] zzUnpackCMap(String packed) { + char[] map = new char[0x10000]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < 1722) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * @throws java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + + /* first: make room (if you can) */ + if (zzStartRead > 0) { + System.arraycopy(zzBuffer, zzStartRead, + zzBuffer, 0, + zzEndRead - zzStartRead); + + /* translate stored positions */ + zzEndRead -= zzStartRead; + zzCurrentPos -= zzStartRead; + zzMarkedPos -= zzStartRead; + zzStartRead = 0; + } + + /* is the buffer big enough? */ + if (zzCurrentPos >= zzBuffer.length) { + /* if not: blow it up */ + char newBuffer[] = new char[zzCurrentPos * 2]; + System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); + zzBuffer = newBuffer; + } + + /* finally: fill the buffer with new input */ + int numRead = zzReader.read(zzBuffer, zzEndRead, + zzBuffer.length - zzEndRead); + + if (numRead > 0) { + zzEndRead += numRead; + return false; + } + // unlikely but not impossible: read 0 characters, but not at end of stream + if (numRead == 0) { + int c = zzReader.read(); + if (c == -1) { + return true; + } else { + zzBuffer[zzEndRead++] = (char) c; + return false; + } + } + + // numRead < 0 + return true; + } + + + /** + * Closes the input stream. + */ + public final void yyclose() throws java.io.IOException { + zzAtEOF = true; /* indicate end of file */ + zzEndRead = zzStartRead; /* invalidate buffer */ + + if (zzReader != null) + zzReader.close(); + } + + + /** + * Resets the scanner to read from a new input stream. + * Does not close the old reader. + *

    + * All internal variables are reset, the old input stream + * cannot be reused (internal buffer is discarded and lost). + * Lexical state is set to ZZ_INITIAL. + * + * @param reader the new input stream + */ + public final void yyreset(java.io.Reader reader) { + zzReader = reader; + zzAtBOL = true; + zzAtEOF = false; + zzEOFDone = false; + zzEndRead = zzStartRead = 0; + zzCurrentPos = zzMarkedPos = 0; + yyline = yychar = yycolumn = 0; + zzLexicalState = YYINITIAL; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final String yytext() { + return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead); + } + + + /** + * Returns the character at position pos from the + * matched text. + *

    + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer[zzStartRead + pos]; + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos - zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + *

    + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + *

    + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + *

    + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if (number > yylength()) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @throws java.io.IOException if any I/O-Error occurs + */ + public ParsedSymbol yylex() throws java.io.IOException, ParseException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + char[] zzBufferL = zzBuffer; + char[] zzCMapL = ZZ_CMAP; + + int[] zzTransL = ZZ_TRANS; + int[] zzRowMapL = ZZ_ROWMAP; + int[] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + yychar += zzMarkedPosL - zzStartRead; + + boolean zzR = false; + for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL; + zzCurrentPosL++) { + switch (zzBufferL[zzCurrentPosL]) { + case '\u000B': + case '\u000C': + case '\u0085': + case '\u2028': + case '\u2029': + yyline++; + yycolumn = 0; + zzR = false; + break; + case '\r': + yyline++; + yycolumn = 0; + zzR = true; + break; + case '\n': + if (zzR) + zzR = false; + else { + yyline++; + yycolumn = 0; + } + break; + default: + zzR = false; + yycolumn++; + } + } + + if (zzR) { + // peek one character ahead if it is \n (if we have counted one line too much) + boolean zzPeek; + if (zzMarkedPosL < zzEndReadL) + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + else if (zzAtEOF) + zzPeek = false; + else { + boolean eof = zzRefill(); + zzEndReadL = zzEndRead; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + if (eof) + zzPeek = false; + else + zzPeek = zzBufferL[zzMarkedPosL] == '\n'; + } + if (zzPeek) yyline--; + } + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + + zzForAction: + { + while (true) { + + if (zzCurrentPosL < zzEndReadL) + zzInput = zzBufferL[zzCurrentPosL++]; + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } else { + zzInput = zzBufferL[zzCurrentPosL++]; + } + } + int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + int zzAttributes = zzAttrL[zzState]; + if ((zzAttributes & 1) == 1) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ((zzAttributes & 8) == 8) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 8: { + return new ParsedSymbol(ParsedSymbol.TYPE_IDENTIFIER, yytext()); + } + case 24: + break; + case 21: { + string.append('\''); + } + case 25: + break; + case 9: { + return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER, new Long(Long.parseLong((yytext())))); + } + case 26: + break; + case 3: { + string.append(yytext()); + } + case 27: + break; + case 13: { + char val = (char) Integer.parseInt(yytext().substring(1), 8); + string.append(val); + } + case 28: + break; + case 5: { + yybegin(PARAMETERS); + // length also includes the trailing quote + if (isMultiname) { + return new ParsedSymbol(ParsedSymbol.TYPE_MULTINAME, new Long(multinameId)); + } else { + return new ParsedSymbol(ParsedSymbol.TYPE_STRING, string.toString()); + } + } + case 29: + break; + case 20: { + string.append('\r'); + } + case 30: + break; + case 6: { + yybegin(YYINITIAL); + } + case 31: + break; + case 2: { + yybegin(PARAMETERS); + return new ParsedSymbol(ParsedSymbol.TYPE_INSTRUCTION_NAME, yytext()); + } + case 32: + break; + case 7: { + return new ParsedSymbol(ParsedSymbol.TYPE_COMMENT, yytext().substring(1)); + } + case 33: + break; + case 11: { + String s = yytext(); + return new ParsedSymbol(ParsedSymbol.TYPE_LABEL, s.substring(0, s.length() - 1)); + } + case 34: + break; + case 16: { + string.append('\b'); + } + case 35: + break; + case 4: { + throw new ParseException("Unterminated string at end of line", yyline + 1); + } + case 36: + break; + case 10: { + isMultiname = false; + yybegin(STRING); + string.setLength(0); + } + case 37: + break; + case 17: { + string.append('\t'); + } + case 38: + break; + case 22: { + return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT, new Double(Double.parseDouble((yytext())))); + } + case 39: + break; + case 14: { + string.append('\\'); + } + case 40: + break; + case 12: { + throw new ParseException("Illegal escape sequence \"" + yytext() + "\"", yyline + 1); + } + case 41: + break; + case 23: { + isMultiname = true; + String s = yytext(); + multinameId = Long.parseLong(s.substring(2, s.length() - 2)); + yybegin(STRING); + string.setLength(0); + } + case 42: + break; + case 18: { + string.append('\n'); + } + case 43: + break; + case 19: { + string.append('\f'); + } + case 44: + break; + case 15: { + string.append('\"'); + } + case 45: + break; + case 1: { + } + case 46: + break; + default: + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + { + return new ParsedSymbol(ParsedSymbol.TYPE_EOF); + } + } else { + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/MissingSymbolHandler.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/MissingSymbolHandler.java new file mode 100644 index 000000000..96924d0e6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/MissingSymbolHandler.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.parser; + + +public interface MissingSymbolHandler { + public boolean missingString(String value); + + public boolean missingInt(long value); + + public boolean missingUInt(long value); + + public boolean missingDouble(double value); + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParseException.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParseException.java new file mode 100644 index 000000000..cb910267a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParseException.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.parser; + + +public class ParseException extends Exception { + public long line; + public String text; + + public ParseException(String text, long line) { + super("ParseException:" + text + " on line " + line); + this.line = line; + this.text = text; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParsedSymbol.java b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParsedSymbol.java new file mode 100644 index 000000000..88f98a0fa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/ParsedSymbol.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.parser; + + +public class ParsedSymbol { + public int type; + public Object value; + + public static final int TYPE_STRING = 1; + public static final int TYPE_MULTINAME = 2; + public static final int TYPE_INSTRUCTION_NAME = 3; + public static final int TYPE_INTEGER = 4; + public static final int TYPE_FLOAT = 5; + public static final int TYPE_IDENTIFIER = 6; + public static final int TYPE_EOF = 7; + public static final int TYPE_LABEL = 8; + public static final int TYPE_COMMENT = 9; + + public ParsedSymbol(int type, Object value) { + this.type = type; + this.value = value; + } + + public ParsedSymbol(int type) { + this.type = type; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/parser/flasm3.flex b/trunk/src/com/jpexs/asdec/abc/avm2/parser/flasm3.flex new file mode 100644 index 000000000..472b7357e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/parser/flasm3.flex @@ -0,0 +1,156 @@ +/* Flash assembler language lexer specification */ + +package com.jpexs.asdec.abc.avm2.parser; + +%% + +%public +%class Flasm3Lexer +%final +%unicode +%char +%line +%column +%type ParsedSymbol +%throws ParseException + +%{ + + StringBuffer string = new StringBuffer(); + boolean isMultiname=false; + long multinameId=0; + + + /** + * Create an empty lexer, yyrset will be called later to reset and assign + * the reader + */ + public Flasm3Lexer() { + + } + + public int yychar() { + return yychar; + } + + public int yyline() { + return yyline+1; + } + +%} + +/* main character classes */ +LineTerminator = \r|\n|\r\n + +InputCharacter = [^\r\n] +Comment = ";" {InputCharacter}* + +WhiteSpace = [ \t\f]+ + +Multiname = m\[[0-9]+\] + +/* identifiers */ + +Identifier = [:jletter:][:jletterdigit:]* + +InstructionName = [a-z][a-z0-9_]* + +Label = {Identifier}: + + + +/* integer literals */ +NumberLiteral = 0 | -?[1-9][0-9]* + +/* floating point literals */ +FloatLiteral = -?({FLit1}|{FLit2}|{FLit3}) {Exponent}? + +FLit1 = [0-9]+ \. [0-9]* +FLit2 = \. [0-9]+ +FLit3 = [0-9]+ +Exponent = [eE] [+-]? [0-9]+ + +OctDigit = [0-7] + +/* string and character literals */ +StringCharacter = [^\r\n\"\\] + +%state STRING,PARAMETERS + +%% + + { + + + /* whitespace */ + {WhiteSpace} { } + + {Label} { + String s=yytext(); + return new ParsedSymbol(ParsedSymbol.TYPE_LABEL,s.substring(0,s.length()-1)); + } + + /* identifiers */ + {InstructionName} { yybegin(PARAMETERS); + return new ParsedSymbol(ParsedSymbol.TYPE_INSTRUCTION_NAME,yytext()); + } +} + + { + /* string literal */ + \" { + isMultiname=false; + yybegin(STRING); + string.setLength(0); + } + {Multiname}\" { + isMultiname=true; + String s=yytext(); + multinameId=Long.parseLong(s.substring(2,s.length()-2)); + yybegin(STRING); + string.setLength(0); + } + + /* numeric literals */ + + {NumberLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_INTEGER,new Long(Long.parseLong((yytext())))); } + {FloatLiteral} { return new ParsedSymbol(ParsedSymbol.TYPE_FLOAT,new Double(Double.parseDouble((yytext())))); } + {Identifier} { return new ParsedSymbol(ParsedSymbol.TYPE_IDENTIFIER,yytext()); } + {LineTerminator} {yybegin(YYINITIAL);} + {Comment} {return new ParsedSymbol(ParsedSymbol.TYPE_COMMENT,yytext().substring(1));} +} + + { + \" { + yybegin(PARAMETERS); + // length also includes the trailing quote + if(isMultiname){ + return new ParsedSymbol(ParsedSymbol.TYPE_MULTINAME,new Long(multinameId)); + }else{ + return new ParsedSymbol(ParsedSymbol.TYPE_STRING,string.toString()); + } + } + + {StringCharacter}+ { string.append( yytext() ); } + + /* escape sequences */ + "\\b" { string.append( '\b' ); } + "\\t" { string.append( '\t' ); } + "\\n" { string.append( '\n' ); } + "\\f" { string.append( '\f' ); } + "\\r" { string.append( '\r' ); } + "\\\"" { string.append( '\"' ); } + "\\'" { string.append( '\'' ); } + "\\\\" { string.append( '\\' ); } + \\[0-3]?{OctDigit}?{OctDigit} { char val = (char) Integer.parseInt(yytext().substring(1),8); + string.append( val ); } + + /* error cases */ + \\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); } + {LineTerminator} { throw new ParseException("Unterminated string at end of line",yyline+1); } + +} + +/* error fallback */ +.|\n { } +<> { return new ParsedSymbol(ParsedSymbol.TYPE_EOF); } diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BooleanTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BooleanTreeItem.java new file mode 100644 index 000000000..4d128db46 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BooleanTreeItem.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class BooleanTreeItem extends TreeItem { + + public Boolean value; + + public BooleanTreeItem(AVM2Instruction instruction, Boolean value) { + super(instruction, PRECEDENCE_PRIMARY); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return value.toString(); + } + + @Override + public boolean isFalse() { + return value == false; + } + + @Override + public boolean isTrue() { + return value == true; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BreakTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BreakTreeItem.java new file mode 100644 index 000000000..df55fcd93 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/BreakTreeItem.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class BreakTreeItem extends TreeItem { + public int loopPos; + public boolean isKnown; + + public BreakTreeItem(AVM2Instruction instruction, int loopPos) { + this(instruction, loopPos, true); + } + + public BreakTreeItem(AVM2Instruction instruction, int loopPos, boolean isKnown) { + super(instruction, NOPRECEDENCE); + this.loopPos = loopPos; + this.isKnown = isKnown; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("break") + " loop" + loopPos + ";"; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallMethodTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallMethodTreeItem.java new file mode 100644 index 000000000..d71978180 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallMethodTreeItem.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class CallMethodTreeItem extends TreeItem { + public TreeItem receiver; + public String methodName; + public List arguments; + + public CallMethodTreeItem(AVM2Instruction instruction, TreeItem receiver, String methodName, List arguments) { + super(instruction, PRECEDENCE_PRIMARY); + this.receiver = receiver; + this.methodName = methodName; + this.arguments = arguments; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < arguments.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + arguments.get(a).toString(constants); + } + return receiver.toString(constants) + "." + methodName + hilight("(") + args + hilight(")"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallPropertyTreeItem.java new file mode 100644 index 000000000..5b0b1cd71 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallPropertyTreeItem.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class CallPropertyTreeItem extends TreeItem { + public TreeItem receiver; + public FullMultinameTreeItem propertyName; + public List arguments; + public boolean isVoid; + + public CallPropertyTreeItem(AVM2Instruction instruction, boolean isVoid, TreeItem receiver, FullMultinameTreeItem propertyName, List arguments) { + super(instruction, PRECEDENCE_PRIMARY); + this.receiver = receiver; + this.propertyName = propertyName; + this.arguments = arguments; + this.isVoid = isVoid; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < arguments.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + arguments.get(a).toString(constants); + } + return formatProperty(constants, receiver, propertyName) + "(" + args + ")" + (isVoid ? ";" : ""); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallStaticTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallStaticTreeItem.java new file mode 100644 index 000000000..3ddfb78b9 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallStaticTreeItem.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class CallStaticTreeItem extends TreeItem { + public TreeItem receiver; + public String methodName; + public List arguments; + + public CallStaticTreeItem(AVM2Instruction instruction, TreeItem receiver, String methodName, List arguments) { + super(instruction, PRECEDENCE_PRIMARY); + this.receiver = receiver; + this.methodName = methodName; + this.arguments = arguments; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < arguments.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + arguments.get(a).toString(constants); + } + return receiver.toString(constants) + hilight(".") + methodName + hilight("(") + args + hilight(")"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallSuperTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallSuperTreeItem.java new file mode 100644 index 000000000..b9e8517e4 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallSuperTreeItem.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Highlighting; + +import java.util.List; + + +public class CallSuperTreeItem extends TreeItem { + public TreeItem receiver; + public FullMultinameTreeItem multiname; + public List arguments; + public boolean isVoid; + + public CallSuperTreeItem(AVM2Instruction instruction, boolean isVoid, TreeItem receiver, FullMultinameTreeItem multiname, List arguments) { + super(instruction, PRECEDENCE_PRIMARY); + this.receiver = receiver; + this.multiname = multiname; + this.arguments = arguments; + this.isVoid = isVoid; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < arguments.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + arguments.get(a).toString(constants); + } + String calee = receiver.toString(constants) + "."; + if (Highlighting.stripHilights(calee).equals("this.")) calee = ""; + return calee + hilight("super.") + multiname.toString(constants) + hilight("(") + args + hilight(")") + (isVoid ? ";" : ""); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java new file mode 100644 index 000000000..b5f37890c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CallTreeItem.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class CallTreeItem extends TreeItem { + public TreeItem receiver; + public TreeItem function; + public List arguments; + + public CallTreeItem(AVM2Instruction instruction, TreeItem receiver, TreeItem function, List arguments) { + super(instruction, PRECEDENCE_PRIMARY); + this.receiver = receiver; + this.function = function; + this.arguments = arguments; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < arguments.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + arguments.get(a).toString(constants); + } + return receiver.toString(constants) + hilight(".") + function.toString(constants) + hilight("(") + args + hilight(")"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ClassTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ClassTreeItem.java new file mode 100644 index 000000000..151f028bb --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ClassTreeItem.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class ClassTreeItem extends TreeItem { + public String className; + + public ClassTreeItem(String className) { + super(null, PRECEDENCE_PRIMARY); + this.className = className; + } + + @Override + public String toString(ConstantPool constants) { + return className; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CoerceTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CoerceTreeItem.java new file mode 100644 index 000000000..dca757630 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CoerceTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class CoerceTreeItem extends TreeItem { + public TreeItem value; + public String type; + + public CoerceTreeItem(AVM2Instruction instruction, TreeItem value, String type) { + super(instruction, NOPRECEDENCE); + this.value = value; + this.type = type; + } + + @Override + public String toString(ConstantPool constants) { + //return hilight("("+type+")")+ + return value.toString(constants); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java new file mode 100644 index 000000000..5fb27269a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructPropTreeItem.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class ConstructPropTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + public List args; + + public ConstructPropTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, List args) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.propertyName = propertyName; + this.args = args; + } + + @Override + public String toString(ConstantPool constants) { + String argStr = ""; + for (int a = 0; a < args.size(); a++) { + if (a > 0) { + argStr = argStr + ","; + } + argStr = argStr + args.get(a).toString(constants); + } + String objstr = object.toString(constants); + if (!objstr.equals("")) objstr += "."; + return hilight("new ") + objstr + propertyName.toString(constants) + hilight("(") + argStr + hilight(")"); + + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructSuperTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructSuperTreeItem.java new file mode 100644 index 000000000..b1c84df7d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructSuperTreeItem.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Highlighting; + +import java.util.List; + + +public class ConstructSuperTreeItem extends TreeItem { + public TreeItem object; + public List args; + + public ConstructSuperTreeItem(AVM2Instruction instruction, TreeItem object, List args) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.args = args; + } + + @Override + public String toString(ConstantPool constants) { + String argStr = ""; + for (int a = 0; a < args.size(); a++) { + if (a > 0) { + argStr = argStr + ","; + } + argStr = argStr + args.get(a).toString(constants); + } + String calee = object.toString(constants) + "."; + if (Highlighting.stripHilights(calee).equals("this.")) calee = ""; + return calee + hilight("super(") + argStr + hilight(")"); + + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructTreeItem.java new file mode 100644 index 000000000..841c91bbd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConstructTreeItem.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class ConstructTreeItem extends TreeItem { + public TreeItem object; + public List args; + + public ConstructTreeItem(AVM2Instruction instruction, TreeItem object, List args) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.args = args; + } + + @Override + public String toString(ConstantPool constants) { + String argStr = ""; + for (int a = 0; a < args.size(); a++) { + if (a > 0) { + argStr = argStr + ","; + } + argStr = argStr + args.get(a).toString(constants); + } + if (object instanceof NewFunctionTreeItem) { + return object.toString(constants); + } + return hilight("new ") + object.toString(constants) + hilight("(") + argStr + hilight(")"); + + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ContinueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ContinueTreeItem.java new file mode 100644 index 000000000..c935b3c52 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ContinueTreeItem.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class ContinueTreeItem extends TreeItem { + public int loopPos; + public boolean isKnown; + + public ContinueTreeItem(AVM2Instruction instruction, int loopPos) { + this(instruction, loopPos, true); + } + + public ContinueTreeItem(AVM2Instruction instruction, int loopPos, boolean isKnown) { + super(instruction, NOPRECEDENCE); + this.loopPos = loopPos; + this.isKnown = isKnown; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("continue") + " " + (isKnown ? "loop" : "unk") + loopPos + ";"; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java new file mode 100644 index 000000000..345b7e5a7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ConvertTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class ConvertTreeItem extends TreeItem { + public TreeItem value; + public String type; + + public ConvertTreeItem(AVM2Instruction instruction, TreeItem value, String type) { + super(instruction, NOPRECEDENCE); + this.value = value; + this.type = type; + } + + @Override + public String toString(ConstantPool constants) { + //return hilight("("+type+")")+ + return value.toString(constants); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecLocalTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecLocalTreeItem.java new file mode 100644 index 000000000..cf0a35132 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecLocalTreeItem.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class DecLocalTreeItem extends TreeItem { + public int regIndex; + + public DecLocalTreeItem(AVM2Instruction instruction, int regIndex) { + super(instruction, PRECEDENCE_POSTFIX); + this.regIndex = regIndex; + } + + @Override + public String toString(ConstantPool constants) { + return InstructionDefinition.localRegName(regIndex) + hilight("--") + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecrementTreeItem.java new file mode 100644 index 000000000..64e4c1775 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/DecrementTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class DecrementTreeItem extends TreeItem { + public TreeItem object; + + public DecrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_ADDITIVE); + this.object = object; + } + + @Override + public String toString(ConstantPool constants) { + return object.toString(constants) + hilight("-1"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/EachTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/EachTreeItem.java new file mode 100644 index 000000000..a61125957 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/EachTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class EachTreeItem extends TreeItem { + public TreeItem object; + public TreeItem collection; + + public EachTreeItem(AVM2Instruction instruction, TreeItem object, TreeItem collection) { + super(instruction, NOPRECEDENCE); + this.object = object; + this.collection = collection; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("each (") + object.toString(constants) + hilight(" in ") + collection.toString(constants) + ")"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FindPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FindPropertyTreeItem.java new file mode 100644 index 000000000..6a9716a23 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FindPropertyTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class FindPropertyTreeItem extends TreeItem { + public FullMultinameTreeItem propertyName; + + public FindPropertyTreeItem(AVM2Instruction instruction, FullMultinameTreeItem propertyName) { + super(instruction, PRECEDENCE_PRIMARY); + this.propertyName = propertyName; + } + + @Override + public String toString(ConstantPool constants) { + return ""; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FloatValueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FloatValueTreeItem.java new file mode 100644 index 000000000..9963bbe60 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FloatValueTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class FloatValueTreeItem extends NumberValueTreeItem { + public Double value; + + public FloatValueTreeItem(AVM2Instruction instruction, Double value) { + super(instruction); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("" + value); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java new file mode 100644 index 000000000..3a51bebfe --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/FullMultinameTreeItem.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.types.Namespace; + + +public class FullMultinameTreeItem extends TreeItem { + public int multinameIndex; + public TreeItem name; + public TreeItem namespace; + + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, TreeItem name) { + super(instruction, PRECEDENCE_PRIMARY); + this.multinameIndex = multinameIndex; + this.name = name; + this.namespace = null; + } + + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex) { + super(instruction, PRECEDENCE_PRIMARY); + this.multinameIndex = multinameIndex; + this.name = null; + this.namespace = null; + } + + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, TreeItem name, TreeItem namespace) { + super(instruction, PRECEDENCE_PRIMARY); + this.multinameIndex = multinameIndex; + this.name = name; + this.namespace = namespace; + } + + public boolean isRuntime() { + return (name != null) || (namespace != null); + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + if (name != null) { + ret = name.toString(constants); + } else { + ret = constants.constant_multiname[multinameIndex].getName(constants); + } + if (namespace != null) { + ret = ret + "[" + namespace.toString(constants) + "]"; + } else { + Namespace ns = constants.constant_multiname[multinameIndex].getNamespace(constants); + if (ns != null) { + ret = ret + "[" + ns.getName(constants) + "]"; + } + } + + if ((name == null) && (namespace == null)) { + ret = hilight(constants.constant_multiname[multinameIndex].getName(constants)); + } + return ret; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetDescendantsTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetDescendantsTreeItem.java new file mode 100644 index 000000000..1d20a9e27 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetDescendantsTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class GetDescendantsTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem multiname; + + public GetDescendantsTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem multiname) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.multiname = multiname; + } + + @Override + public String toString(ConstantPool constants) { + return object.toString(constants) + hilight("..") + multiname.toString(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetLexTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetLexTreeItem.java new file mode 100644 index 000000000..8af3c9a14 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetLexTreeItem.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.types.Multiname; + + +public class GetLexTreeItem extends TreeItem { + public Multiname propertyName; + + public GetLexTreeItem(AVM2Instruction instruction, Multiname propertyName) { + super(instruction, PRECEDENCE_PRIMARY); + this.propertyName = propertyName; + } + + @Override + public String toString(ConstantPool constants) { + return hilight(propertyName.getName(constants)); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetPropertyTreeItem.java new file mode 100644 index 000000000..b1e67b548 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetPropertyTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class GetPropertyTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + + public GetPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.propertyName = propertyName; + } + + @Override + public String toString(ConstantPool constants) { + return formatProperty(constants, object, propertyName); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSlotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSlotTreeItem.java new file mode 100644 index 000000000..462dba51f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSlotTreeItem.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.types.Multiname; + + +public class GetSlotTreeItem extends TreeItem { + public Multiname slotName; + public TreeItem scope; + + public GetSlotTreeItem(AVM2Instruction instruction, TreeItem scope, Multiname slotName) { + super(instruction, PRECEDENCE_PRIMARY); + this.slotName = slotName; + this.scope = scope; + } + + @Override + public String toString(ConstantPool constants) { + //scope.toString(constants)+"." + return hilight(slotName.getName(constants)); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSuperTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSuperTreeItem.java new file mode 100644 index 000000000..03f2563f5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/GetSuperTreeItem.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Highlighting; + + +public class GetSuperTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + + public GetSuperTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + super(instruction, PRECEDENCE_PRIMARY); + this.object = object; + this.propertyName = propertyName; + } + + @Override + public String toString(ConstantPool constants) { + String calee = object.toString(constants) + "."; + if (Highlighting.stripHilights(calee).equals("this.")) calee = ""; + return calee + hilight("super.") + propertyName.toString(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncLocalTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncLocalTreeItem.java new file mode 100644 index 000000000..69eede5a0 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncLocalTreeItem.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class IncLocalTreeItem extends TreeItem { + public int regIndex; + + public IncLocalTreeItem(AVM2Instruction instruction, int regIndex) { + super(instruction, PRECEDENCE_POSTFIX); + this.regIndex = regIndex; + } + + @Override + public String toString(ConstantPool constants) { + return InstructionDefinition.localRegName(regIndex) + hilight("++") + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncrementTreeItem.java new file mode 100644 index 000000000..5e7bece75 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IncrementTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class IncrementTreeItem extends TreeItem { + public TreeItem object; + + public IncrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_ADDITIVE); + this.object = object; + } + + @Override + public String toString(ConstantPool constants) { + return object.toString(constants) + hilight("+1"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/InitPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/InitPropertyTreeItem.java new file mode 100644 index 000000000..5b279fa3f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/InitPropertyTreeItem.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class InitPropertyTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + public TreeItem value; + + public InitPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, TreeItem value) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.object = object; + this.propertyName = propertyName; + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return formatProperty(constants, object, propertyName) + hilight("=") + value.toString(constants) + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IntegerValueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IntegerValueTreeItem.java new file mode 100644 index 000000000..d8802f4b3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/IntegerValueTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class IntegerValueTreeItem extends NumberValueTreeItem { + public Long value; + + public IntegerValueTreeItem(AVM2Instruction instruction, Long value) { + super(instruction); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("" + value); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java new file mode 100644 index 000000000..4ef9e67d7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/LocalRegTreeItem.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class LocalRegTreeItem extends TreeItem { + public int regIndex; + public TreeItem computedValue; + + public LocalRegTreeItem(AVM2Instruction instruction, int regIndex, TreeItem computedValue) { + super(instruction, PRECEDENCE_PRIMARY); + this.regIndex = regIndex; + if (computedValue == null) { + computedValue = new UndefinedTreeItem(instruction); + } + this.computedValue = computedValue; + } + + @Override + public String toString(ConstantPool constants) { + return hilight(InstructionDefinition.localRegName(regIndex)); + } + + @Override + public boolean isFalse() { + return computedValue.isFalse(); + } + + @Override + public boolean isTrue() { + return computedValue.isTrue(); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameSpaceTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameSpaceTreeItem.java new file mode 100644 index 000000000..09f4054b3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameSpaceTreeItem.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class NameSpaceTreeItem extends TreeItem { + public int namespaceIndex; + + public NameSpaceTreeItem(AVM2Instruction instruction, int namespaceIndex) { + super(instruction, NOPRECEDENCE); + this.namespaceIndex = namespaceIndex; + } + + public String toString(ConstantPool constants) { + if (namespaceIndex == 0) return "*"; + return hilight(constants.constant_namespace[namespaceIndex].toString(constants)); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameValuePair.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameValuePair.java new file mode 100644 index 000000000..a93afcf0a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NameValuePair.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class NameValuePair extends TreeItem { + public TreeItem name; + public TreeItem value; + + public NameValuePair(TreeItem name, TreeItem value) { + super(name.instruction, NOPRECEDENCE); + this.name = name; + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + if (name instanceof StringTreeItem) { + return ((StringTreeItem) name).value + ":" + value.toString(constants); + } + return name.toString(constants) + ":" + value.toString(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NanTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NanTreeItem.java new file mode 100644 index 000000000..fc5d2d63f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NanTreeItem.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class NanTreeItem extends TreeItem { + + public NanTreeItem(AVM2Instruction instruction) { + super(instruction, NOPRECEDENCE); + } + + + @Override + public String toString(ConstantPool constants) { + return hilight("NaN"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewActivationTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewActivationTreeItem.java new file mode 100644 index 000000000..352635aaa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewActivationTreeItem.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class NewActivationTreeItem extends TreeItem { + + public NewActivationTreeItem(AVM2Instruction instruction) { + super(instruction, NOPRECEDENCE); + } + + + @Override + public String toString(ConstantPool constants) { + return hilight("newactivation()"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewArrayTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewArrayTreeItem.java new file mode 100644 index 000000000..17809560f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewArrayTreeItem.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class NewArrayTreeItem extends TreeItem { + public List values; + + public NewArrayTreeItem(AVM2Instruction instruction, List values) { + super(instruction, PRECEDENCE_PRIMARY); + this.values = values; + } + + @Override + public String toString(ConstantPool constants) { + String args = ""; + for (int a = 0; a < values.size(); a++) { + if (a > 0) { + args = args + ","; + } + args = args + values.get(a).toString(constants); + } + return hilight("[") + args + hilight("]"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewFunctionTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewFunctionTreeItem.java new file mode 100644 index 000000000..d5b47d231 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewFunctionTreeItem.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class NewFunctionTreeItem extends TreeItem { + public String paramStr; + public String returnStr; + public String functionBody; + + public NewFunctionTreeItem(AVM2Instruction instruction, String paramStr, String returnStr, String functionBody) { + super(instruction, PRECEDENCE_PRIMARY); + this.paramStr = paramStr; + this.returnStr = returnStr; + this.functionBody = functionBody; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("new function(" + paramStr + "):" + returnStr + "\r\n{\r\n" + functionBody + "}\r\n"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewObjectTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewObjectTreeItem.java new file mode 100644 index 000000000..e873df97c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NewObjectTreeItem.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.List; + + +public class NewObjectTreeItem extends TreeItem { + public List pairs; + + public NewObjectTreeItem(AVM2Instruction instruction, List pairs) { + super(instruction, PRECEDENCE_PRIMARY); + this.pairs = pairs; + } + + @Override + public String toString(ConstantPool constants) { + String params = ""; + for (int n = 0; n < pairs.size(); n++) { + if (n > 0) params += ",\r\n"; + params += pairs.get(n).toString(constants); + } + return hilight("{") + params + hilight("}"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NullTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NullTreeItem.java new file mode 100644 index 000000000..916043644 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NullTreeItem.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class NullTreeItem extends TreeItem { + + public NullTreeItem(AVM2Instruction instruction) { + super(instruction, PRECEDENCE_PRIMARY); + } + + + @Override + public String toString(ConstantPool constants) { + return hilight("null"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NumberValueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NumberValueTreeItem.java new file mode 100644 index 000000000..efa648220 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/NumberValueTreeItem.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public abstract class NumberValueTreeItem extends TreeItem { + + public NumberValueTreeItem(AVM2Instruction instruction) { + super(instruction, PRECEDENCE_PRIMARY); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostDecrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostDecrementTreeItem.java new file mode 100644 index 000000000..ecdb52449 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostDecrementTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class PostDecrementTreeItem extends TreeItem { + public TreeItem object; + + public PostDecrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_POSTFIX); + this.object = object; + } + + @Override + public String toString(ConstantPool constants) { + return object.toString(constants) + hilight("--"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostIncrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostIncrementTreeItem.java new file mode 100644 index 000000000..18f5bd2cd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/PostIncrementTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class PostIncrementTreeItem extends TreeItem { + public TreeItem object; + + public PostIncrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_POSTFIX); + this.object = object; + } + + @Override + public String toString(ConstantPool constants) { + return object.toString(constants) + hilight("++"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnValueTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnValueTreeItem.java new file mode 100644 index 000000000..10309d9be --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnValueTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class ReturnValueTreeItem extends TreeItem { + public TreeItem value; + + public ReturnValueTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, NOPRECEDENCE); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("return ") + value.toString(constants) + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnVoidTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnVoidTreeItem.java new file mode 100644 index 000000000..0f23c50dd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ReturnVoidTreeItem.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class ReturnVoidTreeItem extends TreeItem { + + public ReturnVoidTreeItem(AVM2Instruction instruction) { + super(instruction, NOPRECEDENCE); + } + + @Override + public String toString(ConstantPool constants) { + return hilight("return") + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetGlobalSlotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetGlobalSlotTreeItem.java new file mode 100644 index 000000000..eb057883a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetGlobalSlotTreeItem.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class SetGlobalSlotTreeItem extends TreeItem { + public int slotId; + public TreeItem value; + + public SetGlobalSlotTreeItem(AVM2Instruction instruction, int slotId, TreeItem value) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.slotId = slotId; + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("setglobalslot(" + slotId + ",") + value.toString(constants) + hilight(")") + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetLocalTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetLocalTreeItem.java new file mode 100644 index 000000000..2575b289a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetLocalTreeItem.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; + + +public class SetLocalTreeItem extends TreeItem { + public int regIndex; + public TreeItem value; + + public SetLocalTreeItem(AVM2Instruction instruction, int regIndex, TreeItem value) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.regIndex = regIndex; + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight(InstructionDefinition.localRegName(regIndex) + "=") + value.toString(constants) + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetPropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetPropertyTreeItem.java new file mode 100644 index 000000000..065bd195b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetPropertyTreeItem.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class SetPropertyTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + public TreeItem value; + + public SetPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, TreeItem value) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.object = object; + this.propertyName = propertyName; + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return formatProperty(constants, object, propertyName) + hilight("=") + value.toString(constants) + ";"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java new file mode 100644 index 000000000..400989d99 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSlotTreeItem.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.types.Multiname; + + +public class SetSlotTreeItem extends TreeItem { + public Multiname slotName; + public TreeItem value; + public TreeItem scope; + + public SetSlotTreeItem(AVM2Instruction instruction, TreeItem scope, Multiname slotName, TreeItem value) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.slotName = slotName; + this.value = value; + this.scope = scope; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + + if (!(scope instanceof NewActivationTreeItem)) { + ret = scope.toString(constants) + "."; + } + if(scope instanceof LocalRegTreeItem){ + if(((LocalRegTreeItem)scope).computedValue !=null){ + if(((LocalRegTreeItem)scope).computedValue instanceof NewActivationTreeItem){ + ret=""; + } + } + } + return ret + hilight(slotName.getName(constants)) + hilight("=") + value.toString(constants) + ";"; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSuperTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSuperTreeItem.java new file mode 100644 index 000000000..fb986b7ed --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/SetSuperTreeItem.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Highlighting; + + +public class SetSuperTreeItem extends TreeItem { + public TreeItem value; + public TreeItem object; + public FullMultinameTreeItem propertyName; + + public SetSuperTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem object, FullMultinameTreeItem propertyName) { + super(instruction, PRECEDENCE_ASSIGMENT); + this.value = value; + this.object = object; + this.propertyName = propertyName; + } + + + @Override + public String toString(ConstantPool constants) { + String calee = object.toString(constants) + "."; + if (Highlighting.stripHilights(calee).equals("this.")) calee = ""; + return calee + hilight("super.") + propertyName.toString(constants) + hilight("=") + value.toString(constants) + ";"; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/StringTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/StringTreeItem.java new file mode 100644 index 000000000..cc57b8711 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/StringTreeItem.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Helper; + + +public class StringTreeItem extends TreeItem { + public String value; + + public StringTreeItem(AVM2Instruction instruction, String value) { + super(instruction, PRECEDENCE_PRIMARY); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("\"" + Helper.escapeString(value) + "\""); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java new file mode 100644 index 000000000..fb45f5605 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThisTreeItem.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class ThisTreeItem extends TreeItem { + + public ThisTreeItem() { + super(null, PRECEDENCE_PRIMARY); + } + + @Override + public String toString(ConstantPool constants) { + return "this"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThrowTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThrowTreeItem.java new file mode 100644 index 000000000..91427ffd4 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/ThrowTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class ThrowTreeItem extends TreeItem { + public TreeItem value; + + public ThrowTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, NOPRECEDENCE); + this.value = value; + } + + + @Override + public String toString(ConstantPool constants) { + return hilight("throw ") + value.toString(constants); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java new file mode 100644 index 000000000..136b07c13 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/TreeItem.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.helpers.Highlighting; + + +public abstract class TreeItem { + + public static final int PRECEDENCE_PRIMARY = 0; + public static final int PRECEDENCE_POSTFIX = 1; + public static final int PRECEDENCE_UNARY = 2; + public static final int PRECEDENCE_MULTIPLICATIVE = 3; + public static final int PRECEDENCE_ADDITIVE = 4; + public static final int PRECEDENCE_BITWISESHIFT = 5; + public static final int PRECEDENCE_RELATIONAL = 6; + public static final int PRECEDENCE_EQUALITY = 7; + public static final int PRECEDENCE_BITWISEAND = 8; + public static final int PRECEDENCE_BITWISEXOR = 9; + public static final int PRECEDENCE_BITWISEOR = 10; + public static final int PRECEDENCE_LOGICALAND = 11; + public static final int PRECEDENCE_LOGICALOR = 12; + public static final int PRECEDENCE_CONDITIONAL = 13; + public static final int PRECEDENCE_ASSIGMENT = 14; + public static final int PRECEDENCE_COMMA = 15; + public static final int NOPRECEDENCE = 16; + + + public int precedence = NOPRECEDENCE; + public AVM2Instruction instruction; + + public TreeItem(AVM2Instruction instruction, int precedence) { + this.instruction = instruction; + this.precedence = precedence; + } + + + public abstract String toString(ConstantPool constants); + + + protected String hilight(String str) { + if (instruction == null) + return str; + return Highlighting.hilighOffset(str, instruction.offset); + } + + public boolean isFalse() { + return false; + } + + public boolean isTrue() { + return false; + } + + protected String formatProperty(ConstantPool constants, TreeItem object, TreeItem propertyName) { + String obStr = object.toString(constants); + if (object.precedence > PRECEDENCE_PRIMARY) { + obStr = "(" + obStr + ")"; + } + if (object instanceof LocalRegTreeItem) { + if (((LocalRegTreeItem) object).computedValue instanceof FindPropertyTreeItem) + obStr = ""; + } + if (propertyName instanceof FullMultinameTreeItem) { + + if (((FullMultinameTreeItem) propertyName).isRuntime()) { + return obStr + "[" + propertyName.toString(constants) + "]"; + } else { + if (!obStr.equals("")) obStr += "."; + return obStr + ((FullMultinameTreeItem) propertyName).toString(constants); + } + } else { + return obStr + "[" + propertyName.toString(constants) + "]"; + } + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UndefinedTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UndefinedTreeItem.java new file mode 100644 index 000000000..80bb57b76 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UndefinedTreeItem.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class UndefinedTreeItem extends TreeItem { + + public UndefinedTreeItem(AVM2Instruction instruction) { + super(instruction, PRECEDENCE_PRIMARY); + } + + + @Override + public String toString(ConstantPool constants) { + return hilight("undefined"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UnparsedTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UnparsedTreeItem.java new file mode 100644 index 000000000..174228b06 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/UnparsedTreeItem.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + + +public class UnparsedTreeItem extends TreeItem { + public String value; + + public UnparsedTreeItem(AVM2Instruction instruction, String value) { + super(instruction, NOPRECEDENCE); + this.value = value; + } + + @Override + public String toString(ConstantPool constants) { + return hilight(value); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java new file mode 100644 index 000000000..a16eb42f1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/WithTreeItem.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; + +import java.util.ArrayList; +import java.util.List; + + +public class WithTreeItem extends TreeItem { + public TreeItem scope; + public List items; + + public WithTreeItem(AVM2Instruction instruction, TreeItem scope, List items) { + super(instruction, NOPRECEDENCE); + this.scope = scope; + this.items = items; + } + + public WithTreeItem(AVM2Instruction instruction, TreeItem scope) { + super(instruction, NOPRECEDENCE); + this.scope = scope; + this.items = new ArrayList(); + } + + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret = hilight("with(") + scope.toString(constants) + hilight(")\r\n{\r\n"); + for (TreeItem ti : items) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}"); + return ret; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/Block.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/Block.java new file mode 100644 index 000000000..5c67b5bc1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/Block.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; + +import java.util.List; + + +public interface Block { + public List getContinues(); +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DoWhileTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DoWhileTreeItem.java new file mode 100644 index 000000000..f4ce6a810 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/DoWhileTreeItem.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class DoWhileTreeItem extends LoopTreeItem implements Block { + + public List commands; + public TreeItem expression; + + public DoWhileTreeItem(AVM2Instruction instruction, int loopBreak, int loopContinue, List commands, TreeItem expression) { + super(instruction, loopBreak, loopContinue); + this.expression = expression; + this.commands = commands; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "loop" + loopBreak + ":\r\n"; + ret += hilight("do\r\n{") + "\r\n"; + for (TreeItem ti : commands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}\r\nwhile(") + expression.toString(constants) + hilight(");") + "\r\n"; + ret += ":loop" + loopBreak; + + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : commands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ExceptionTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ExceptionTreeItem.java new file mode 100644 index 000000000..61fa11b1c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ExceptionTreeItem.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.ABCException; + + +public class ExceptionTreeItem extends TreeItem { + public ABCException exception; + + public ExceptionTreeItem(ABCException exception) { + super(null, NOPRECEDENCE); + this.exception = exception; + } + + @Override + public String toString(ConstantPool constants) { + return exception.getVarName(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForEachTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForEachTreeItem.java new file mode 100644 index 000000000..f10c9faf1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForEachTreeItem.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.EachTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class ForEachTreeItem extends LoopTreeItem implements Block { + + public EachTreeItem expression; + public List commands; + + public ForEachTreeItem(AVM2Instruction instruction, int loopBreak, int loopContinue, EachTreeItem expression, List commands) { + super(instruction, loopBreak, loopContinue); + this.expression = expression; + this.commands = commands; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "loop" + loopBreak + ":\r\n"; + ret += hilight("for ") + expression.toString(constants) + "\r\n{\r\n"; + for (TreeItem ti : commands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}") + "\r\n"; + ret += ":loop" + loopBreak; + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : commands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java new file mode 100644 index 000000000..56a37ef52 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/ForTreeItem.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class ForTreeItem extends LoopTreeItem implements Block { + + public List firstCommands; + public TreeItem expression; + public List finalCommands; + public List commands; + + public ForTreeItem(AVM2Instruction instruction, int loopBreak, int loopContinue, List firstCommands, TreeItem expression, List finalCommands, List commands) { + super(instruction, loopBreak, loopContinue); + this.firstCommands = firstCommands; + this.expression = expression; + this.finalCommands = finalCommands; + this.commands = commands; + } + + private String stripSemicolon(String s) { + if (s.endsWith(";")) { + s = s.substring(0, s.length() - 1); + } + return s; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "loop" + loopBreak + ":\r\n"; + ret += hilight("for("); + for (int i = 0; i < firstCommands.size(); i++) { + if (i > 0) { + ret += ","; + } + ret += stripSemicolon(firstCommands.get(i).toString(constants)); + } + ret += ";"; + ret += expression.toString(constants); + ret += ";"; + for (int i = 0; i < finalCommands.size(); i++) { + if (i > 0) { + ret += ","; + } + ret += stripSemicolon(finalCommands.get(i).toString(constants)); + } + ret += hilight(")") + "\r\n{\r\n"; + for (TreeItem ti : commands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}") + "\r\n"; + ret += ":loop" + loopBreak; + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : commands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java new file mode 100644 index 000000000..eca98e2ca --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/IfTreeItem.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class IfTreeItem extends TreeItem implements Block { + public TreeItem expression; + public List onTrue; + public List onFalse; + + public IfTreeItem(AVM2Instruction instruction, TreeItem expression, List onTrue, List onFalse) { + super(instruction, NOPRECEDENCE); + this.expression = expression; + this.onTrue = onTrue; + this.onFalse = onFalse; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret = hilight("if(") + expression.toString(constants) + hilight(")\r\n{\r\n"); + for (TreeItem ti : onTrue) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}"); + if (onFalse.size() > 0) { + ret += hilight("\r\nelse\r\n{\r\n"); + for (TreeItem ti : onFalse) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}"); + } + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : onTrue) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + for (TreeItem ti : onFalse) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/LoopTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/LoopTreeItem.java new file mode 100644 index 000000000..ed3e5ed8c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/LoopTreeItem.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public abstract class LoopTreeItem extends TreeItem { + public int loopBreak; + public int loopContinue; + + public LoopTreeItem(AVM2Instruction instruction, int loopBreak, int loopContinue) { + super(instruction, NOPRECEDENCE); + this.loopBreak = loopBreak; + this.loopContinue = loopContinue; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java new file mode 100644 index 000000000..4b8045fe6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/SwitchTreeItem.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class SwitchTreeItem extends LoopTreeItem implements Block { + + public TreeItem switchedObject; + public List caseValues; + public List> caseCommands; + public List defaultCommands; + + public SwitchTreeItem(AVM2Instruction instruction, int switchBreak, TreeItem switchedObject, List caseValues, List> caseCommands, List defaultCommands) { + super(instruction, switchBreak, -1); + this.switchedObject = switchedObject; + this.caseValues = caseValues; + this.caseCommands = caseCommands; + this.defaultCommands = defaultCommands; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "loop" + loopBreak + ":\r\n"; + ret += hilight("switch(") + switchedObject.toString(constants) + hilight(")") + "\r\n{\r\n"; + for (int i = 0; i < caseValues.size(); i++) { + ret += "case " + caseValues.get(i).toString(constants) + ":\r\n"; + ret += AVM2Code.IDENTOPEN + "\r\n"; + for (int j = 0; j < caseCommands.get(i).size(); j++) { + ret += caseCommands.get(i).get(j).toString(constants) + "\r\n"; + } + ret += AVM2Code.IDENTCLOSE + "\r\n"; + } + if (defaultCommands.size() > 0) { + ret += hilight("default") + ":\r\n"; + ret += AVM2Code.IDENTOPEN + "\r\n"; + for (int j = 0; j < defaultCommands.size(); j++) { + ret += defaultCommands.get(j).toString(constants) + "\r\n"; + } + ret += AVM2Code.IDENTCLOSE + "\r\n"; + } + ret += hilight("}") + "\r\n"; + ret += ":loop" + loopBreak; + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + + for (List onecase : caseCommands) { + for (TreeItem ti : onecase) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + } + + for (TreeItem ti : defaultCommands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TernarOpTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TernarOpTreeItem.java new file mode 100644 index 000000000..b8d148e5a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TernarOpTreeItem.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class TernarOpTreeItem extends TreeItem { + public TreeItem expression; + public TreeItem onTrue; + public TreeItem onFalse; + + public TernarOpTreeItem(AVM2Instruction instruction, TreeItem expression, TreeItem onTrue, TreeItem onFalse) { + super(instruction, PRECEDENCE_CONDITIONAL); + this.expression = expression; + this.onTrue = onTrue; + this.onFalse = onFalse; + } + + @Override + public String toString(ConstantPool constants) { + return expression.toString(constants) + hilight("?") + onTrue.toString(constants) + hilight(":") + onFalse.toString(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TryTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TryTreeItem.java new file mode 100644 index 000000000..bb48f929c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/TryTreeItem.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.ABCException; + +import java.util.ArrayList; +import java.util.List; + + +public class TryTreeItem extends TreeItem implements Block { + + public List tryCommands; + public List catchExceptions; + public List> catchCommands; + public List finallyCommands; + + public TryTreeItem(List tryCommands, List catchExceptions, List> catchCommands, List finallyCommands) { + super(null, NOPRECEDENCE); + this.tryCommands = tryCommands; + this.catchExceptions = catchExceptions; + this.catchCommands = catchCommands; + this.finallyCommands = finallyCommands; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "try\r\n{\r\n"; + for (TreeItem ti : tryCommands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += "}"; + for (int e = 0; e < catchExceptions.size(); e++) { + ret += "\r\ncatch(" + catchExceptions.get(e).getVarName(constants) + ":" + catchExceptions.get(e).getTypeName(constants) + ")\r\n{\r\n"; + List commands = catchCommands.get(e); + for (TreeItem ti : commands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += "}"; + } + if (finallyCommands.size() > 0) { + ret += "\r\nfinally\r\n{\r\n"; + for (TreeItem ti : finallyCommands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += "}"; + } + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : tryCommands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + if (finallyCommands != null) { + for (TreeItem ti : finallyCommands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + } + for (List commands : catchCommands) { + for (TreeItem ti : commands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java new file mode 100644 index 000000000..e204abd26 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/clauses/WhileTreeItem.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.clauses; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.ContinueTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + +import java.util.ArrayList; +import java.util.List; + + +public class WhileTreeItem extends LoopTreeItem implements Block { + + public TreeItem expression; + public List commands; + + public WhileTreeItem(AVM2Instruction instruction, int loopBreak, int loopContinue, TreeItem expression, List commands) { + super(instruction, loopBreak, loopContinue); + this.expression = expression; + this.commands = commands; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + ret += "loop" + loopBreak + ":\r\n"; + ret += hilight("while(") + expression.toString(constants) + hilight(")") + "\r\n{\r\n"; + for (TreeItem ti : commands) { + ret += ti.toString(constants) + "\r\n"; + } + ret += hilight("}") + "\r\n"; + ret += ":loop" + loopBreak; + return ret; + } + + public List getContinues() { + List ret = new ArrayList(); + for (TreeItem ti : commands) { + if (ti instanceof ContinueTreeItem) { + ret.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + ret.addAll(((Block) ti).getContinues()); + } + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AddTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AddTreeItem.java new file mode 100644 index 000000000..c784eba4a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AddTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class AddTreeItem extends BinaryOpTreeItem { + + public AddTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AndTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AndTreeItem.java new file mode 100644 index 000000000..063d5c131 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AndTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class AndTreeItem extends BinaryOpTreeItem { + + public AndTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_LOGICALAND, leftSide, rightSide, "&&"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AsTypeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AsTypeTreeItem.java new file mode 100644 index 000000000..30875b4de --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/AsTypeTreeItem.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class AsTypeTreeItem extends BinaryOpTreeItem { + + public AsTypeTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + super(instruction, PRECEDENCE_RELATIONAL, value, type, " as "); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BinaryOpTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BinaryOpTreeItem.java new file mode 100644 index 000000000..b3fc9849d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BinaryOpTreeItem.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public abstract class BinaryOpTreeItem extends TreeItem { + + public TreeItem leftSide; + public TreeItem rightSide; + protected String operator = ""; + + public BinaryOpTreeItem(AVM2Instruction instruction, int precedence, TreeItem leftSide, TreeItem rightSide, String operator) { + super(instruction, precedence); + this.leftSide = leftSide; + this.rightSide = rightSide; + this.operator = operator; + } + + @Override + public String toString(ConstantPool constants) { + String ret = ""; + if (leftSide.precedence > precedence) { + ret += "(" + leftSide.toString(constants) + ")"; + } else { + ret += leftSide.toString(constants); + } + ret += hilight(operator); + if (rightSide.precedence > precedence) { + ret += "(" + rightSide.toString(constants) + ")"; + } else { + ret += rightSide.toString(constants); + } + return ret; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitAndTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitAndTreeItem.java new file mode 100644 index 000000000..215f5df97 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitAndTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class BitAndTreeItem extends BinaryOpTreeItem { + + public BitAndTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISEAND, leftSide, rightSide, "&"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitNotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitNotTreeItem.java new file mode 100644 index 000000000..430ed570f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitNotTreeItem.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class BitNotTreeItem extends UnaryOpTreeItem { + + public BitNotTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, PRECEDENCE_UNARY, value, "~"); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitOrTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitOrTreeItem.java new file mode 100644 index 000000000..ecc9af640 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitOrTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class BitOrTreeItem extends BinaryOpTreeItem { + + public BitOrTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISEOR, leftSide, rightSide, "|"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitXorTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitXorTreeItem.java new file mode 100644 index 000000000..23e0f04e3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/BitXorTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class BitXorTreeItem extends BinaryOpTreeItem { + + public BitXorTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISEXOR, leftSide, rightSide, "^"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java new file mode 100644 index 000000000..4fe3ad117 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.FullMultinameTreeItem; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class DeletePropertyTreeItem extends TreeItem { + public TreeItem object; + public FullMultinameTreeItem propertyName; + + public DeletePropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + super(instruction, PRECEDENCE_UNARY); + this.object = object; + this.propertyName = propertyName; + } + + @Override + public String toString(ConstantPool constants) { + return hilight("delete ") + object.toString(constants) + "[" + propertyName.toString(constants) + "]"; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DivideTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DivideTreeItem.java new file mode 100644 index 000000000..371b34ac4 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/DivideTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class DivideTreeItem extends BinaryOpTreeItem { + + public DivideTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java new file mode 100644 index 000000000..6aae09bfb --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/EqTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class EqTreeItem extends BinaryOpTreeItem { + + public EqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "=="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java new file mode 100644 index 000000000..275eeaff2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GeTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class GeTreeItem extends BinaryOpTreeItem { + + public GeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java new file mode 100644 index 000000000..6a0650a54 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/GtTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class GtTreeItem extends BinaryOpTreeItem { + + public GtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InTreeItem.java new file mode 100644 index 000000000..18bd8c3b1 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InTreeItem.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class InTreeItem extends BinaryOpTreeItem { + + public InTreeItem(AVM2Instruction instruction, TreeItem name, TreeItem object) { + super(instruction, PRECEDENCE_RELATIONAL, name, object, " in "); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InstanceOfTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InstanceOfTreeItem.java new file mode 100644 index 000000000..e5ab0ca71 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/InstanceOfTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class InstanceOfTreeItem extends BinaryOpTreeItem { + + public InstanceOfTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + super(instruction, PRECEDENCE_RELATIONAL, value, type, " instanceof "); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/IsTypeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/IsTypeTreeItem.java new file mode 100644 index 000000000..b93e2ac39 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/IsTypeTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class IsTypeTreeItem extends BinaryOpTreeItem { + + public IsTypeTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + super(instruction, PRECEDENCE_RELATIONAL, value, type, " is "); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LShiftTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LShiftTreeItem.java new file mode 100644 index 000000000..067208f2d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LShiftTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class LShiftTreeItem extends BinaryOpTreeItem { + + public LShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java new file mode 100644 index 000000000..6125bfb66 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LeTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class LeTreeItem extends BinaryOpTreeItem { + + public LeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java new file mode 100644 index 000000000..0b7c5f983 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/LtTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class LtTreeItem extends BinaryOpTreeItem { + + public LtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/ModuloTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/ModuloTreeItem.java new file mode 100644 index 000000000..28ccc61d4 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/ModuloTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class ModuloTreeItem extends BinaryOpTreeItem { + + public ModuloTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/MultiplyTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/MultiplyTreeItem.java new file mode 100644 index 000000000..913584517 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/MultiplyTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class MultiplyTreeItem extends BinaryOpTreeItem { + + public MultiplyTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NegTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NegTreeItem.java new file mode 100644 index 000000000..f1ab86009 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NegTreeItem.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class NegTreeItem extends UnaryOpTreeItem { + + public NegTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, PRECEDENCE_UNARY, value, "-"); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NeqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NeqTreeItem.java new file mode 100644 index 000000000..16728f63d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NeqTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class NeqTreeItem extends BinaryOpTreeItem { + + public NeqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java new file mode 100644 index 000000000..409e35558 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/NotTreeItem.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class NotTreeItem extends UnaryOpTreeItem { + + public NotTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, PRECEDENCE_UNARY, value, "!"); + } + + @Override + public boolean isTrue() { + return !value.isTrue(); + } + + @Override + public boolean isFalse() { + return !value.isFalse(); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/OrTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/OrTreeItem.java new file mode 100644 index 000000000..96392b388 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/OrTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class OrTreeItem extends BinaryOpTreeItem { + + public OrTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_LOGICALOR, leftSide, rightSide, "||"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreDecrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreDecrementTreeItem.java new file mode 100644 index 000000000..d50082eae --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreDecrementTreeItem.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class PreDecrementTreeItem extends UnaryOpTreeItem { + public PreDecrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_UNARY, object, "--"); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreIncrementTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreIncrementTreeItem.java new file mode 100644 index 000000000..7e63d9a6d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/PreIncrementTreeItem.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class PreIncrementTreeItem extends UnaryOpTreeItem { + + public PreIncrementTreeItem(AVM2Instruction instruction, TreeItem object) { + super(instruction, PRECEDENCE_UNARY, object, "++"); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/RShiftTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/RShiftTreeItem.java new file mode 100644 index 000000000..b9eefb69a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/RShiftTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class RShiftTreeItem extends BinaryOpTreeItem { + + public RShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java new file mode 100644 index 000000000..51a70da63 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictEqTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class StrictEqTreeItem extends BinaryOpTreeItem { + + public StrictEqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "==="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java new file mode 100644 index 000000000..a88cde6b6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/StrictNeqTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class StrictNeqTreeItem extends BinaryOpTreeItem { + + public StrictNeqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=="); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/SubtractTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/SubtractTreeItem.java new file mode 100644 index 000000000..7f497e837 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/SubtractTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class SubtractTreeItem extends BinaryOpTreeItem { + + public SubtractTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/TypeOfTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/TypeOfTreeItem.java new file mode 100644 index 000000000..17587bf49 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/TypeOfTreeItem.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class TypeOfTreeItem extends UnaryOpTreeItem { + + public TypeOfTreeItem(AVM2Instruction instruction, TreeItem value) { + super(instruction, PRECEDENCE_UNARY, value, "typeof "); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/URShiftTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/URShiftTreeItem.java new file mode 100644 index 000000000..baad20c3e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/URShiftTreeItem.java @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public class URShiftTreeItem extends BinaryOpTreeItem { + + public URShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>"); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/UnaryOpTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/UnaryOpTreeItem.java new file mode 100644 index 000000000..eb105b7ab --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/operations/UnaryOpTreeItem.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.avm2.treemodel.operations; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; + + +public abstract class UnaryOpTreeItem extends TreeItem { + public TreeItem value; + public String operator; + + public UnaryOpTreeItem(AVM2Instruction instruction, int precedence, TreeItem value, String operator) { + super(instruction, precedence); + this.value = value; + this.operator = operator; + } + + @Override + public String toString(ConstantPool constants) { + String s = value.toString(constants); + if (value.precedence > precedence) s = "(" + s + ")"; + return hilight(operator) + s; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java b/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java new file mode 100644 index 000000000..3c919d73d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.tags.DoABCTag; + +import javax.swing.*; +import javax.swing.event.ListDataListener; +import java.util.List; + + +public class ABCComboBoxModel implements ComboBoxModel { + public List list; + public int itemIndex = 0; + + public ABCComboBoxModel(List list) { + this.list = list; + } + + + public int getSize() { + return list.size(); + } + + public Object getElementAt(int index) { + return list.get(index); + } + + public void addListDataListener(ListDataListener l) { + + } + + public void removeListDataListener(ListDataListener l) { + + } + + public void setSelectedItem(Object anItem) { + itemIndex = list.indexOf(anItem); + } + + public Object getSelectedItem() { + return getElementAt(itemIndex); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java new file mode 100644 index 000000000..0b9833f17 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/ASMSourceEditorPane.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.ConvertException; +import com.jpexs.asdec.abc.avm2.parser.ASM3Parser; +import com.jpexs.asdec.abc.avm2.parser.ParseException; + +import javax.swing.*; +import java.io.ByteArrayInputStream; +import java.io.IOException; + + +public class ASMSourceEditorPane extends JEditorPane { + + public ABC abc; + public int bodyIndex; + + public ASMSourceEditorPane() { + + } + + public void setBodyIndex(int bodyIndex, ABC abc) { + this.bodyIndex = bodyIndex; + this.abc = abc; + setText(abc.bodies[bodyIndex].code.toASMSource(abc.constants)); + } + + public void save(ConstantPool constants) { + try { + AVM2Code acode = ASM3Parser.parse(new ByteArrayInputStream(getText().getBytes()), constants, new DialogMissingSymbolHandler()); + abc.bodies[bodyIndex].code = acode; + Main.abcMainFrame.decompiledTextArea.reloadClass(); + Main.abcMainFrame.decompiledTextArea.gotoLastTrait(); + } catch (IOException ex) { + } catch (ParseException ex) { + JOptionPane.showMessageDialog(this, (ex.text + " on line " + ex.line)); + selectLine((int) ex.line); + return; + } + JOptionPane.showMessageDialog(this, ("Code Saved")); + } + + public void verify(ConstantPool constants, ABC abc) { + try { + AVM2Code acode = ASM3Parser.parse(new ByteArrayInputStream(getText().getBytes()), constants, new DialogMissingSymbolHandler()); + acode.clearSecureSWF(abc.constants, abc.bodies[bodyIndex]); + setText(acode.toASMSource(constants)); + + + //Main.mainFrame.decompiledTextArea.setBody(mb, abc); + } catch (IOException ex) { + } catch (ConvertException ex) { + } catch (ParseException ex) { + JOptionPane.showMessageDialog(this, (ex.text + " on line " + ex.line)); + selectLine((int) ex.line); + return; + } + JOptionPane.showMessageDialog(this, ("Code OK")); + } + + public void selectInstruction(int pos) { + String text = getText(); + int lineCnt = 1; + int lineStart = 0; + int lineEnd = -1; + int instrCount = 0; + int dot = -2; + for (int i = 0; i < text.length(); i++) { + if (text.charAt(i) == '\n') { + if (!((i > 0) && (text.charAt(i - 1) == ':'))) + instrCount++; + lineCnt++; + if (instrCount == pos) { + lineStart = i; + dot = lineCnt; + } + if (lineCnt == dot + 1) { + lineEnd = i; + break; + } + } + } + if (lineCnt == -1) { + lineEnd = text.length() - 1; + } + select(lineStart, lineEnd); + requestFocus(); + } + + public void selectLine(int line) { + String text = getText(); + int lineCnt = 1; + int lineStart = 0; + int lineEnd = -1; + for (int i = 0; i < text.length(); i++) { + if (text.charAt(i) == '\n') { + lineCnt++; + if (lineCnt == line) { + lineStart = i; + } + if (lineCnt == line + 1) { + lineEnd = i; + } + } + } + if (lineCnt == -1) { + lineEnd = text.length() - 1; + } + select(lineStart, lineEnd); + requestFocus(); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java new file mode 100644 index 000000000..f2968779c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTree.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.ABC; + +import javax.swing.*; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultTreeCellRenderer; + + +public class ClassesListTree extends JTree implements TreeSelectionListener { + public ABC abc; + + public ClassesListTree(ABC abc) { + this.abc = abc; + setModel(new ClassesListTreeModel(abc)); + addTreeSelectionListener(this); + DefaultTreeCellRenderer treeRenderer = new DefaultTreeCellRenderer(); + ClassLoader cldr = this.getClass().getClassLoader(); + java.net.URL imageURL = cldr.getResource("com/jpexs/asdec/abc/gui/graphics/class.png"); + ImageIcon leafIcon = new ImageIcon(imageURL); + treeRenderer.setLeafIcon(leafIcon); + setCellRenderer(treeRenderer); + } + + public void setABC(ABC abc) { + setModel(new ClassesListTreeModel(abc)); + this.abc = abc; + } + + public void valueChanged(TreeSelectionEvent e) { + if (Main.isWorking()) return; + final TreePart tp = (TreePart) getLastSelectedPathComponent(); + if (tp == null) return; + if (tp.classIndex != -1) { + if (!Main.isWorking()) { + Main.startWork("Decompiling class..."); + (new Thread() { + @Override + public void run() { + Main.abcMainFrame.navigator.setClassIndex(tp.classIndex); + Main.abcMainFrame.decompiledTextArea.setClassIndex(tp.classIndex, abc); + Main.abcMainFrame.sourceTextArea.setText(""); + Main.stopWork(); + } + }).start(); + } + } + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTreeModel.java b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTreeModel.java new file mode 100644 index 000000000..5aac03919 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/ClassesListTreeModel.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TreeModelListener; +import javax.swing.tree.TreeModel; +import javax.swing.tree.TreePath; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + + +public class ClassesListTreeModel implements TreeModel { + private ABC abc; + private List pathList = new ArrayList(); + + public ClassesListTreeModel(ABC abc) { + this.abc = abc; + for (int i = 0; i < abc.instance_info.length; i++) { + String packageName = abc.instance_info[i].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); + String className = abc.instance_info[i].getName(abc.constants).getName(abc.constants); + String full = packageName + "." + className; + String parts[] = full.split("\\."); + String s = ""; + for (int j = 0; j < parts.length; j++) { + if (!s.endsWith(".")) s += "."; + s += parts[j]; + TreePart tp = new TreePart(s, parts[j], j < parts.length - 1 ? -1 : i); + if (!pathList.contains(tp)) { + pathList.add(tp); + } + } + } + for (int k1 = 0; k1 < pathList.size(); k1++) { + TreePart tp1 = pathList.get(k1); + for (int k2 = 0; k2 < pathList.size(); k2++) { + if (k1 == k2) continue; + TreePart tp2 = pathList.get(k2); + if (!tp1.path.equals(tp2.path)) { + if (tp1.path.startsWith(tp2.path + ".")) { + tp2.hasSubParts = true; + } + if (tp2.path.startsWith(tp1.path + ".")) { + tp1.hasSubParts = true; + } + } + } + } + Collections.sort(pathList); + } + + + public Object getRoot() { + return new TreePart("", "", -1); + } + + public Object getChild(Object parent, int index) { + int i = -1; + for (TreePart tp : pathList) { + if (tp.path.matches(Pattern.quote(((TreePart) parent).path) + "\\.[^\\.]+")) { + i++; + if (i == index) { + return tp; + } + } + } + return null; + } + + public int getChildCount(Object parent) { + int i = 0; + for (TreePart tp : pathList) { + if (tp.path.matches(Pattern.quote(((TreePart) parent).path) + "\\.[^\\.]+")) { + i++; + } + } + return i; + } + + public boolean isLeaf(Object node) { + return getChildCount(node) == 0; + } + + public void valueForPathChanged(TreePath path, Object newValue) { + + } + + public int getIndexOfChild(Object parent, Object child) { + int i = -1; + for (TreePart tp : pathList) { + if (tp.path.matches(Pattern.quote(((TreePart) parent).path) + "\\.[^\\.]+")) { + i++; + if (tp.equals(child)) { + return i; + } + } + } + return i; + } + + public void addTreeModelListener(TreeModelListener l) { + + } + + public void removeTreeModelListener(TreeModelListener l) { + + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/ConstantsListModel.java b/trunk/src/com/jpexs/asdec/abc/gui/ConstantsListModel.java new file mode 100644 index 000000000..a4a73e734 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/ConstantsListModel.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.helpers.Helper; + +import javax.swing.*; +import javax.swing.event.ListDataListener; + + +public class ConstantsListModel implements ListModel { + private ConstantPool constants; + + public static final int TYPE_UINT = 0; + public static final int TYPE_INT = 1; + public static final int TYPE_DOUBLE = 2; + public static final int TYPE_STRING = 3; + public static final int TYPE_NAMESPACE = 4; + public static final int TYPE_NAMESPACESET = 5; + public static final int TYPE_MULTINAME = 6; + private int type = TYPE_INT; + + public ConstantsListModel(ConstantPool constants, int type) { + this.type = type; + this.constants = constants; + } + + + private int makeUp(int i) { + if (i < 0) return 0; + return i; + } + + public int getSize() { + switch (type) { + case TYPE_UINT: + return makeUp(constants.constant_uint.length - 1); + case TYPE_INT: + return makeUp(constants.constant_int.length - 1); + case TYPE_DOUBLE: + return makeUp(constants.constant_double.length - 1); + case TYPE_STRING: + return makeUp(constants.constant_string.length - 1); + case TYPE_NAMESPACE: + return makeUp(constants.constant_namespace.length - 1); + case TYPE_NAMESPACESET: + return makeUp(constants.constant_namespace_set.length - 1); + case TYPE_MULTINAME: + return makeUp(constants.constant_multiname.length - 1); + } + return 0; + } + + public Object getElementAt(int index) { + switch (type) { + case TYPE_UINT: + return "" + (index + 1) + ":" + constants.constant_uint[index + 1]; + case TYPE_INT: + return "" + (index + 1) + ":" + constants.constant_int[index + 1]; + case TYPE_DOUBLE: + return "" + (index + 1) + ":" + constants.constant_double[index + 1]; + case TYPE_STRING: + return "" + (index + 1) + ":" + Helper.escapeString(constants.constant_string[index + 1]); + case TYPE_NAMESPACE: + return "" + (index + 1) + ":" + constants.constant_namespace[index + 1].getNameWithKind(constants); + case TYPE_NAMESPACESET: + return "" + (index + 1) + ":" + constants.constant_namespace_set[index + 1].toString(constants); + case TYPE_MULTINAME: + return "" + (index + 1) + ":" + constants.constant_multiname[index + 1].toString(constants); + } + return null; + } + + public void addListDataListener(ListDataListener l) { + + } + + public void removeListDataListener(ListDataListener l) { + + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java new file mode 100644 index 000000000..1c5244f11 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.ConvertException; +import com.jpexs.asdec.helpers.Highlighting; + +import javax.swing.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + + +public class DecompiledEditorPane extends JEditorPane implements MouseListener { + + private List highlights = new ArrayList(); + private List traitHighlights = new ArrayList(); + private ABC abc; + private int classIndex; + public int lastTraitIndex = 0; + + private class BufferedClass { + + public String text; + public List highlights; + public List traitHighlights; + + public BufferedClass(String text, List highlights, List traitHighlights) { + this.text = text; + this.highlights = highlights; + this.traitHighlights = traitHighlights; + } + } + + private HashMap bufferedClasses = new HashMap(); + + public void gotoLastTrait() { + gotoTrait(lastTraitIndex); + } + + public void gotoTrait(int traitId) { + for (Highlighting th : traitHighlights) { + if (th.offset == traitId) { + setCaretPosition(th.startPos + th.len - 1); + setCaretPosition(th.startPos); + break; + } + } + int mi = abc.findMethodIdByTraitId(classIndex, traitId); + int bi = abc.findBodyIndex(mi); + if (bi == -1) { + Main.abcMainFrame.sourceTextArea.setText(""); + return; + } + if (Main.abcMainFrame.sourceTextArea.bodyIndex != bi) { + Main.abcMainFrame.sourceTextArea.setBodyIndex(bi, abc); + } + } + + public DecompiledEditorPane() { + /*setFont(new Font("Courier new", Font.PLAIN, 16)); + setBackground(new Color(0, 0, 0x80)); + setForeground(Color.white); + setCaretColor(Color.white);*/ + addMouseListener(this); + setEditable(false); + } + + public void setClassIndex(int index, ABC abc) { + setText("//Please wait..."); + + String hilightedCode = ""; + if (!bufferedClasses.containsKey(index)) { + hilightedCode = abc.classToString(index, true); + highlights = Highlighting.getInstrHighlights(hilightedCode); + traitHighlights = Highlighting.getTraitHighlights(hilightedCode); + hilightedCode = Highlighting.stripHilights(hilightedCode); + bufferedClasses.put(index, new BufferedClass(hilightedCode, highlights, traitHighlights)); + } else { + BufferedClass bc = bufferedClasses.get(index); + hilightedCode = bc.text; + highlights = bc.highlights; + traitHighlights = bc.traitHighlights; + } + setText(hilightedCode); + this.abc = abc; + classIndex = index; + } + + public void reloadClass() { + if (bufferedClasses.containsKey(classIndex)) { + bufferedClasses.remove(classIndex); + } + setClassIndex(classIndex, abc); + } + + public void setABC(ABC abc) { + this.abc = abc; + bufferedClasses.clear(); + setText(""); + } + + public void mouseClicked(MouseEvent e) { + } + + public void mousePressed(MouseEvent e) { + int pos = getCaretPosition(); + for (Highlighting th : traitHighlights) { + if ((pos >= th.startPos) && (pos < th.startPos + th.len)) { + + int bi = abc.findBodyIndex(abc.findMethodIdByTraitId(classIndex, (int) th.offset)); + if (bi == -1) { + Main.abcMainFrame.sourceTextArea.setText(""); + break; + } + lastTraitIndex = (int) th.offset; + if (Main.abcMainFrame.sourceTextArea.bodyIndex != bi) { + /*try { + abc.bodies[bi].code.clearCode(abc.constants, abc.bodies[bi]); + } catch (ConvertException ex) { + Logger.getLogger(DecompiledEditorPane.class.getName()).log(Level.SEVERE, null, ex); + }*/ + Main.abcMainFrame.sourceTextArea.setBodyIndex(bi, abc); + } + for (Highlighting h : highlights) { + if ((pos >= h.startPos) && (pos < h.startPos + h.len)) { + try { + Main.abcMainFrame.sourceTextArea.selectInstruction(abc.bodies[bi].code.adr2pos(h.offset)); + + } catch (ConvertException ex) { + } + break; + } + } + } + } + + } + + public void mouseReleased(MouseEvent e) { + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DialogMissingSymbolHandler.java b/trunk/src/com/jpexs/asdec/abc/gui/DialogMissingSymbolHandler.java new file mode 100644 index 000000000..ea519dd5b --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/DialogMissingSymbolHandler.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.abc.avm2.parser.MissingSymbolHandler; + +import javax.swing.*; + + +public class DialogMissingSymbolHandler implements MissingSymbolHandler { + + public boolean missingString(String value) { + return JOptionPane.showConfirmDialog(null, "String \"" + value + "\" is not present in constants table. Do you want to add it?", "Add String", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION; + } + + public boolean missingInt(long value) { + return JOptionPane.showConfirmDialog(null, "Integer value \"" + value + "\" is not present in constants table. Do you want to add it?", "Add Integer", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION; + } + + public boolean missingUInt(long value) { + return JOptionPane.showConfirmDialog(null, "Unsigned integer value \"" + value + "\" is not present in constants table. Do you want to add it?", "Add Unsigned integer", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION; + } + + public boolean missingDouble(double value) { + return JOptionPane.showConfirmDialog(null, "Double value \"" + value + "\" is not present in constants table. Do you want to add it?", "Add Double", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/IconListRenderer.java b/trunk/src/com/jpexs/asdec/abc/gui/IconListRenderer.java new file mode 100644 index 000000000..cd28dea4d --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/IconListRenderer.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import javax.swing.*; +import java.awt.*; + + +public class IconListRenderer + extends DefaultListCellRenderer { + + private Icon constIcon; + private Icon functionIcon; + private Icon variableIcon; + + private Icon loadIcon(String path) { + ClassLoader cldr = this.getClass().getClassLoader(); + java.net.URL imageURL = cldr.getResource(path); + return new ImageIcon(imageURL); + } + + public IconListRenderer() { + constIcon = loadIcon("com/jpexs/asdec/abc/gui/graphics/constant.png"); + functionIcon = loadIcon("com/jpexs/asdec/abc/gui/graphics/function.png"); + variableIcon = loadIcon("com/jpexs/asdec/abc/gui/graphics/variable.png"); + } + + @Override + public Component getListCellRendererComponent( + JList list, Object value, int index, + boolean isSelected, boolean cellHasFocus) { + + // Get the renderer component from parent class + + JLabel label = + (JLabel) super.getListCellRendererComponent(list, + value, index, isSelected, cellHasFocus); + + // Get icon to use for the list item value + + String modifiersRegex = "(public |static |final |override |private |protected |package )*"; + + if (value.toString().matches(modifiersRegex + "const .*")) + label.setIcon(constIcon); + if (value.toString().matches(modifiersRegex + "var .*")) + label.setIcon(variableIcon); + if (value.toString().matches(modifiersRegex + "function .*")) + label.setIcon(functionIcon); + if (value.toString().equals(TraitsListModel.STR_CLASS_INITIALIZER)) + label.setIcon(functionIcon); + if (value.toString().equals(TraitsListModel.STR_INSTANCE_INITIALIZER)) + label.setIcon(functionIcon); + return label; + } + +} + diff --git a/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java new file mode 100644 index 000000000..04c123542 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/MainFrame.java @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.gui.tablemodels.*; +import com.jpexs.asdec.gui.LoadingPanel; +import com.jpexs.asdec.gui.View; +import com.jpexs.asdec.tags.DoABCTag; +import jsyntaxpane.DefaultSyntaxKit; + +import javax.swing.*; +import javax.swing.border.BevelBorder; +import javax.swing.table.*; +import java.awt.*; +import java.awt.event.*; +import java.io.IOException; +import java.util.List; + + +public class MainFrame extends JFrame implements ActionListener, ItemListener { + + public ASMSourceEditorPane sourceTextArea; + public TraitsList navigator; + public ClassesListTree classTree; + public ABC abc; + public List list; + public JComboBox abcComboBox; + public int listIndex = 0; + public DecompiledEditorPane decompiledTextArea; + public JScrollPane decompiledScrollPane; + public JSplitPane splitPane1; + public JSplitPane splitPane2; + public JSplitPane splitPane3; + //private ConstantsListModel constantListModel; + private JTable constantTable; + //private JList constantsList; + public JComboBox constantTypeList; + public JPanel statusPanel = new JPanel(); + public LoadingPanel loadingPanel = new LoadingPanel(20, 20); + public JLabel statusLabel = new JLabel(""); + public JLabel asmLabel = new JLabel("Disassembled code:"); + public JLabel decLabel = new JLabel("Decompiled code:"); + + public void setStatus(String s) { + if (s.equals("")) { + //statusLabel.setOpaque(false); + loadingPanel.setVisible(false); + } else { + loadingPanel.setVisible(true); + //statusLabel.setForeground(Color.white); + //statusLabel.setBackground(Color.red); + //statusLabel.setOpaque(true); + } + statusLabel.setText(s); + } + + + public JTable autoResizeColWidth(JTable table, TableModel model) { + table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + table.setModel(model); + + int margin = 5; + + for (int i = 0; i < table.getColumnCount(); i++) { + int vColIndex = i; + DefaultTableColumnModel colModel = (DefaultTableColumnModel) table.getColumnModel(); + TableColumn col = colModel.getColumn(vColIndex); + int width = 0; + + // Get width of column header + TableCellRenderer renderer = col.getHeaderRenderer(); + + if (renderer == null) { + renderer = table.getTableHeader().getDefaultRenderer(); + } + + Component comp = renderer.getTableCellRendererComponent(table, col.getHeaderValue(), false, false, 0, 0); + + width = comp.getPreferredSize().width; + + // Get maximum width of column data + for (int r = 0; r < table.getRowCount(); r++) { + renderer = table.getCellRenderer(r, vColIndex); + comp = renderer.getTableCellRendererComponent(table, table.getValueAt(r, vColIndex), false, false, + r, vColIndex); + width = Math.max(width, comp.getPreferredSize().width); + } + + // Add margin + width += 2 * margin; + + // Set the width + col.setPreferredWidth(width); + } + + ((DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer()).setHorizontalAlignment( + SwingConstants.LEFT); + + // table.setAutoCreateRowSorter(true); + table.getTableHeader().setReorderingAllowed(false); + + return table; + } + + public void updateConstList() { + switch (constantTypeList.getSelectedIndex()) { + case 0: + autoResizeColWidth(constantTable, new UIntTableModel(abc)); + break; + case 1: + autoResizeColWidth(constantTable, new IntTableModel(abc)); + break; + case 2: + autoResizeColWidth(constantTable, new DoubleTableModel(abc)); + break; + case 3: + autoResizeColWidth(constantTable, new StringTableModel(abc)); + break; + case 4: + autoResizeColWidth(constantTable, new NamespaceTableModel(abc)); + break; + case 5: + autoResizeColWidth(constantTable, new NamespaceSetTableModel(abc)); + break; + case 6: + autoResizeColWidth(constantTable, new MultinameTableModel(abc)); + break; + } + //DefaultTableColumnModel colModel = (DefaultTableColumnModel) constantTable.getColumnModel(); + //colModel.getColumn(0).setMaxWidth(50); + } + + public void switchAbc(int index) { + listIndex = index; + this.abc = list.get(listIndex).abc; + classTree.setABC(abc); + decompiledTextArea.setABC(abc); + navigator.setABC(abc); + //constantTypeList = new JComboBox(new String[]{"UINT", "INT", "DOUBLE", "STRING", "NAMESPACE", "NAMESPACESET", "MULTINAME"}); + updateConstList(); + + } + + + public MainFrame(List list) { + + View.setWindowIcon(this); + + DefaultSyntaxKit.initKit(); + + this.list = list; + setSize(800, 600); + this.abc = list.get(listIndex).abc; + getContentPane().setLayout(new BorderLayout()); + //codeView = new CodeViewPanel(abc); + //codeView + sourceTextArea = new ASMSourceEditorPane(); + + JPanel rightPanel = new JPanel(); + rightPanel.setLayout(new BorderLayout()); + rightPanel.add(new JScrollPane(sourceTextArea), BorderLayout.CENTER); + sourceTextArea.setContentType("text/flasm3"); + JPanel buttonsPan = new JPanel(); + buttonsPan.setLayout(new FlowLayout()); + JButton verifyButton = new JButton("Verify"); + verifyButton.setActionCommand("VERIFYBODY"); + verifyButton.addActionListener(this); + + JButton saveButton = new JButton("Save"); + saveButton.setActionCommand("SAVEBODY"); + saveButton.addActionListener(this); + + + //buttonsPan.add(verifyButton); + buttonsPan.add(saveButton); + rightPanel.add(buttonsPan, BorderLayout.SOUTH); + decompiledTextArea = new DecompiledEditorPane(); + + decompiledScrollPane = new JScrollPane(decompiledTextArea); + + JPanel panA = new JPanel(); + panA.setLayout(new BorderLayout()); + panA.add(rightPanel, BorderLayout.CENTER); + panA.add(asmLabel, BorderLayout.NORTH); + asmLabel.setHorizontalAlignment(SwingConstants.CENTER); + asmLabel.setBorder(new BevelBorder(BevelBorder.RAISED)); + JPanel panB = new JPanel(); + panB.setLayout(new BorderLayout()); + panB.add(decompiledScrollPane, BorderLayout.CENTER); + panB.add(decLabel, BorderLayout.NORTH); + decLabel.setHorizontalAlignment(SwingConstants.CENTER); + decLabel.setBorder(new BevelBorder(BevelBorder.RAISED)); + splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + panB, panA); + decompiledTextArea.setContentType("text/actionscript"); + + JPanel pan2 = new JPanel(); + pan2.setLayout(new BorderLayout()); + pan2.add((abcComboBox = new JComboBox(new ABCComboBoxModel(list))), BorderLayout.NORTH); + + navigator = new TraitsList(); + navigator.setABC(abc); + + JTabbedPane tabbedPane = new JTabbedPane(); + tabbedPane.addTab("Traits", new JScrollPane(navigator)); + splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, + new JScrollPane(classTree = new ClassesListTree(abc)), + tabbedPane); + + pan2.add(splitPane2, BorderLayout.CENTER); + abcComboBox.addItemListener(this); + + + splitPane3 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + pan2, + splitPane1); + + pan2.setPreferredSize(new Dimension(300, 200)); + + + loadingPanel.setPreferredSize(new Dimension(30, 30)); + statusPanel = new JPanel(); + statusPanel.setPreferredSize(new Dimension(1, 30)); + statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); + statusPanel.setLayout(new BorderLayout()); + statusPanel.add(loadingPanel, BorderLayout.WEST); + statusPanel.add(statusLabel, BorderLayout.CENTER); + loadingPanel.setVisible(false); + + + getContentPane().add(splitPane3, BorderLayout.CENTER); + getContentPane().add(statusPanel, BorderLayout.SOUTH); + addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + if (Main.proxyFrame != null) { + if (Main.proxyFrame.isVisible()) return; + } + Main.exit(); + } + }); + setTitle(Main.applicationName + " - " + Main.getFileTitle()); + + JMenuBar menuBar = new JMenuBar(); + + JMenu menuFile = new JMenu("File"); + JMenuItem miOpen = new JMenuItem("Open..."); + miOpen.setActionCommand("OPEN"); + miOpen.addActionListener(this); + JMenuItem miSave = new JMenuItem("Save"); + miSave.setActionCommand("SAVE"); + miSave.addActionListener(this); + JMenuItem miSaveAs = new JMenuItem("Save as..."); + miSaveAs.setActionCommand("SAVEAS"); + miSaveAs.addActionListener(this); + JMenuItem miExport = new JMenuItem("Export..."); + miExport.setActionCommand("EXPORT"); + miExport.addActionListener(this); + menuFile.add(miOpen); + menuFile.add(miSave); + menuFile.add(miSaveAs); + menuFile.add(miExport); + menuFile.addSeparator(); + JMenuItem miClose = new JMenuItem("Exit"); + miClose.setActionCommand("EXIT"); + miClose.addActionListener(this); + menuFile.add(miClose); + menuBar.add(menuFile); + + JMenu menuTools = new JMenu("Tools"); + JMenuItem miProxy = new JMenuItem("Proxy"); + miProxy.setActionCommand("SHOWPROXY"); + miProxy.setIcon(new ImageIcon(View.loadImage("com/jpexs/asdec/gui/graphics/proxy16.png"))); + miProxy.addActionListener(this); + menuTools.add(miProxy); + menuBar.add(menuTools); + + setJMenuBar(menuBar); + + /* Constants */ + JPanel panConstants = new JPanel(); + panConstants.setLayout(new BorderLayout()); + constantTypeList = new JComboBox(new String[]{"UINT", "INT", "DOUBLE", "STRING", "NAMESPACE", "NAMESPACESET", "MULTINAME"}); + constantTable = new JTable(); + autoResizeColWidth(constantTable, new UIntTableModel(abc)); + constantTable.setAutoCreateRowSorter(true); + constantTypeList.addItemListener(this); + panConstants.add(constantTypeList, BorderLayout.NORTH); + panConstants.add(new JScrollPane(constantTable), BorderLayout.CENTER); + tabbedPane.addTab("Constants", panConstants); + View.centerScreen(this); + + } + + public void actionPerformed(ActionEvent e) { + if (Main.isWorking()) return; + if (e.getActionCommand().equals("SHOWPROXY")) { + Main.showProxy(); + } + if (e.getActionCommand().equals("VERIFYBODY")) { + sourceTextArea.verify(abc.constants, abc); + } + if (e.getActionCommand().equals("SAVEBODY")) { + sourceTextArea.save(abc.constants); + } + if (e.getActionCommand().equals("SAVE")) { + try { + Main.saveFile(Main.file); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + if (e.getActionCommand().equals("SAVEAS")) { + if (Main.saveFileDialog(this)) { + setTitle(Main.applicationName + " - " + Main.getFileTitle()); + } + } + if (e.getActionCommand().equals("OPEN")) { + Main.openFileDialog(); + + } + + if (e.getActionCommand().equals("EXPORT")) { + JFileChooser chooser = new JFileChooser(); + chooser.setCurrentDirectory(new java.io.File(".")); + chooser.setDialogTitle("Select directory to export"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setAcceptAllFileFilterUsed(false); + if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { + Main.startWork("Exporting..."); + final String selFile = chooser.getSelectedFile().getAbsolutePath(); + (new Thread() { + + @Override + public void run() { + try { + for (DoABCTag tag : list) { + tag.abc.export(selFile); + } + } catch (IOException ignored) { + JOptionPane.showMessageDialog(null, "Cannot write to the file"); + } + Main.stopWork(); + } + }).start(); + + } + + } + if (e.getActionCommand().equals("EXIT")) { + setVisible(false); + if (Main.proxyFrame != null) { + if (Main.proxyFrame.isVisible()) return; + } + Main.exit(); + } + } + + public void itemStateChanged(ItemEvent e) { + if (e.getSource() == abcComboBox) { + int index = ((JComboBox) e.getSource()).getSelectedIndex(); + if (index == -1) { + return; + } + switchAbc(index); + } + if (e.getSource() == constantTypeList) { + int index = ((JComboBox) e.getSource()).getSelectedIndex(); + if (index == -1) { + return; + } + updateConstList(); + } + } + + public void display() { + setVisible(true); + + splitPane2.setDividerLocation(0.5); //Traitlist-classtree + + //splitPane3.setDividerLocation(0.1); //classtree|right + + splitPane1.setDividerLocation(0.5); //disassembled|decompiled + + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java b/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java new file mode 100644 index 000000000..c2e8c5899 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/TraitsList.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.abc.ABC; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + + +public class TraitsList extends JList implements ListSelectionListener { + ABC abc; + int classIndex = -1; + + public TraitsList() { + addListSelectionListener(this); + setCellRenderer(new IconListRenderer()); + } + + public void setABC(ABC abc) { + this.abc = abc; + if (classIndex != -1) + setModel(new TraitsListModel(abc, classIndex)); + } + + public void setClassIndex(int classIndex) { + if (abc != null) + setModel(new TraitsListModel(abc, classIndex)); + this.classIndex = classIndex; + + } + + public void valueChanged(ListSelectionEvent e) { + + int index = getSelectedIndex(); + if (index == -1) + return; + Main.abcMainFrame.decompiledTextArea.gotoTrait(index); + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java b/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java new file mode 100644 index 000000000..020da6101 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/TraitsListModel.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.*; +import javax.swing.event.ListDataListener; + + +public class TraitsListModel implements ListModel { + ABC abc; + int classIndex; + + public static final String STR_INSTANCE_INITIALIZER = "instance initializer"; + public static final String STR_CLASS_INITIALIZER = "class initializer"; + + public TraitsListModel(ABC abc, int classIndex) { + this.abc = abc; + this.classIndex = classIndex; + } + + public int getSize() { + int cnt = abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length; + //if(abc.instance_info[classIndex].iinit_index!=0) cnt++; + cnt += 2; + return cnt; + } + + public Object getElementAt(int index) { + if (index < abc.class_info[classIndex].static_traits.traits.length) { + return abc.class_info[classIndex].static_traits.traits[index].convert(abc.constants, abc.method_info, true); + } else if (index < abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length) { + return abc.instance_info[classIndex].instance_traits.traits[index - abc.class_info[classIndex].static_traits.traits.length].convert(abc.constants, abc.method_info, false); + } else if (index == abc.class_info[classIndex].static_traits.traits.length + abc.instance_info[classIndex].instance_traits.traits.length) { + return STR_INSTANCE_INITIALIZER; + } else { + return STR_CLASS_INITIALIZER; + } + } + + public void addListDataListener(ListDataListener l) { + + } + + public void removeListDataListener(ListDataListener l) { + + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/TreePart.java b/trunk/src/com/jpexs/asdec/abc/gui/TreePart.java new file mode 100644 index 000000000..f2fb50fed --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/TreePart.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.gui; + + +public class TreePart implements Comparable { + + public String path; + public String name; + public int classIndex; + public boolean hasSubParts = false; + + public TreePart(String path, String name, int classIndex) { + this.path = path; + this.name = name; + this.classIndex = classIndex; + } + + @Override + public String toString() { + return name; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TreePart other = (TreePart) obj; + if ((this.path == null) ? (other.path != null) : !this.path.equals(other.path)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 23 * hash + (this.path != null ? this.path.hashCode() : 0); + return hash; + } + + public int compareTo(Object o) { + if (o instanceof TreePart) { + if (((TreePart) o).hasSubParts && (!hasSubParts)) return 1; + if ((!((TreePart) o).hasSubParts) && (hasSubParts)) return -1; + return (path + "." + name).compareTo(((TreePart) o).path + "." + ((TreePart) o).name); + } + return -1; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/gui/graphics/class.png b/trunk/src/com/jpexs/asdec/abc/gui/graphics/class.png new file mode 100644 index 000000000..1d30295f9 Binary files /dev/null and b/trunk/src/com/jpexs/asdec/abc/gui/graphics/class.png differ diff --git a/trunk/src/com/jpexs/asdec/abc/gui/graphics/constant.png b/trunk/src/com/jpexs/asdec/abc/gui/graphics/constant.png new file mode 100644 index 000000000..c6ddca761 Binary files /dev/null and b/trunk/src/com/jpexs/asdec/abc/gui/graphics/constant.png differ diff --git a/trunk/src/com/jpexs/asdec/abc/gui/graphics/function.png b/trunk/src/com/jpexs/asdec/abc/gui/graphics/function.png new file mode 100644 index 000000000..2c1b83afc Binary files /dev/null and b/trunk/src/com/jpexs/asdec/abc/gui/graphics/function.png differ diff --git a/trunk/src/com/jpexs/asdec/abc/gui/graphics/variable.png b/trunk/src/com/jpexs/asdec/abc/gui/graphics/variable.png new file mode 100644 index 000000000..0fe224d56 Binary files /dev/null and b/trunk/src/com/jpexs/asdec/abc/gui/graphics/variable.png differ diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/DoubleTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/DoubleTableModel.java new file mode 100644 index 000000000..b7d4e6a1a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/DoubleTableModel.java @@ -0,0 +1,131 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class DoubleTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Value"}; + private static final Class classes[] = new Class[]{Long.class, String.class}; + + public DoubleTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_double.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 2; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + if (columnIndex == 0) return rowIndex; + else if (Double.isNaN(abc.constants.constant_double[rowIndex])) { + return "NaN"; + } else { + return "" + abc.constants.constant_double[rowIndex]; + } + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/IntTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/IntTableModel.java new file mode 100644 index 000000000..f2d797dbd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/IntTableModel.java @@ -0,0 +1,127 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class IntTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Value"}; + private static final Class classes[] = new Class[]{Long.class, Long.class}; + + public IntTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_int.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 2; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + if (columnIndex == 0) return rowIndex; + else return abc.constants.constant_int[rowIndex]; + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/MultinameTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/MultinameTableModel.java new file mode 100644 index 000000000..3f0942e1e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/MultinameTableModel.java @@ -0,0 +1,146 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class MultinameTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Kind", "Name", "Namespace", "NamespaceSet"}; + private static final Class classes[] = new Class[]{Long.class, String.class, String.class, String.class, String.class}; + + public MultinameTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_multiname.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 5; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + switch (columnIndex) { + case 0: + return rowIndex; + case 1: + if (rowIndex == 0) return ""; + return abc.constants.constant_multiname[rowIndex].getKindStr(); + case 2: + if (rowIndex == 0) return ""; + if (abc.constants.constant_multiname[rowIndex].name_index == -1) return ""; + return abc.constants.constant_multiname[rowIndex].getName(abc.constants); + case 3: + if (rowIndex == 0) return ""; + if (abc.constants.constant_multiname[rowIndex].namespace_index == -1) return ""; + return abc.constants.constant_multiname[rowIndex].getNamespace(abc.constants).getNameWithKind(abc.constants); + case 4: + if (rowIndex == 0) return ""; + if (abc.constants.constant_multiname[rowIndex].namespace_set_index == -1) return ""; + return abc.constants.constant_multiname[rowIndex].getNamespaceSet(abc.constants).toString(abc.constants); + default: + return null; + } + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceSetTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceSetTableModel.java new file mode 100644 index 000000000..3e80df5f5 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceSetTableModel.java @@ -0,0 +1,134 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class NamespaceSetTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "NameSpaces"}; + private static final Class classes[] = new Class[]{Long.class, String.class, String.class}; + + public NamespaceSetTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_namespace_set.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 2; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + switch (columnIndex) { + case 0: + return rowIndex; + case 1: + if (rowIndex == 0) return ""; + return abc.constants.constant_namespace_set[rowIndex].toString(abc.constants); + default: + return null; + } + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceTableModel.java new file mode 100644 index 000000000..b02f3fa28 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/NamespaceTableModel.java @@ -0,0 +1,137 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class NamespaceTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Kind", "Name"}; + private static final Class classes[] = new Class[]{Long.class, String.class, String.class}; + + public NamespaceTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_namespace.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 3; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + switch (columnIndex) { + case 0: + return rowIndex; + case 1: + if (rowIndex == 0) return ""; + return abc.constants.constant_namespace[rowIndex].getKindStr(); + case 2: + if (rowIndex == 0) return ""; + return abc.constants.constant_namespace[rowIndex].getName(abc.constants); + default: + return null; + } + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/StringTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/StringTableModel.java new file mode 100644 index 000000000..e370192d8 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/StringTableModel.java @@ -0,0 +1,127 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class StringTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Value"}; + private static final Class classes[] = new Class[]{Long.class, String.class}; + + public StringTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_string.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 2; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + if (columnIndex == 0) return rowIndex; + else return abc.constants.constant_string[rowIndex]; + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/UIntTableModel.java b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/UIntTableModel.java new file mode 100644 index 000000000..507c2954a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/gui/tablemodels/UIntTableModel.java @@ -0,0 +1,127 @@ +package com.jpexs.asdec.abc.gui.tablemodels; + +import com.jpexs.asdec.abc.ABC; + +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; + +public class UIntTableModel implements TableModel { + private ABC abc; + private static final String columnNames[] = new String[]{"Index", "Value"}; + private static final Class classes[] = new Class[]{Long.class, Long.class}; + + public UIntTableModel(ABC abc) { + this.abc = abc; + } + + /** + * Returns the number of rows in the model. A + * JTable uses this method to determine how many rows it + * should display. This method should be quick, as it + * is called frequently during rendering. + * + * @return the number of rows in the model + * @see #getColumnCount + */ + public int getRowCount() { + return abc.constants.constant_uint.length; + } + + /** + * Returns the number of columns in the model. A + * JTable uses this method to determine how many columns it + * should create and display by default. + * + * @return the number of columns in the model + * @see #getRowCount + */ + public int getColumnCount() { + return 2; + } + + /** + * Returns the name of the column at columnIndex. This is used + * to initialize the table's column header name. Note: this name does + * not need to be unique; two columns in a table can have the same name. + * + * @param columnIndex the index of the column + * @return the name of the column + */ + public String getColumnName(int columnIndex) { + return columnNames[columnIndex]; + } + + /** + * Returns the most specific superclass for all the cell values + * in the column. This is used by the JTable to set up a + * default renderer and editor for the column. + * + * @param columnIndex the index of the column + * @return the common ancestor class of the object values in the model. + */ + public Class getColumnClass(int columnIndex) { + return classes[columnIndex]; + } + + /** + * Returns true if the cell at rowIndex and + * columnIndex + * is editable. Otherwise, setValueAt on the cell will not + * change the value of that cell. + * + * @param rowIndex the row whose value to be queried + * @param columnIndex the column whose value to be queried + * @return true if the cell is editable + * @see #setValueAt + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + /** + * Returns the value for the cell at columnIndex and + * rowIndex. + * + * @param rowIndex the row whose value is to be queried + * @param columnIndex the column whose value is to be queried + * @return the value Object at the specified cell + */ + public Object getValueAt(int rowIndex, int columnIndex) { + if (columnIndex == 0) return rowIndex; + else return abc.constants.constant_uint[rowIndex]; + } + + /** + * Sets the value in the cell at columnIndex and + * rowIndex to aValue. + * + * @param aValue the new value + * @param rowIndex the row whose value is to be changed + * @param columnIndex the column whose value is to be changed + * @see #getValueAt + * @see #isCellEditable + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + + } + + /** + * Adds a listener to the list that is notified each time a change + * to the data model occurs. + * + * @param l the TableModelListener + */ + public void addTableModelListener(TableModelListener l) { + + } + + /** + * Removes a listener from the list that is notified each time a + * change to the data model occurs. + * + * @param l the TableModelListener + */ + public void removeTableModelListener(TableModelListener l) { + + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/ABCException.java b/trunk/src/com/jpexs/asdec/abc/types/ABCException.java new file mode 100644 index 000000000..aefb50982 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/ABCException.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.ConvertException; +import com.jpexs.asdec.helpers.Helper; + + +public class ABCException { + public int start; + public int end; + public int target; + public int type_index; + public int name_index; + + @Override + public String toString() { + return "Exception: startServer=" + Helper.formatAddress(start) + " end=" + Helper.formatAddress(end) + " target=" + target + " type_index=" + type_index + " name_index=" + name_index; + } + + public String toString(ConstantPool constants) { + return "Exception: startServer=" + Helper.formatAddress(start) + " end=" + Helper.formatAddress(end) + " target=" + target + " type=\"" + getTypeName(constants) + "\" name=\"" + getVarName(constants) + "\""; + } + + public String toString(ConstantPool constants, AVM2Code code) { + try { + return "Exception: startServer=" + code.adr2pos(start) + ":" + code.code.get(code.adr2pos(start)).toStringNoAddress(constants) + " end=" + code.adr2pos(end) + ":" + code.code.get(code.adr2pos(end)).toStringNoAddress(constants) + " target=" + code.adr2pos(target) + ":" + code.code.get(code.adr2pos(target)).toStringNoAddress(constants) + " type=\"" + getTypeName(constants) + "\" name=\"" + getVarName(constants) + "\""; + } catch (ConvertException ex) { + return ""; + } + } + + public boolean isFinally() { + return (name_index == 0) && (type_index == 0); + } + + public String getVarName(ConstantPool constants) { + if (name_index == 0) return ""; + return constants.constant_multiname[name_index].getName(constants); + } + + public String getTypeName(ConstantPool constants) { + if (type_index == 0) return "*"; + return constants.constant_multiname[type_index].getName(constants); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/ClassInfo.java b/trunk/src/com/jpexs/asdec/abc/types/ClassInfo.java new file mode 100644 index 000000000..ac1f5e33f --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/ClassInfo.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.types.traits.Traits; + + +public class ClassInfo { + + public int cinit_index; //MethodInfo - static initializer + public Traits static_traits; + + @Override + public String toString() { + return "method_index=" + cinit_index + "\r\n" + static_traits.toString(); + } + + + public String toString(ConstantPool constants) { + return "method_index=" + cinit_index + "\r\n" + static_traits.toString(constants); + } + + public String getStaticVarsStr(ConstantPool constants) { + return static_traits.convert(constants, "\tstatic "); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java b/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java new file mode 100644 index 000000000..8946353ef --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/InstanceInfo.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.types.traits.Traits; +import com.jpexs.asdec.helpers.Helper; + + +public class InstanceInfo { + + public int name_index; + public int super_index; + public int flags; // 1 = sealed, 0 = dynamic, 2 = final, 4 = interface, 8 = ProtectedNs + public int protectedNS; //if flags & 8 + public int interfaces[]; + public int iinit_index; // MethodInfo - constructor + public Traits instance_traits; + + public static final int CLASS_SEALED = 1; //not dynamic + public static final int CLASS_FINAL = 2; + public static final int CLASS_INTERFACE = 4; + public static final int CLASS_PROTECTEDNS = 8; + + @Override + public String toString() { + return "name_index=" + name_index + " super_index=" + super_index + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(); + } + + + public String toString(ConstantPool constants) { + String supIndexStr = "[nothing]"; + if (super_index > 0) + constants.constant_multiname[super_index].toString(constants); + return "name_index=" + constants.constant_multiname[name_index].toString(constants) + " super_index=" + supIndexStr + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(constants); + } + + public String getClassHeaderStr(ConstantPool constants) { + String supIndexStr = ""; + if (super_index > 0) + supIndexStr = " extends " + constants.constant_multiname[super_index].getName(constants);////+" flags="+flags+" protectedNS="+protectedNS+" interfaces="+Helper.intArrToString(interfaces)+" method_index="+iinit_index + String modifiers = ""; + Namespace ns = constants.constant_multiname[name_index].getNamespace(constants); + modifiers = ns.getPrefix(constants); + if (!modifiers.equals("")) modifiers += " "; + + if ((flags & CLASS_FINAL) == CLASS_FINAL) { + modifiers = "final "; + } + if ((flags & CLASS_SEALED) == 0) { + modifiers = modifiers + "dynamic "; + } + String objType = "class "; + if ((flags & CLASS_INTERFACE) == CLASS_INTERFACE) { + objType = "interface "; + } + return modifiers + objType + constants.constant_multiname[name_index].getName(constants) + supIndexStr; + } + + public String getInstanceVarsStr(ConstantPool constants) { + return instance_traits.convert(constants, "\t"); + } + + public Multiname getName(ConstantPool constants) { + return constants.constant_multiname[name_index]; + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/MetadataInfo.java b/trunk/src/com/jpexs/asdec/abc/types/MetadataInfo.java new file mode 100644 index 000000000..667c12da6 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/MetadataInfo.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.helpers.Helper; + + +public class MetadataInfo { + + public int name_index; + public int keys[]; + public int values[]; + + public MetadataInfo(int name_index, int[] keys, int[] values) { + this.name_index = name_index; + this.keys = keys; + this.values = values; + } + + @Override + public String toString() { + return "name_index=" + name_index + " keys=" + Helper.intArrToString(keys) + " values=" + Helper.intArrToString(values); + } + + public String toString(ConstantPool constants) { + String s = "name=" + constants.constant_string[name_index]; + if (keys.length > 0) s += "\r\n"; + for (int i = 0; i < keys.length; i++) { + if (keys[i] == 0) { + s += "\"" + constants.constant_string[values[i]] + "\"\r\n"; + } else { + s += "\"" + constants.constant_string[keys[i]] + "\"=\"" + constants.constant_string[values[i]] + "\"\r\n"; + } + } + return s; + } + +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java new file mode 100644 index 000000000..9bc15c7e3 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/MethodBody.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.ABC; +import com.jpexs.asdec.abc.avm2.AVM2Code; +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition; +import com.jpexs.asdec.abc.types.traits.Traits; + + +public class MethodBody implements Cloneable { + + public int method_info; + public int max_stack; + public int max_regs; + public int scope_depth; + public int max_scope; + public byte codeBytes[]; + public AVM2Code code; + public ABCException exceptions[] = new ABCException[0]; + public Traits traits = new Traits(); + + @Override + public String toString() { + String s = ""; + s += "method_info=" + method_info + " max_stack=" + max_stack + " max_regs=" + max_regs + " scope_depth=" + scope_depth + " max_scope=" + max_scope; + s += "\r\nCode:\r\n" + code.toString(); + return s; + } + + private String replaceParams(String code, MethodInfo method_info[]) { + for (int i = 1; i <= method_info[this.method_info].param_types.length; i++) { + code = code.replace(InstructionDefinition.localRegName(i), "param" + i); + } + return code; + } + + public String toString(boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[]) { + return toString(isStatic, classIndex, abc, constants, method_info, false); + } + + public String toString(boolean isStatic, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], boolean hilight) { + String s = ""; + + //s+="method_info="+method_info+" max_stack="+max_stack+" max_regs="+max_regs+" scope_depth="+scope_depth+" max_scope="+max_scope; + //s+="\r\nCode:\r\n"+ + + try { + s += code.toSource(isStatic, classIndex, abc, constants, method_info, this, hilight); + s = replaceParams(s, method_info); + } catch (Exception ex) { + s = "//error:" + ex.toString(); + } + //s+="----------- ORIGINAL ------------\r\n"; + //s+=code.toString(constants); + /*s+="Exceptions:"; + for(int i=0;i 0) { + optionalStr += ","; + } + optionalStr += optional[i].toString(); + } + } + optionalStr += "]"; + return "MethodInfo: param_types=" + Helper.intArrToString(param_types) + " ret_type=" + ret_type + " name_index=" + name_index + " flags=" + flags + " optional=" + optionalStr + " paramNames=" + Helper.intArrToString(paramNames); + } + + public String toString(ConstantPool constants) { + String optionalStr = "["; + if (optional != null) { + for (int i = 0; i < optional.length; i++) { + if (i > 0) { + optionalStr += ","; + } + optionalStr += optional[i].toString(constants); + } + } + optionalStr += "]"; + + String param_typesStr = ""; + for (int i = 0; i < param_types.length; i++) { + if (i > 0) { + param_typesStr += ","; + } + if (param_types[i] == 0) { + param_typesStr += "*"; + } else { + param_typesStr += constants.constant_multiname[param_types[i]].toString(constants); + } + } + + String paramNamesStr = ""; + for (int i = 0; i < paramNames.length; i++) { + if (i > 0) { + paramNamesStr += ","; + } + paramNamesStr += constants.constant_string[paramNames[i]]; + } + + String ret_typeStr = ""; + if (ret_type == 0) { + ret_typeStr += "*"; + } else { + ret_typeStr += constants.constant_multiname[ret_type].toString(constants); + } + + return "param_types=" + param_typesStr + " ret_type=" + ret_typeStr + " name=\"" + constants.constant_string[name_index] + "\" flags=" + flags + " optional=" + optionalStr + " paramNames=" + paramNamesStr; + } + + + public String getName(ConstantPool constants) { + if (name_index == 0) return "UNKNOWN"; + return constants.constant_string[name_index]; + } + + public String getParamStr(ConstantPool constants) { + String paramStr = ""; + for (int i = 0; i < param_types.length; i++) { + if (i > 0) { + paramStr += ", "; + } + if ((paramNames.length > i) && (paramNames[i] != 0)) { + paramStr += constants.constant_string[paramNames[i]]; + } else { + paramStr += "param" + (i + 1); + } + paramStr += ":"; + if (param_types[i] == 0) { + paramStr += "*"; + } else { + paramStr += constants.constant_multiname[param_types[i]].getName(constants); + } + if (optional != null) { + if (i >= param_types.length - optional.length) { + //System.out.println("param_types.length:"+param_types.length); + //System.out.println("optional.lengt:"+optional.length); + paramStr += "=" + optional[i - (param_types.length - optional.length)].toString(constants); + } + } + } + return paramStr; + } + + public String getReturnTypeStr(ConstantPool constants) { + if (ret_type == 0) return "*"; + return constants.constant_multiname[ret_type].getName(constants); + } +} + diff --git a/trunk/src/com/jpexs/asdec/abc/types/Multiname.java b/trunk/src/com/jpexs/asdec/abc/types/Multiname.java new file mode 100644 index 000000000..d11e9f03c --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/Multiname.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class Multiname { + + public static final int QNAME = 7; + public static final int QNAMEA = 13; + public static final int MULTINAME = 9; + public static final int MULTINAMEA = 14; + public static final int RTQNAME = 15; + public static final int RTQNAMEA = 16; + public static final int MULTINAMEL = 27; + public static final int RTQNAMEL = 17; + public static final int RTQNAMELA = 18; + private static final int multinameKinds[] = new int[]{QNAME, QNAMEA, MULTINAME, MULTINAMEA, RTQNAME, RTQNAMEA, MULTINAMEL, RTQNAMEL, RTQNAMELA}; + private static final String multinameKindNames[] = new String[]{"Qname", "QnameA", "Multiname", "MultinameA", "RTQname", "RTQnameA", "MultinameL", "RTQnameL", "RTQnameLA"}; + + + public int kind = -1; + public int name_index = -1; + public int namespace_index = -1; + public int namespace_set_index = -1; + + + public Multiname(int kind, int name_index, int namespace_index, int namespace_set_index) { + this.kind = kind; + this.name_index = name_index; + this.namespace_index = namespace_index; + this.namespace_set_index = namespace_set_index; + } + + public boolean isAttribute() { + if (kind == QNAMEA) return true; + if (kind == MULTINAMEA) return true; + if (kind == RTQNAMEA) return true; + if (kind == RTQNAMELA) return true; + return false; + } + + public boolean isRuntime() { + if (kind == RTQNAME) return true; + if (kind == RTQNAMEA) return true; + if (kind == MULTINAMEL) return true; + return false; + } + + public boolean needsName() { + if (kind == RTQNAMEL) return true; + if (kind == RTQNAMELA) return true; + if (kind == MULTINAMEL) return true; + return false; + } + + public boolean needsNs() { + if (kind == RTQNAME) return true; + if (kind == RTQNAMEA) return true; + if (kind == RTQNAMEL) return true; + if (kind == RTQNAMELA) return true; + return false; + } + + public String getKindStr() { + String kindStr = "?"; + for (int k = 0; k < multinameKinds.length; k++) { + if (multinameKinds[k] == kind) { + kindStr = multinameKindNames[k]; + break; + } + } + return kindStr; + } + + @Override + public String toString() { + String kindStr = getKindStr(); + return "kind=" + kindStr + " name_index=" + name_index + " namespace_index=" + namespace_index + " namespace_set_index=" + namespace_set_index; + + } + + public String toString(ConstantPool constants) { + String kindStr = "?"; + for (int k = 0; k < multinameKinds.length; k++) { + if (multinameKinds[k] == kind) { + kindStr = multinameKindNames[k] + " "; + break; + } + } + String nameStr = ""; + if (name_index > 0) { + nameStr = constants.constant_string[name_index]; + } + if (name_index == 0) { + nameStr = "*"; + } + String namespaceStr = ""; + if (namespace_index > 0) { + namespaceStr = constants.constant_namespace[namespace_index].toString(constants); + } + if (!namespaceStr.equals("")) + namespaceStr = namespaceStr + "."; + if (namespace_index == 0) { + namespaceStr = "*."; + } + String namespaceSetStr = ""; + if (namespace_set_index > 0) { + namespaceSetStr = " "; + } + //kindStr+" "+ + return namespaceStr + nameStr + namespaceSetStr; + + } + + public String getName(ConstantPool constants) { + if (name_index == -1) { + return ""; + } + if (name_index == 0) { + return "*"; + } else { + return (isAttribute() ? "@" : "") + constants.constant_string[name_index]; + } + } + + public Namespace getNamespace(ConstantPool constants) { + if ((namespace_index == 0) || (namespace_index == -1)) { + return null; + } else { + return constants.constant_namespace[namespace_index]; + } + } + + public NamespaceSet getNamespaceSet(ConstantPool constants) { + if (namespace_set_index == 0) { + return null; + } else { + return constants.constant_namespace_set[namespace_set_index]; + } + } +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/abc/types/Namespace.java b/trunk/src/com/jpexs/asdec/abc/types/Namespace.java new file mode 100644 index 000000000..368c169aa --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/Namespace.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class Namespace { + + public static final int nameSpaceKinds[] = new int[]{8, 5, 22, 23, 24, 25, 26}; + public static final String nameSpaceKindNames[] = new String[]{"Namespace", "PrivateNamespace", "PackageNamespace", "PackageInternalNamespace", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNamespace"}; + public static final String namePrefixes[] = new String[]{"", "private", "public", "", "protected", "explicit", ""}; + + public int kind; + public int name_index; + + public Namespace(int kind, int name_index) { + this.kind = kind; + this.name_index = name_index; + } + + public String getKindStr() { + String kindStr = "?"; + for (int k = 0; k < nameSpaceKinds.length; k++) { + if (nameSpaceKinds[k] == kind) { + kindStr = nameSpaceKindNames[k]; + break; + } + } + return kindStr; + } + + @Override + public String toString() { + + return "Namespace: kind=" + getKindStr() + " name_index=" + name_index; + } + + public String toString(ConstantPool constants) { + return getName(constants); //getPrefix(constants)+" "+getName(constants); + } + + public String getNameWithKind(ConstantPool constants) { + String kindStr = getKindStr(); + String nameStr = constants.constant_string[name_index]; + return kindStr + (nameStr.equals("") ? "" : " " + nameStr); + } + + public String getPrefix(ConstantPool constants) { + String kindStr = "?"; + for (int k = 0; k < nameSpaceKinds.length; k++) { + if (nameSpaceKinds[k] == kind) { + kindStr = namePrefixes[k]; + break; + } + } + return kindStr; + } + + public String getName(ConstantPool constants) { + return constants.constant_string[name_index]; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/NamespaceSet.java b/trunk/src/com/jpexs/asdec/abc/types/NamespaceSet.java new file mode 100644 index 000000000..b26a7ee13 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/NamespaceSet.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class NamespaceSet { + + public int namespaces[]; + + public String toString(ConstantPool constants) { + String s = ""; + for (int i = 0; i < this.namespaces.length; i++) { + if (i > 0) s += ", "; + s += constants.constant_namespace[namespaces[i]].getNameWithKind(constants); + } + return s; + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java b/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java new file mode 100644 index 000000000..b307e21e7 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/ScriptInfo.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.types.traits.Traits; + + +public class ScriptInfo { + + public int init_index; //MethodInfo + public Traits traits; + + @Override + public String toString() { + return "method_index=" + init_index + "\r\n" + traits.toString(); + } + + + public String toString(ConstantPool constants) { + return "method_index=" + init_index + "\r\n" + traits.toString(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/ValueKind.java b/trunk/src/com/jpexs/asdec/abc/types/ValueKind.java new file mode 100644 index 000000000..1a74e9747 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/ValueKind.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class ValueKind { + + public static final int CONSTANT_Int = 0x03;// integer + public static final int CONSTANT_UInt = 0x04;// uinteger + public static final int CONSTANT_Double = 0x06;// double + public static final int CONSTANT_Utf8 = 0x01;// string + public static final int CONSTANT_True = 0x0B;// - + public static final int CONSTANT_False = 0x0A;// - + public static final int CONSTANT_Null = 0x0C;// - + public static final int CONSTANT_Undefined = 0x00;// - + public static final int CONSTANT_Namespace = 0x08;// namespace + public static final int CONSTANT_PackageNamespace = 0x16;// namespace + public static final int CONSTANT_PackageInternalNs = 0x17;// Namespace + public static final int CONSTANT_ProtectedNamespace = 0x18;// Namespace + public static final int CONSTANT_ExplicitNamespace = 0x19;// Namespace + public static final int CONSTANT_StaticProtectedNs = 0x1A;// Namespace + public static final int CONSTANT_PrivateNs = 0x05;// namespace + private static final int optionalKinds[] = new int[]{0x03, 0x04, 0x06, 0x01, 0x0B, 0x0A, 0x0C, 0x00, 0x08, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x05}; + private static final String optionalKindNames[] = new String[]{"Int", "UInt", "Double", "Utf8", "True", "False", "Null", "Undefined", "Namespace", "PackageNamespace", "PackageInternalNs", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNs", "PrivateNs"}; + public int value_index; + public int value_kind; + + public ValueKind(int value_index, int value_kind) { + this.value_index = value_index; + this.value_kind = value_kind; + } + + @Override + public String toString() { + String s = ""; + s += value_index + ":"; + boolean found = false; + for (int i = 0; i < optionalKinds.length; i++) { + if (optionalKinds[i] == value_kind) { + s += optionalKindNames[i]; + found = true; + break; + } + } + if (!found) { + s += "?"; + } + return s; + } + + public String toString(ConstantPool constants) { + String ret = "?"; + switch (value_kind) { + case CONSTANT_Int: + ret = "" + constants.constant_int[value_index]; + break; + case CONSTANT_UInt: + ret = "" + constants.constant_uint[value_index]; + break; + case CONSTANT_Double: + ret = "" + constants.constant_double[value_index]; + break; + case CONSTANT_Utf8: + ret = "\"" + constants.constant_string[value_index] + "\""; + break; + case CONSTANT_True: + ret = "True"; + break; + case CONSTANT_False: + ret = "False"; + break; + case CONSTANT_Null: + ret = "Null"; + break; + case CONSTANT_Undefined: + ret = "Undefined"; + break; + case CONSTANT_Namespace: + ret = "" + constants.constant_namespace[value_index].getName(constants); + break; + case CONSTANT_PackageInternalNs: + ret = "" + constants.constant_namespace[value_index].getName(constants); + break; + case CONSTANT_ProtectedNamespace: + ret = "protected " + constants.constant_namespace[value_index].getName(constants); + break; + case CONSTANT_ExplicitNamespace: + ret = "explicit " + constants.constant_namespace[value_index].getName(constants); + break; + case CONSTANT_StaticProtectedNs: + ret = "static protected " + constants.constant_namespace[value_index].getName(constants); + break; + case CONSTANT_PrivateNs: + ret = "private " + constants.constant_namespace[value_index].getName(constants); + break; + } + return ret; + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java b/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java new file mode 100644 index 000000000..6519b3304 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/Trait.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.Multiname; +import com.jpexs.asdec.abc.types.Namespace; +import com.jpexs.asdec.helpers.Helper; + + +public class Trait { + + public int name_index; + public int kindType; + public int kindFlags; + public int metadata[] = new int[0]; + public long fileOffset; + public byte bytes[]; + public static final int ATTR_Final = 0x1; + public static final int ATTR_Override = 0x2; + public static final int ATTR_Metadata = 0x4; + + public static final int TRAIT_SLOT = 0; + public static final int TRAIT_METHOD = 1; + public static final int TRAIT_GETTER = 2; + public static final int TRAIT_SETTER = 3; + public static final int TRAIT_CLASS = 4; + public static final int TRAIT_FUNCTION = 5; + public static final int TRAIT_CONST = 6; + + + public String getModifiers(ConstantPool constants, boolean isStatic) { + String ret = ""; + if ((kindFlags & ATTR_Override) > 0) { + ret += "override"; + } + Multiname m = getMultiName(constants); + if (m != null) { + Namespace ns = m.getNamespace(constants); + if (ns != null) { + ret += " " + ns.getPrefix(constants); + } + } + if (isStatic) + ret += " static"; + if ((kindFlags & ATTR_Final) > 0) { + if (!isStatic) { + ret += " final"; + } + } + return ret.trim(); + } + + @Override + public String toString() { + return "name_index=" + name_index + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); + } + + public String toString(ConstantPool constants) { + return constants.constant_multiname[name_index].toString(constants) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); + } + + public String convert(ConstantPool constants, MethodInfo[] methodInfo) { + return convert(constants, methodInfo, false); + } + + public String convert(ConstantPool constants, MethodInfo[] methodInfo, boolean isStatic) { + return constants.constant_multiname[name_index].toString(constants) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); + } + + public Multiname getMultiName(ConstantPool constants) { + if (name_index == 0) { + return null; + } else { + return constants.constant_multiname[name_index]; + } + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java new file mode 100644 index 000000000..627ffcc96 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitClass.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.helpers.Helper; + + +public class TraitClass extends Trait { + + public int slot_id; + public int class_info; + + @Override + public String toString(ConstantPool constants) { + return "Class " + constants.constant_multiname[name_index].toString(constants) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java new file mode 100644 index 000000000..a46aca113 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitFunction.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.helpers.Helper; + + +public class TraitFunction extends Trait { + + public int slot_index; + public int method_info; + + @Override + public String toString(ConstantPool constants) { + return "Function " + constants.constant_multiname[name_index].toString(constants) + " slot=" + slot_index + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); + } +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java new file mode 100644 index 000000000..b127b6422 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitMethodGetterSetter.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.helpers.Helper; + + +public class TraitMethodGetterSetter extends Trait { + + public int disp_id; //compiler assigned value that helps overriding + public int method_info; + + @Override + public String toString(ConstantPool constants) { + return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " MethodGetterSetter " + constants.constant_multiname[name_index].toString(constants) + " disp_id=" + disp_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); + } + + @Override + public String convert(ConstantPool constants, MethodInfo[] methodInfo, boolean isStatic) { + String modifier = getModifiers(constants, isStatic) + " "; + if (modifier.equals(" ")) modifier = ""; + String addKind = ""; + if (kindType == TRAIT_GETTER) addKind = "get "; + if (kindType == TRAIT_SETTER) addKind = "set "; + return modifier + "function " + addKind + getMethodName(constants) + "(" + methodInfo[method_info].getParamStr(constants) + ") : " + methodInfo[method_info].getReturnTypeStr(constants); + } + + + public String getMethodName(ConstantPool constants) { + return constants.constant_multiname[name_index].getName(constants); + } + + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java new file mode 100644 index 000000000..4418cb08e --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/TraitSlotConst.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; +import com.jpexs.asdec.abc.avm2.treemodel.TreeItem; +import com.jpexs.asdec.abc.types.MethodInfo; +import com.jpexs.asdec.abc.types.ValueKind; +import com.jpexs.asdec.helpers.Helper; +import com.jpexs.asdec.helpers.Highlighting; + + +public class TraitSlotConst extends Trait { + + public int slot_id; + public int type_index; + public int value_index; + public int value_kind; + + public TreeItem assignedValue; + + @Override + public String toString(ConstantPool constants) { + String typeStr = "*"; + if (type_index > 0) { + typeStr = constants.constant_multiname[type_index].toString(constants); + } + return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " SlotConst " + constants.constant_multiname[name_index].toString(constants) + " slot=" + slot_id + " type=" + typeStr + " value=" + (new ValueKind(value_index, value_kind)).toString(constants) + " metadata=" + Helper.intArrToString(metadata); + } + + public String getNameValueStr(ConstantPool constants) { + String typeStr = "*"; + if (type_index > 0) { + typeStr = constants.constant_multiname[type_index].getName(constants); + } + String valueStr = ""; + if (value_kind != 0) { + valueStr = " = " + (new ValueKind(value_index, value_kind)).toString(constants); + } + + if (assignedValue != null) { + valueStr = " = " + Highlighting.stripHilights(assignedValue.toString(constants)); + } + + String slotconst = "var"; + if (kindType == TRAIT_CONST) { + slotconst = "const"; + } + return slotconst + " " + constants.constant_multiname[name_index].getName(constants) + ":" + typeStr + valueStr; + } + + @Override + public String convert(ConstantPool constants, MethodInfo[] methodInfo, boolean isStatic) { + String modifier = getModifiers(constants, isStatic) + " "; + if (modifier.equals(" ")) modifier = ""; + return modifier + getNameValueStr(constants); + } + +} diff --git a/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java b/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java new file mode 100644 index 000000000..84431ffd8 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/abc/types/traits/Traits.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010. JPEXS + */ + +package com.jpexs.asdec.abc.types.traits; + +import com.jpexs.asdec.abc.avm2.ConstantPool; + + +public class Traits { + public Trait traits[] = new Trait[0]; + + @Override + public String toString() { + String s = ""; + for (int t = 0; t < traits.length; t++) { + if (t > 0) s += "\r\n"; + s += traits[t].toString(); + } + return s; + } + + + public String toString(ConstantPool constants) { + String s = ""; + for (int t = 0; t < traits.length; t++) { + if (t > 0) s += "\r\n"; + s += traits[t].toString(constants); + } + return s; + } + + public String convert(ConstantPool constants, String prefix) { + String s = ""; + for (int t = 0; t < traits.length; t++) { + if (t > 0) s += "\r\n"; + s += prefix + traits[t].convert(constants, null); + } + return s; + } + + +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/action/Action.java b/trunk/src/com/jpexs/asdec/action/Action.java new file mode 100644 index 000000000..b64f5ef60 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/Action.java @@ -0,0 +1,878 @@ +package com.jpexs.asdec.action; + +import com.jpexs.asdec.SWFOutputStream; +import com.jpexs.asdec.action.parser.FlasmLexer; +import com.jpexs.asdec.action.parser.ParseException; +import com.jpexs.asdec.action.parser.ParsedSymbol; +import com.jpexs.asdec.action.swf4.*; +import com.jpexs.asdec.action.swf5.*; +import com.jpexs.asdec.action.swf6.ActionStrictEquals; +import com.jpexs.asdec.action.swf7.ActionDefineFunction2; +import com.jpexs.asdec.action.swf7.ActionTry; +import com.jpexs.asdec.action.treemodel.*; +import com.jpexs.asdec.action.treemodel.clauses.*; +import com.jpexs.asdec.action.treemodel.operations.AndTreeItem; +import com.jpexs.asdec.action.treemodel.operations.NotTreeItem; +import com.jpexs.asdec.action.treemodel.operations.OrTreeItem; +import com.jpexs.asdec.helpers.Helper; +import com.jpexs.asdec.helpers.Highlighting; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.EmptyStackException; +import java.util.List; +import java.util.Stack; + +/** + * Represents one ACTIONRECORD, + * also has some static method to work with Actions + */ +public class Action { + /** + * Action type identifier + */ + public int actionCode; + /** + * Length of action data + */ + public int actionLength; + + private long address; + + /** + * String used to indent line when converting to string + */ + public static final String INDENTOPEN = "INDENTOPEN"; + /** + * String used to unindent line when converting to string + */ + public static final String INDENTCLOSE = "INDENTCLOSE"; + + /** + * Names of ActionScript properties + */ + public static final String[] propertyNames = new String[]{ + "_x", + "_y", + "_xscale", + "_yscale", + "_currentframe", + "_totalframes", + "_alpha", + "_visible", + "_width", + "_height", + "_rotation", + "_target", + "_framesloaded", + "_name", + "_droptarget", + "_url", + "_highquality", + "_focusrect", + "_soundbuftime", + "_quality", + "_xmouse", + "_ymouse" + }; + + /** + * Constructor + * + * @param actionCode Action type identifier + * @param actionLength Length of action data + */ + public Action(int actionCode, int actionLength) { + this.actionCode = actionCode; + this.actionLength = actionLength; + } + + + /** + * Returns address of this action + * + * @return + */ + public long getAddress() { + return address; + } + + /** + * Gets all addresses which are referenced from this action and/or subactions + * + * @param version SWF version + * @return List of addresses + */ + public List getAllRefs(int version) { + List ret = new ArrayList(); + return ret; + } + + /** + * Gets all ActionIf or ActionJump actions from subactions + * + * @return List of actions + */ + public List getAllIfsOrJumps() { + List ret = new ArrayList(); + return ret; + } + + + /** + * Gets all ActionIf or ActionJump actions from list of actions + * + * @param list List of actions + * @return List of actions + */ + public static List getActionsAllIfsOrJumps(List list) { + List ret = new ArrayList(); + for (Action a : list) { + List part = a.getAllIfsOrJumps(); + ret.addAll(part); + } + return ret; + } + + /** + * Gets all addresses which are referenced from the list of actions + * + * @param list List of actions + * @param version SWF version + * @return List of addresses + */ + public static List getActionsAllRefs(List list, int version) { + List ret = new ArrayList(); + for (Action a : list) { + List part = a.getAllRefs(version); + ret.addAll(part); + } + return ret; + } + + /** + * Sets address of this instruction + * + * @param address Address + * @param version SWF version + */ + public void setAddress(long address, int version) { + this.address = address; + } + + + /** + * Returns a string representation of the object + * + * @return a string representation of the object. + */ + @Override + public String toString() { + return "Action" + actionCode; + } + + /** + * Reads String from FlasmLexer + * + * @param lex FlasmLexer + * @return String value + * @throws IOException + * @throws ParseException When read object is not String + */ + protected String lexString(FlasmLexer lex) throws IOException, ParseException { + ParsedSymbol symb = lex.yylex(); + if (symb.type != ParsedSymbol.TYPE_STRING) throw new ParseException("String expected", lex.yyline()); + return (String) symb.value; + } + + /** + * Reads Block startServer from FlasmLexer + * + * @param lex FlasmLexer + * @throws IOException + * @throws ParseException When read object is not Block startServer + */ + protected void lexBlockOpen(FlasmLexer lex) throws IOException, ParseException { + ParsedSymbol symb = lex.yylex(); + if (symb.type != ParsedSymbol.TYPE_BLOCK_START) throw new ParseException("Block startServer ", lex.yyline()); + } + + /** + * Reads Identifier from FlasmLexer + * + * @param lex FlasmLexer + * @return Identifier name + * @throws IOException + * @throws ParseException When read object is not Identifier + */ + protected String lexIdentifier(FlasmLexer lex) throws IOException, ParseException { + ParsedSymbol symb = lex.yylex(); + if (symb.type != ParsedSymbol.TYPE_IDENTIFIER) throw new ParseException("Identifier expected", lex.yyline()); + return (String) symb.value; + } + + /** + * Reads long value from FlasmLexer + * + * @param lex FlasmLexer + * @return long value + * @throws IOException + * @throws ParseException When read object is not long value + */ + protected long lexLong(FlasmLexer lex) throws IOException, ParseException { + ParsedSymbol symb = lex.yylex(); + if (symb.type != ParsedSymbol.TYPE_INTEGER) throw new ParseException("Integer expected", lex.yyline()); + return (Long) symb.value; + } + + /** + * Reads boolean value from FlasmLexer + * + * @param lex FlasmLexer + * @return boolean value + * @throws IOException + * @throws ParseException When read object is not boolean value + */ + protected boolean lexBoolean(FlasmLexer lex) throws IOException, ParseException { + ParsedSymbol symb = lex.yylex(); + if (symb.type != ParsedSymbol.TYPE_BOOLEAN) throw new ParseException("Boolean expected", lex.yyline()); + return (Boolean) symb.value; + } + + /** + * Gets action converted to bytes + * + * @param version SWF version + * @return Array of bytes + */ + public byte[] getBytes(int version) { + byte ret[] = new byte[1]; + ret[0] = (byte) actionCode; + return ret; + } + + /** + * Surrounds byte array with Action header + * + * @param data Byte array + * @param version SWF version + * @return Byte array + */ + protected byte[] surroundWithAction(byte[] data, int version) { + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); + SWFOutputStream sos2 = new SWFOutputStream(baos2, version); + try { + sos2.writeUI8(actionCode); + sos2.writeUI16(data.length); + sos2.write(data); + sos2.close(); + } catch (IOException e) { + + } + return baos2.toByteArray(); + } + + /** + * Converts list of Actions to bytes + * + * @param list List of actions + * @param addZero Whether or not to add 0 UI8 value to the end + * @param version SWF version + * @return Array of bytes + */ + public static byte[] actionsToBytes(List list, boolean addZero, int version) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (Action a : list) { + try { + baos.write(a.getBytes(version)); + } catch (IOException e) { + + } + } + if (addZero) baos.write(0); + return baos.toByteArray(); + } + + /** + * Set addresses of actions in the list + * + * @param list List of actions + * @param baseAddress Address of first action in the list + * @param version SWF version + */ + public static void setActionsAddresses(List list, long baseAddress, int version) { + long offset = baseAddress; + for (Action a : list) { + a.setAddress(offset, version); + offset += a.getBytes(version).length; + } + } + + + /** + * Converts list of actions to ASM source + * + * @param list List of actions + * @param importantOffsets List of important offsets to mark as labels + * @param version SWF version + * @return ASM source as String + */ + public static String actionsToString(List list, List importantOffsets, int version) { + return actionsToString(list, importantOffsets, new ArrayList(), version); + } + + /** + * Converts list of actions to ASM source + * + * @param list List of actions + * @param importantOffsets List of important offsets to mark as labels + * @param constantPool Constant pool + * @param version SWF version + * @return ASM source as String + */ + public static String actionsToString(List list, List importantOffsets, List constantPool, int version) { + String ret = ""; + long offset = 0; + if (importantOffsets == null) { + setActionsAddresses(list, 0, version); + importantOffsets = getActionsAllRefs(list, version); + } + + offset = 0; + for (Action a : list) { + if (a instanceof ActionConstantPool) { + constantPool.clear(); + constantPool.addAll(((ActionConstantPool) a).constantPool); + } + if (a instanceof ActionPush) { + ((ActionPush) a).constantPool = constantPool; + } + offset = a.getAddress(); + if (importantOffsets.contains(offset)) { + ret += "loc" + Helper.formatAddress(offset) + ":"; + } + offset += a.getBytes(version).length; + ret += a.getASMSource(importantOffsets, constantPool, version) + "\r\n"; + } + if (importantOffsets.contains(offset)) { + ret += "loc" + Helper.formatAddress(offset) + ":\r\n"; + } + return ret; + } + + /** + * Convert action to ASM source + * + * @param knownAddreses List of important offsets to mark as labels + * @param constantPool Constant pool + * @param version SWF version + * @return + */ + public String getASMSource(List knownAddreses, List constantPool, int version) { + return toString(); + } + + /** + * Translates this function to stack and output. + * + * @param stack Stack + * @param constants Constant pool + * @param output Output + */ + public void translate(Stack stack, ConstantPool constants, List output) { + + } + + /** + * Pops long value off the stack + * + * @param stack Stack + * @return long value + */ + protected long popLong(Stack stack) { + TreeItem item = stack.pop(); + if (item instanceof DirectValueTreeItem) { + if (((DirectValueTreeItem) item).value instanceof Long) { + return (long) (Long) ((DirectValueTreeItem) item).value; + } + } + return 0; + } + + /** + * Converts action index to address in the specified list of actions + * + * @param actions List of actions + * @param ip Action index + * @param version SWF version + * @return address + */ + public static long ip2adr(List actions, int ip, int version) { + if (ip == actions.size()) { + if (actions.size() == 0) return 0; + return actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getBytes(version).length; + } + return actions.get(ip).getAddress(); + } + + /** + * Converts address to action index in the specified list of actions + * + * @param actions List of actions + * @param addr Address + * @param version SWF version + * @return action index + */ + public static int adr2ip(List actions, long addr, int version) { + for (int ip = 0; ip < actions.size(); ip++) { + if (actions.get(ip).getAddress() == addr) return ip; + } + if (actions.size() > 0) { + long outpos = actions.get(actions.size() - 1).getAddress() + actions.get(actions.size() - 1).getBytes(version).length; + if (addr == outpos) { + return actions.size(); + } + } + return -1; + } + + + /** + * Converts list of TreeItems to string + * + * @param tree List of TreeItem + * @return String + */ + public static String treeToString(List tree) { + String ret = ""; + for (TreeItem ti : tree) { + ret += ti.toString() + "\r\n"; + } + String parts[] = ret.split("\r\n"); + ret = ""; + + + try { + Stack loopStack = new Stack(); + for (int p = 0; p < parts.length; p++) { + String stripped = Highlighting.stripHilights(parts[p]); + if (stripped.endsWith(":") && (!stripped.startsWith("case ")) && (!stripped.equals("default:"))) { + loopStack.add(stripped.substring(0, stripped.length() - 1)); + } + if (stripped.startsWith("break ")) { + if (stripped.equals("break " + loopStack.peek() + ";")) { + parts[p] = parts[p].replace(" " + loopStack.peek(), ""); + } + } + if (stripped.startsWith("continue ")) { + if (loopStack.size() > 0) { + if (stripped.equals("continue " + loopStack.peek() + ";")) { + parts[p] = parts[p].replace(" " + loopStack.peek(), ""); + } + } + } + if (stripped.startsWith(":")) { + loopStack.pop(); + } + } + } catch (Exception ex) { + } + + int level = 0; + for (int p = 0; p < parts.length; p++) { + String strippedP = Highlighting.stripHilights(parts[p]); + if (strippedP.endsWith(":") && (!strippedP.startsWith("case ")) && (!strippedP.equals("default:"))) { + String loopname = strippedP.substring(0, strippedP.length() - 1); + boolean dorefer = false; + for (int q = p + 1; q < parts.length; q++) { + String strippedQ = Highlighting.stripHilights(parts[q]); + if (strippedQ.equals("break " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals("continue " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals(":" + loopname)) { + break; + } + } + if (!dorefer) { + continue; + } + } + if (strippedP.startsWith(":")) { + continue; + } + if (Highlighting.stripHilights(parts[p]).equals(INDENTOPEN)) { + level++; + continue; + } + if (Highlighting.stripHilights(parts[p]).equals(INDENTCLOSE)) { + level--; + continue; + } + if (Highlighting.stripHilights(parts[p]).equals("}")) level--; + if (Highlighting.stripHilights(parts[p]).equals("};")) level--; + ret += tabString(level) + parts[p] + "\r\n"; + if (Highlighting.stripHilights(parts[p]).equals("{")) level++; + } + return ret; + } + + private static final String INDENT_STRING = " "; + + + private static String tabString(int len) { + String ret = ""; + for (int i = 0; i < len; i++) { + ret += INDENT_STRING; + } + return ret; + } + + /** + * Converts list of actions to ActionScript source code + * + * @param actions List of actions + * @param version SWF version + * @return String with Source code + */ + public static String actionsToSource(List actions, int version) { + List tree = actionsToTree(actions, version); + return treeToString(tree); + } + + /** + * Converts list of actions to List of treeItems + * + * @param actions List of actions + * @param version SWF version + * @return List of treeItems + */ + public static List actionsToTree(List actions, int version) { + return actionsToTree(new ArrayList(), new ArrayList(), getActionsAllIfsOrJumps(actions), new Stack(), new ConstantPool(), actions, 0, actions.size() - 1, version); + } + + private static Stack actionsToStackTree(List jumpsOrIfs, List actions, ConstantPool constants, int start, int end, int version) { + Stack ret = new Stack(); + actionsToTree(new ArrayList(), new ArrayList(), jumpsOrIfs, ret, constants, actions, start, end, version); + return ret; + } + + + private static class Loop { + + public long loopContinue; + public long loopBreak; + public int continueCount = 0; + public int breakCount = 0; + + public Loop(long loopContinue, long loopBreak) { + this.loopContinue = loopContinue; + this.loopBreak = loopBreak; + } + } + + private static List actionsToTree(List unknownJumps, List loopList, List jumpsOrIfs, Stack stack, ConstantPool constants, List actions, int start, int end, int version) { + List output = new ArrayList(); + int ip = start; + boolean isWhile = false; + int loopStart = 0; + loopip: + while (ip <= end + 1) { + + long addr = ip2adr(actions, ip, version); + if (unknownJumps.contains(addr)) { + unknownJumps.remove(new Long(addr)); + boolean switchFound = false; + for (int i = output.size() - 1; i >= 0; i--) { + if (output.get(i) instanceof SwitchTreeItem) { + if (((SwitchTreeItem) output.get(i)).defaultCommands == null) { + List continues = ((SwitchTreeItem) output.get(i)).getContinues(); + boolean breakFound = false; + for (ContinueTreeItem cti : continues) { + if (cti.loopPos == addr) { + cti.isKnown = true; + cti.isBreak = true; + ((SwitchTreeItem) output.get(i)).loopBreak = addr; + breakFound = true; + } + } + if (breakFound) { + switchFound = true; + ((SwitchTreeItem) output.get(i)).defaultCommands = new ArrayList(); + for (int k = i + 1; k < output.size(); k++) { + ((SwitchTreeItem) output.get(i)).defaultCommands.add(output.remove(i + 1)); + } + } + } + break; + } + } + if (!switchFound) { + throw new UnknownJumpException(stack, addr, output); + } + } + if (ip > end) break; + Action action = actions.get(ip); + for (int j = 0; j < jumpsOrIfs.size(); j++) { + Action jif = jumpsOrIfs.get(j); + if (jif instanceof ActionIf) { + if (((ActionIf) jif).getRef(version) == addr) { + if (jif.getAddress() > addr) { + jumpsOrIfs.remove(j); + List doBody = actionsToTree(unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, ip, adr2ip(actions, jif.getAddress(), version) - 1, version); + Loop currentLoop = new Loop(ip, adr2ip(actions, jif.getAddress(), version) + 1); + loopList.add(currentLoop); + output.add(new DoWhileTreeItem(action, adr2ip(actions, jif.getAddress(), version) + 1, ip, doBody, stack.pop())); + ip = adr2ip(actions, jif.getAddress(), version) + 1; + continue loopip; + } + } + } + + } + for (int j = 0; j < jumpsOrIfs.size(); j++) { + Action jif = jumpsOrIfs.get(j); + if (jif instanceof ActionJump) { + if (((ActionJump) jif).getRef(version) == addr) { + if (jif.getAddress() > addr) { + isWhile = true; + loopStart = ip; + break; + } + } + } + } + if (action instanceof ActionJump) { + int jumpIp = adr2ip(actions, ((ActionJump) action).getRef(version), version); + //if (jumpIp > ip) { + for (Loop l : loopList) { + if (l.loopBreak == ((ActionJump) action).getRef(version)) { + output.add(new BreakTreeItem(action, l.loopBreak)); + ip = ip + 1; + continue loopip; + } + if (l.loopContinue == ((ActionJump) action).getRef(version)) { + l.continueCount++; + output.add(new ContinueTreeItem(action, l.loopBreak)); + ip = ip + 1; + continue loopip; + } + } + + output.add(new ContinueTreeItem(action, ((ActionJump) action).getRef(version), false)); + + if (!unknownJumps.contains(((ActionJump) action).getRef(version))) { + unknownJumps.add(((ActionJump) action).getRef(version)); + } + ip = ip + 1; + break; + + } else if (action instanceof ActionIf) { + int jumpIp = adr2ip(actions, ((ActionIf) action).getRef(version), version); + if (jumpIp < ip) { + output.add(new UnsupportedTreeItem(action, "ActionIf to jump back")); + break; + } + TreeItem expression = stack.pop(); + if (expression instanceof NotTreeItem) { + expression = ((NotTreeItem) expression).value; + } else { + expression = new NotTreeItem(action, expression); + } + List onTrue = new ArrayList(); + List onFalse = new ArrayList(); + boolean hasElse = false; + int jumpElseIp = 0; + Stack falseStack = new Stack(); + Stack trueStack = new Stack(); + //if (!isWhile) { + if (actions.get(jumpIp - 1) instanceof ActionJump) { + long ref = ((ActionJump) actions.get(jumpIp - 1)).getRef(version); + int refIp = adr2ip(actions, ref, version); + if ((refIp > jumpIp) && (refIp <= end + 1)) { + hasElse = true; + jumpElseIp = adr2ip(actions, ((ActionJump) actions.get(jumpIp - 1)).getRef(version), version); + onFalse = actionsToTree(unknownJumps, loopList, jumpsOrIfs, falseStack, constants, actions, jumpIp, jumpElseIp - 1, version); + } + } + //} + Loop currentLoop = null; + if (isWhile) { + currentLoop = new Loop(loopStart, jumpIp); + loopList.add(currentLoop); + } + boolean isFor = false; + boolean isTernar = false; + List finalExpression = null; + try { + + onTrue = actionsToTree(unknownJumps, loopList, jumpsOrIfs, trueStack, constants, actions, ip + 1, jumpIp - 1 - (hasElse || isWhile ? 1 : 0), version); + if (onTrue.size() == 0 && trueStack.size() > 0) { + isTernar = true; + } + } catch (UnknownJumpException uje) { + if ((adr2ip(actions, uje.addr, version) >= start) && (adr2ip(actions, uje.addr, version) <= end)) { + currentLoop.loopContinue = uje.addr; + onTrue = uje.output; + List contList = new ArrayList(); + for (TreeItem ti : onTrue) { + if (ti instanceof ContinueTreeItem) { + contList.add((ContinueTreeItem) ti); + } + if (ti instanceof Block) { + List subcont = ((Block) ti).getContinues(); + for (int k = 0; k < subcont.size(); k++) + contList.add(subcont.get(k)); + } + } + for (int u = 0; u < contList.size(); u++) { + if (contList.get(u) instanceof ContinueTreeItem) { + if (((ContinueTreeItem) contList.get(u)).loopPos == uje.addr) { + if (!((ContinueTreeItem) contList.get(u)).isKnown) { + ((ContinueTreeItem) contList.get(u)).isKnown = true; + ((ContinueTreeItem) contList.get(u)).loopPos = currentLoop.loopBreak; + } + } + } + } + finalExpression = actionsToTree(unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, adr2ip(actions, uje.addr, version), jumpIp - 2, version); + isFor = true; + } else { + //throw new ConvertException("Unknown pattern: jump to nowhere", ip); + } + } + if (isFor) { + output.add(new ForTreeItem(action, currentLoop.loopBreak, currentLoop.loopContinue, new ArrayList(), expression, finalExpression, onTrue)); + } else if (isTernar) { + stack.push(new TernarOpTreeItem(action, expression, trueStack.pop(), falseStack.pop())); + } else if (isWhile) { + output.add(new WhileTreeItem(action, jumpIp, loopStart, expression, onTrue)); + } else { + output.add(new IfTreeItem(action, expression, onTrue, onFalse)); + } + ip = (hasElse ? jumpElseIp : jumpIp); + isWhile = false; + isFor = false; + continue; + } else if (action instanceof ActionTry) { + ActionTry atry = (ActionTry) action; + List tryCommands = actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, atry.tryBody, 0, atry.tryBody.size() - 1, version); + TreeItem catchName; + if (atry.catchInRegisterFlag) { + catchName = new DirectValueTreeItem(atry, new RegisterNumber(atry.catchRegister), constants); + } else { + catchName = new DirectValueTreeItem(atry, atry.catchName, constants); + } + List catchExceptions = new ArrayList(); + catchExceptions.add(catchName); + List> catchCommands = new ArrayList>(); + catchCommands.add(actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, atry.catchBody, 0, atry.catchBody.size() - 1, version)); + List finallyCommands = actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, atry.finallyBody, 0, atry.finallyBody.size() - 1, version); + output.add(new TryTreeItem(tryCommands, catchExceptions, catchCommands, finallyCommands)); + } else if (action instanceof ActionWith) { + ActionWith awith = (ActionWith) action; + List withCommands = actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, awith.actions, 0, awith.actions.size() - 1, version); + output.add(new WithTreeItem(action, stack.pop(), withCommands)); + } else if (action instanceof ActionDefineFunction) { + FunctionTreeItem fti = new FunctionTreeItem(action, actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, ((ActionDefineFunction) action).code, 0, ((ActionDefineFunction) action).code.size() - 1, version), constants); + stack.push(fti); + } else if (action instanceof ActionDefineFunction2) { + FunctionTreeItem fti = new FunctionTreeItem(action, actionsToTree(unknownJumps, loopList, jumpsOrIfs, new Stack(), constants, ((ActionDefineFunction2) action).code, 0, ((ActionDefineFunction2) action).code.size() - 1, version), constants); + stack.push(fti); + } else if (action instanceof ActionPushDuplicate) { + do { + if (actions.get(ip + 1) instanceof ActionNot) { + if (actions.get(ip + 2) instanceof ActionIf) { + int nextPos = adr2ip(actions, ((ActionIf) actions.get(ip + 2)).getRef(version), version); + stack.push(new AndTreeItem(action, stack.pop(), actionsToStackTree(jumpsOrIfs, actions, constants, ip + 4 /*je tam pop*/, nextPos - 1, version).pop())); + ip = nextPos; + } else { + output.add(new UnsupportedTreeItem(action, "ActionPushDuplicate with Not")); + break; + } + } else if (actions.get(ip + 1) instanceof ActionIf) { + int nextPos = adr2ip(actions, ((ActionIf) actions.get(ip + 1)).getRef(version), version); + stack.push(new OrTreeItem(action, stack.pop(), actionsToStackTree(jumpsOrIfs, actions, constants, ip + 3, nextPos - 1, version).pop())); + ip = nextPos; + } else { + output.add(new UnsupportedTreeItem(action, "ActionPushDuplicate with no If")); + break loopip; + } + action = actions.get(ip); + } + while (action instanceof ActionPushDuplicate); + } else if (action instanceof ActionStoreRegister) { + if ((ip + 1 <= end) && (actions.get(ip + 1) instanceof ActionPop)) { + action.translate(stack, constants, output); + stack.pop(); + ip++; + } else { + action.translate(stack, constants, output); + } + } else if (action instanceof ActionStrictEquals) { + if ((ip + 1 < actions.size()) && (actions.get(ip + 1) instanceof ActionIf)) { + List caseValues = new ArrayList(); + List> caseCommands = new ArrayList>(); + caseValues.add(stack.pop()); + TreeItem switchedObject = stack.pop(); + if (output.size() > 0) { + if (output.get(output.size() - 1) instanceof StoreRegisterTreeItem) { + output.remove(output.size() - 1); + } + } + int caseStart = ip + 2; + List caseBodyIps = new ArrayList(); + long defaultAddr = 0; + caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip + 1)).getRef(version), version)); + ip++; + do { + ip++; + if ((actions.get(ip - 1) instanceof ActionStrictEquals) && (actions.get(ip) instanceof ActionIf)) { + caseValues.add(actionsToStackTree(jumpsOrIfs, actions, constants, caseStart, ip - 2, version).pop()); + caseStart = ip + 1; + caseBodyIps.add(adr2ip(actions, ((ActionIf) actions.get(ip)).getRef(version), version)); + if (actions.get(ip + 1) instanceof ActionJump) { + defaultAddr = ((ActionJump) actions.get(ip + 1)).getRef(version); + ip = adr2ip(actions, defaultAddr, version); + break; + } + } + } while (ip < end); + for (int i = 0; i < caseBodyIps.size(); i++) { + int caseEnd = ip - 1; + if (i < caseBodyIps.size() - 1) { + caseEnd = caseBodyIps.get(i + 1) - 1; + } + caseCommands.add(actionsToTree(unknownJumps, loopList, jumpsOrIfs, stack, constants, actions, caseBodyIps.get(i), caseEnd, version)); + } + output.add(new SwitchTreeItem(action, defaultAddr, switchedObject, caseValues, caseCommands, null)); + continue; + } else { + action.translate(stack, constants, output); + } + } else { + try { + action.translate(stack, constants, output); + } catch (EmptyStackException ese) { + output.add(new UnsupportedTreeItem(action, "Empty stack")); + } + } + + ip++; + } + if (stack.size() > 0) { + for (int i = stack.size() - 1; i >= 0; i--) { + if (stack.get(i) instanceof FunctionTreeItem) { + output.add(0, stack.get(i)); + stack.remove(i); + } + } + } + return output; + } +} diff --git a/trunk/src/com/jpexs/asdec/action/UnknownJumpException.java b/trunk/src/com/jpexs/asdec/action/UnknownJumpException.java new file mode 100644 index 000000000..00a19916a --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/UnknownJumpException.java @@ -0,0 +1,51 @@ +package com.jpexs.asdec.action; + +import com.jpexs.asdec.action.treemodel.TreeItem; + +import java.util.List; +import java.util.Stack; + +/** + * Raised when actual address has been referenced with an unknown jump + * + * @author JPEXS + */ +public class UnknownJumpException extends RuntimeException { + /** + * Actual stack + */ + public Stack stack; + /** + * Actual address + */ + public long addr; + /** + * Output of the method before raising the exception + */ + public List output; + + /** + * Constructor + * + * @param stack Actual stack + * @param addr Actual address + * @param output Output of the method before raising the exception + */ + public UnknownJumpException(Stack stack, long addr, List output) { + this.stack = stack; + this.addr = addr; + this.output = output; + } + + /** + * Returns a string representation of the object + * + * @return a string representation of the object. + */ + @Override + public String toString() { + return "Unknown jump to " + addr; + } + + +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java new file mode 100644 index 000000000..7be298f64 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java @@ -0,0 +1,165 @@ +package com.jpexs.asdec.action.gui; + +import com.jpexs.asdec.Main; +import com.jpexs.asdec.action.parser.ASMParser; +import com.jpexs.asdec.action.parser.ParseException; +import com.jpexs.asdec.gui.View; +import com.jpexs.asdec.helpers.Highlighting; +import com.jpexs.asdec.tags.ASMSource; +import com.jpexs.asdec.tags.Tag; +import jsyntaxpane.DefaultSyntaxKit; + +import javax.swing.*; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultTreeCellRenderer; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.List; + +public class MainFrame extends JFrame implements TreeSelectionListener, ActionListener { + public JTree tagTree; + public JEditorPane editor; + public JEditorPane decompiledEditor; + public List list; + public JSplitPane splitPane; + public JSplitPane splitPane2; + public JButton saveButton = new JButton("Save"); + + public MainFrame(List list) { + this.list = list; + DefaultSyntaxKit.initKit(); + editor = new JEditorPane(); + decompiledEditor = new JEditorPane(); + tagTree = new JTree(new TagTreeModel(list)); + + DefaultTreeCellRenderer treeRenderer = new DefaultTreeCellRenderer(); + ClassLoader cldr = this.getClass().getClassLoader(); + java.net.URL imageURL = cldr.getResource("com/jpexs/asdec/action/gui/graphics/class.png"); + ImageIcon leafIcon = new ImageIcon(imageURL); + treeRenderer.setLeafIcon(leafIcon); + tagTree.setCellRenderer(treeRenderer); + + JPanel centerPanel = new JPanel(); + centerPanel.setLayout(new BorderLayout()); + centerPanel.add(new JScrollPane(editor), BorderLayout.CENTER); + centerPanel.add(saveButton, BorderLayout.SOUTH); + + saveButton.addActionListener(this); + saveButton.setActionCommand("SAVEACTION"); + setLayout(new BorderLayout()); + add(splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(tagTree), splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centerPanel, new JScrollPane(decompiledEditor))), BorderLayout.CENTER); + editor.setContentType("text/flasm"); + decompiledEditor.setContentType("text/actionscript"); + setSize(640, 480); + tagTree.addTreeSelectionListener(this); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + if (Main.proxyFrame != null) { + if (Main.proxyFrame.isVisible()) return; + } + Main.exit(); + } + }); + View.setWindowIcon(this); + View.centerScreen(this); + + JMenuBar menuBar = new JMenuBar(); + + + JMenu menuFile = new JMenu("File"); + JMenuItem miOpen = new JMenuItem("Open..."); + miOpen.setActionCommand("OPEN"); + miOpen.addActionListener(this); + JMenuItem miSave = new JMenuItem("Save"); + miSave.setActionCommand("SAVE"); + miSave.addActionListener(this); + JMenuItem miSaveAs = new JMenuItem("Save as..."); + miSaveAs.setActionCommand("SAVEAS"); + miSaveAs.addActionListener(this); + JMenuItem miExport = new JMenuItem("Export..."); + miExport.setActionCommand("EXPORT"); + miExport.addActionListener(this); + menuFile.add(miOpen); + menuFile.add(miSave); + menuFile.add(miSaveAs); + menuFile.add(miExport); + menuFile.addSeparator(); + JMenuItem miClose = new JMenuItem("Exit"); + miClose.setActionCommand("EXIT"); + miClose.addActionListener(this); + menuFile.add(miClose); + menuBar.add(menuFile); + + JMenu menuTools = new JMenu("Tools"); + JMenuItem miProxy = new JMenuItem("Proxy"); + miProxy.setActionCommand("SHOWPROXY"); + miProxy.setIcon(new ImageIcon(View.loadImage("com/jpexs/asdec/gui/graphics/proxy16.png"))); + miProxy.addActionListener(this); + menuTools.add(miProxy); + menuBar.add(menuTools); + + setJMenuBar(menuBar); + + setTitle(Main.applicationName + " - " + Main.getFileTitle()); + } + + public void valueChanged(TreeSelectionEvent e) { + Object obj = ((JTree) e.getSource()).getLastSelectedPathComponent(); + if (obj instanceof TagTreeItem) { + obj = ((TagTreeItem) obj).tag; + if (obj instanceof ASMSource) { + editor.setText(((ASMSource) obj).getASMSource(10)); //TODO: Ensure correct version here + decompiledEditor.setText(Highlighting.stripHilights(com.jpexs.asdec.action.Action.actionsToSource(((ASMSource) obj).getActions(), 10))); //TODO:Ensure correct version here + } + } + } + + public void display() { + setVisible(true); + splitPane.setDividerLocation(0.5); + } + + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals("EXIT")) { + System.exit(0); + } + if (e.getActionCommand().equals("SHOWPROXY")) { + Main.showProxy(); + } + if (e.getActionCommand().equals("SAVEACTION")) { + TagTreeItem ti = (TagTreeItem) tagTree.getLastSelectedPathComponent(); + if (ti.tag instanceof ASMSource) { + ASMSource dat = (ASMSource) ti.tag; + try { + dat.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), 10)); //TODO:Ensure correct version here + } catch (IOException ex) { + + } catch (ParseException ex) { + JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE); + } + } + } + if (e.getActionCommand().equals("SAVE")) { + try { + Main.saveFile(Main.file); + } catch (IOException ex) { + + } + } + if (e.getActionCommand().equals("SAVEAS")) { + if (Main.saveFileDialog(this)) { + setTitle(Main.applicationName + " - " + Main.getFileTitle()); + } + } + if (e.getActionCommand().equals("OPEN")) { + Main.openFileDialog(); + } + } +} diff --git a/trunk/src/com/jpexs/asdec/action/gui/TagTreeItem.java b/trunk/src/com/jpexs/asdec/action/gui/TagTreeItem.java new file mode 100644 index 000000000..568e3e702 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/gui/TagTreeItem.java @@ -0,0 +1,19 @@ +package com.jpexs.asdec.action.gui; + +import java.util.ArrayList; +import java.util.List; + +public class TagTreeItem { + public List subItems; + public Object tag; + + public TagTreeItem(Object tag) { + this.tag = tag; + this.subItems = new ArrayList(); + } + + @Override + public String toString() { + return tag.toString(); + } +} diff --git a/trunk/src/com/jpexs/asdec/action/gui/TagTreeModel.java b/trunk/src/com/jpexs/asdec/action/gui/TagTreeModel.java new file mode 100644 index 000000000..16e003bf2 --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/gui/TagTreeModel.java @@ -0,0 +1,139 @@ +package com.jpexs.asdec.action.gui; + +import com.jpexs.asdec.tags.*; + +import javax.swing.event.TreeModelListener; +import javax.swing.tree.TreeModel; +import javax.swing.tree.TreePath; +import java.util.ArrayList; +import java.util.List; + +public class TagTreeModel implements TreeModel { + private String root = ""; + private List list = new ArrayList(); + + public TagTreeModel(List list) { + List list2 = new ArrayList(); + list2.addAll(list); + this.list = processTagList(list2); + } + + public List processTagList(List list) { + List ret = new ArrayList(); + int frame = 1; + List frames = new ArrayList(); + + List exportAssetsTags = new ArrayList(); + for (Object t : list) { + if (t instanceof ExportAssetsTag) { + exportAssetsTags.add((ExportAssetsTag) t); + } + if (t instanceof ShowFrameTag) { + TagTreeItem tti = new TagTreeItem("frame" + frame); + + for (int r = ret.size() - 1; r >= 0; r--) { + if (!(ret.get(r).tag instanceof DefineSpriteTag)) { + if (!(ret.get(r).tag instanceof DefineButtonTag)) { + if (!(ret.get(r).tag instanceof DefineButton2Tag)) { + if (!(ret.get(r).tag instanceof DoInitActionTag)) { + tti.subItems.add(ret.get(r)); + ret.remove(r); + } + } + } + } + } + frame++; + frames.add(tti); + } else if (t instanceof ASMSource) { + TagTreeItem tti = new TagTreeItem(t); + ret.add(tti); + } else if (t instanceof Container) { + if (((Container) t).getItemCount() > 0) { + + TagTreeItem tti = new TagTreeItem(t); + List subItems = ((Container) t).getSubItems(); + + tti.subItems = processTagList(subItems); + ret.add(tti); + } + } + + } + ret.addAll(frames); + for (int i = ret.size() - 1; i >= 0; i--) { + if (ret.get(i).tag instanceof DefineSpriteTag) { + ((DefineSpriteTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DefineButtonTag) { + ((DefineButtonTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DefineButton2Tag) { + ((DefineButton2Tag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof DoInitActionTag) { + ((DoInitActionTag) ret.get(i).tag).exportAssetsTags = exportAssetsTags; + } + if (ret.get(i).tag instanceof ASMSource) { + ASMSource ass = (ASMSource) ret.get(i).tag; + if (ass.containsSource()) continue; + } + if (ret.get(i).subItems.size() == 0) { + ret.remove(i); + } + } + return ret; + } + + + public Object getRoot() { + return root; + } + + public Object getChild(Object parent, int index) { + if (parent == root) { + return list.get(index); + } else { + return ((TagTreeItem) parent).subItems.get(index); + } + } + + public int getChildCount(Object parent) { + if (parent == root) { + return list.size(); + } else { + return ((TagTreeItem) parent).subItems.size(); + } + } + + public boolean isLeaf(Object node) { + return (getChildCount(node) == 0); + } + + public void valueForPathChanged(TreePath path, Object newValue) { + + } + + public int getIndexOfChild(Object parent, Object child) { + if (parent == root) { + for (int t = 0; t < list.size(); t++) { + if (list.get(t) == child) return t; + } + return -1; + } else { + List subTags = ((TagTreeItem) parent).subItems; + for (int t = 0; t < subTags.size(); t++) { + if (subTags.get(t) == child) return t; + } + return -1; + } + } + + public void addTreeModelListener(TreeModelListener l) { + + } + + public void removeTreeModelListener(TreeModelListener l) { + + } +} diff --git a/trunk/src/com/jpexs/asdec/action/gui/graphics/class.png b/trunk/src/com/jpexs/asdec/action/gui/graphics/class.png new file mode 100644 index 000000000..1d30295f9 Binary files /dev/null and b/trunk/src/com/jpexs/asdec/action/gui/graphics/class.png differ diff --git a/trunk/src/com/jpexs/asdec/action/parser/ASMParser.java b/trunk/src/com/jpexs/asdec/action/parser/ASMParser.java new file mode 100644 index 000000000..936ae1efd --- /dev/null +++ b/trunk/src/com/jpexs/asdec/action/parser/ASMParser.java @@ -0,0 +1,263 @@ +package com.jpexs.asdec.action.parser; + +import com.jpexs.asdec.action.Action; +import com.jpexs.asdec.action.swf3.*; +import com.jpexs.asdec.action.swf4.*; +import com.jpexs.asdec.action.swf5.*; +import com.jpexs.asdec.action.swf6.*; +import com.jpexs.asdec.action.swf7.*; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +public class ASMParser { + + public static List parse(List