Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on awt #17

Open
billy1380 opened this issue Jul 16, 2017 · 0 comments
Open

Remove dependency on awt #17

billy1380 opened this issue Jul 16, 2017 · 0 comments

Comments

@billy1380
Copy link

billy1380 commented Jul 16, 2017

It would be really good if the library did not have a dependency on awt. This would mean that there would be another library awt-rrdiagram that has a font factory that uses awt classes to measure text length etc.

I did a first pass here -> https://github.com/billy1380/RRDiagram.

Please let me know if there is any interest.

The reason I thought this might be useful is because I would like to use it with gwt. The result can be found here:
https://www.willshex.com/#!e_bnf

I found the idl spec and changed it a little to make it parsable and used it for testing (listing below).

Was a little disappointed that I had to add semi colons to mark the end of the lines

specification ::= definition+;
definition ::= type_dcl ";"|const_dcl ";"|except_dcl ";"|interface ";"|module ";";
module ::= "module" identifier "{" definition+ "}";
interface ::= interface_dcl | forward_dcl;
interface_dcl ::= interface_header "{" interface_body "}";
forward_dcl ::= "interface" identifier;
interface_header ::= "interface" identifier (inheritance_spec);
interface_body ::= export*;
export ::= type_dcl ";"|const_dcl ";"|except_dcl ";"|attr_dcl ";"|op_dcl ";";
inheritance_spec ::= ":" scoped_name ("," scoped_name)*;
scoped_name ::= identifier|"::" identifier|scoped_name "::" identifier;
const_dcl ::= "const" const_type identifier "=" const_exp;
const_type ::= integer_type|char_type|boolean_type|floating_pt_type|string_type|scoped_name;
const_exp ::= or_expr;
or_expr ::= xor_expr|or_expr "|" xor_expr;
xor_expr ::= and_expr|xor_expr "^" and_expr;
and_expr ::= shift_expr|and_expr "&" shift_expr;
shift_expr ::= add_expr|shift_expr ">>"add_expr|shift_expr "<<" add_expr;
add_expr ::= mult_expr|add_expr "+" mult_expr|add_expr "-" mult_expr;
mult_expr ::= unary_expr|mult_expr "*" unary_expr|mult_expr "/" unary_expr|mult_expr "%" unary_expr;
unary_expr ::= unary_operator primary_expr|primary_expr;
unary_operator ::= "-"|"+"|"~";
primary_expr ::= scoped_name|literal|"(" const_exp ")";
literal ::= integer_literal|string_literal|character_literal|floating_pt_literal|boolean_literal;
boolean_literal ::= "TRUE"|"FALSE";
positive_int_const ::= const_exp;
type_dcl ::= "typedef" type_declarator|struct_type|union_type|enum_type;
type_declarator ::= type_spec declarators;
type_spec ::= simple_type_spec|constr_type_spec;
simple_type_spec ::= base_type_spec|template_type_spec|scoped_name;
base_type_spec ::= floating_pt_type|integer_type|char_type|boolean_type|octet_type|any_type;
template_type_spec ::= sequence_type|string_type;
constr_type_spec ::= struct_type|union_type|enum_type;
declarators ::= declarator ( "," declarator )*;
declarator ::= simple_declarator|complex_declarator;
simple_declarator ::= identifier;
complex_declarator ::= array_declarator;
floating_pt_type ::= "float"|"double";
integer_type ::= signed_int|unsigned_int;
signed_int ::= signed_long_int|signed_short_int;
signed_long_int ::= "long";
signed_short_int ::= "short";
unsigned_int ::= unsigned_long_int|unsigned_short_int;
unsigned_long_int ::= "unsigned" "long";
unsigned_short_int ::= "unsigned" "short";
char_type ::= "char";
boolean_type ::= "boolean";
octet_type ::= "octet";
any_type ::= "any";
struct_type ::= "struct" identifier "{" member_list "}";
member_list ::= member+;
member ::= type_spec declarators ";";
union_type ::= "union" identifier "switch" "(" switch_type_spec ")" "{" switch_body "}";
switch_type_spec ::= integer_type|char_type|boolean_type|enum_type|scoped_name;
switch_body ::= case+;
case ::= case_label+ element_spec ";";
case_label ::= "case" const_exp ":"|"default" ":";
element_spec ::= type_spec declarator;
enum_type ::= "enum" identifier "{" enumerator ( "," enumerator )* "}";
enumerator ::= identifier;
sequence_type ::= "sequence" "<" simple_type_spec "," positive_int_const ">"|"sequence" "<" simple_type_spec ">";
string_type ::= "string" "<" positive_int_const ">"|"string";
array_declarator ::= identifier fixed_array_size+;
fixed_array_size ::= "[" positive_int_const "]";
attr_dcl ::= "readonly"? "attribute" param_type_spec simple_declarator (","simple_declarator)*;
except_dcl ::= "exception" identifier "{" member* "}";
op_dcl ::= op_attribute? op_type_spec identifier parameter_dcls raises_expr? context_expr?;
op_attribute ::= "oneway";
op_type_spec ::= param_type_spec|"void";
parameter_dcls ::= "(" param_dcl ("," param_dcl)* ")"|"(" ")";
param_dcl ::= param_attribute param_type_spec simple_declarator;
param_attribute ::= "in"|"out"|"inout";
raises_expr ::= "raises" "(" scoped_name ("," scoped_name)* ")";
context_expr ::= "context" "(" string_literal ( "," string_literal)* ")";
param_type_spec ::= base_type_spec string_type scoped_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant