|
Appendix: Style BNF Grammar
<script> ::= (<script_line> <s>+)*
<script_line> ::= [<display_class> | <display_style> | <image_style>]
<display_class> ::= (".paint_class" | ".warp_class" | ".glyph_class") <s>+ <identifier> <s>+ <class_spec>
<display_style> ::= (".paint" | ".warp" | ".glyph") <s>+ <identifier> <s>+ "extends" <s>+ <modifier>
<image_style> ::= ".image" <s>+ <identifier> <s>+ ["extends" <s>+ <identifier> <s>+] ["{" <s>+ <image_property> <s>+ [";" <s>+ <image_property> <s>+]* [";" <s>*] "}"]
<image_property> ::= (<property> | <modifier_list>)
<modifier_list> ::= ("paint" | "warp") <s>* ("=" | "+") <s>* <modifier> <s>* ["," <s>* <modifier> <s>*]*
<modifier> ::= <identifier> <s>* ["{" <s>* <property> <s>* [";" <s>* <property> <s>*]* [";" <s>*] "}"]
<property> ::= <identifier> <s>* "=" <s>* <value>
<value> ::= (<integer_value> | <float_value> | <percent_value> | <color_value> | <hue_value> | <identifier>)
<color_value> ::= ("0"-"9" | "A"-"F" | "a"-"f"){6} | "black" /*000000*/ | "obscure_gray" /*333333*/ | "dark_gray" /*666666*/ | "gray" /*808080*/ | "light_gray" /*999999*/ | "pale_gray" /*CCCCCC*/ | "white" /*FFFFFF*/ | "red" /*FF0000*/ | "yellow" /*FFFF00*/ | "green" /*008000*/ | "cyan" /*00FFFF*/ | "blue" /*0000FF*/ | "magenta" /*FF00FF*/)
<hue_value> ::= <integer_value> | "red" /*000*/ | "orange" /*030*/ | "yellow" /*060*/ | "spring" /*090*/ | "green" /*120*/ | "teal" /*150*/ | "cyan" /*180*/ | "azure" /*210*/ | "blue" /*240*/ | "violet" /*270*/ | "magenta" /*300*/ | "pink" /*330*/)
<percent_value> ::= <integer_value> "%"
<integer_value> can be parsed by java.lang.Integer.parseInt(String) without throwing java.lang.NumberFormatException
<float_value> can be parsed by java.lang.Float.parseFloat(String) without throwing java.lang.NumberFormatException
<s> ::= (" " | "\n" | "\r" | "\t" | <comment>)
<comment>::= "/*" <character>* "*/"
<character> ::= "\040"-"\176"
<class_spec> ::= (<identifier>".")* <identifier>
<identifier> ::= <java_letter><java_letter_or_digit>*
<java_letter> is a Unicode character for which java.lang.Character.isJavaIdentifierStart() is true
<java_letter_or_digit> is a Unicode character for which java.lang.Character.isJavaIdentifierPart() is true
|
|