coli-saar / alto

Alto, the Algebraic Language Toolkit
Other
16 stars 2 forks source link

Negative weights #67

Closed akoehn closed 4 years ago

akoehn commented 4 years ago

IRTGs currently cannot contain negative weights when constructing with an IrtgInputCodec. It expects:

NUMBER : [0-9.] ([0-9.eE-]*);
...
weight     : '[' NUMBER ']';

I guess nobody ever wanted negative weights and therefore just did not think about negative weights. Is there another reason for only accepting positive weights or can I extend it for negative ones?

alexanderkoller commented 4 years ago

No, go ahead and add the optional minus.

akoehn commented 4 years ago

Added in 38cd3740cac7263066f2d95084f349c097372c6d.