| java.lang.Object org.openlaszlo.compiler.CompilerUtils
CompilerUtils | public class CompilerUtils (Code) | | |
Method Summary | |
public static String | attributeLocationDirective(Element elt, String attrname) | public static String | attributeUniqueName(Element elt, String attrname) | public static String | encodeJavaScriptIdentifier(String s) Returns a string that is a valid JavaScript identifier.
Characters in the input string that are not valid in a
JavaScript identifier are replaced by "$xx", where xx is the
hex code of the character. | static boolean | isAtToplevel(Element element) Returns true if the argument is at the top level of an lzx
program: it is immediately within a canvas element, or within a
library element that is itself at the top level. | public static String | sourceLocationDirective(Element elt, boolean start) Return a string that can be included in a script to tell the
script compiler that subsequent lines should be numbered
relative to the beginning or end position of the source text
for this element. | public static String | sourceLocationDirective(String pathname, Integer lineno, Integer colno) Return a string that can be included in a script to tell the
script compiler that subsequent lines should be numbered
relative to the beginning or end position of the source text
for this element. | public static String | sourceLocationPrettyString(Element elt) | public static String | sourceUniqueName(Element elt, boolean start) Return a string that can be used as a unique name for the
element for compiler generated function names. |
attributeLocationDirective | public static String attributeLocationDirective(Element elt, String attrname)(Code) | | |
attributeUniqueName | public static String attributeUniqueName(Element elt, String attrname)(Code) | | TODO: [2003-03-14 ptw] ditto
|
encodeJavaScriptIdentifier | public static String encodeJavaScriptIdentifier(String s)(Code) | | Returns a string that is a valid JavaScript identifier.
Characters in the input string that are not valid in a
JavaScript identifier are replaced by "$xx", where xx is the
hex code of the character. '$' is also replaced. This is
similar to URL encoding, except '$' is used as the quote
character.
|
isAtToplevel | static boolean isAtToplevel(Element element)(Code) | | Returns true if the argument is at the top level of an lzx
program: it is immediately within a canvas element, or within a
library element that is itself at the top level.
|
sourceLocationDirective | public static String sourceLocationDirective(Element elt, boolean start)(Code) | | Return a string that can be included in a script to tell the
script compiler that subsequent lines should be numbered
relative to the beginning or end position of the source text
for this element.
Parameters: start - true if the location should be relative to thestart of the element (otherwise it is relative to the end) |
sourceLocationDirective | public static String sourceLocationDirective(String pathname, Integer lineno, Integer colno)(Code) | | Return a string that can be included in a script to tell the
script compiler that subsequent lines should be numbered
relative to the beginning or end position of the source text
for this element.
|
sourceLocationPrettyString | public static String sourceLocationPrettyString(Element elt)(Code) | | |
sourceUniqueName | public static String sourceUniqueName(Element elt, boolean start)(Code) | | Return a string that can be used as a unique name for the
element for compiler generated function names.
Parameters: start - true if the location should be relative to thestart of the element (otherwise it is relative to the end) |
|
|