Hello, I need to change the following OMeta strong> PEG:
using OMetaSharp; using System.Collections; using System.Text; ometa SExpression.GeneratedCode.SExpressionParser : Parser { SExpression = Spaces Atom:a Spaces -> { a } | Spaces List:l Spaces -> { l.As<SExprList>() }, EscapeChar = '\\' Character:c -> { c }, Atom = String:s -> { new SExprAtomString(s.ToString()) } | Number:n -> { new SExprAtomNumber(n.ToString()) } | Symbol:sy -> { new SExprAtomSymbol(sy.ToString()) }, Symbol = FirstAndRest("Letter", "LetterOrDigit") | '+' | '-' | '*' | '/' | '^', String = '"' (EscapeChar | ~'"' Character)*:s '"' -> { s }, Number = Digit+, List = '(' SExpression*:xs ')' -> { new SExprList(xs.ToIEnumerable<ISExpression>()) } }
to support Symbols , including underscores and periods. Dots must also be supported in Numbers .
I tried to change the Number rules with the following product (taken from the Ometa # source site), but when creating the SExpression analyzer, a run-time error ends:
Number = Number:n Digit:D -> (n * 10 + d) | Digit,
and this also does not work:
Number = Digit+ | Digit+ '.' Digit+,
In this case, I can create a parser, but I have an OMeta strong> exception when I try to parse something like 0.25 .
I also wrote these rules to allow parsing of underscores (and periods) of rich Symbols , but it also doesn't work:
Atom = Sub:s -> { new SExprAtomString(s.ToString()) } | Number:n -> { new SExprAtomNumber(n.ToString()) } | Symbol:sy -> { new SExprAtomSymbol(sy.ToString()) }, Sub = String | String '_' String | String '.' String,
I am trying to parse an expression:
(fp_text value V23105 (at -2 0 180) (layer FSilkS) hide (effects (font (size 1 1) (thickness 0.25))) )
Exception parsing is always the following:

No stack trace: - (.