-
Notifications
You must be signed in to change notification settings - Fork 1
Added parser for While. #12
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
base: master
Are you sure you want to change the base?
Conversation
|
||
val corep: Recognizer<Expr> = fix { (number map { Expr.Con(it) as Expr }) / | ||
(symbol map { Expr.Var(it) as Expr }) / | ||
paren( sp(it) ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} на новую строчку
val p = pS | ||
val inp = "aucgaaagau" | ||
Assert.assertEquals(inp.length, p.parse(inp, p)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А тесты по-больше?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это маленький примерчик, увидела в книжке -- добавила, он не особо показателен. Распознаем шпильки (hairpin) с длиной спирали 3 и последовательностью в петле gaaa и gcaa. В языке, порождаемым этой грамматикой, строки всегда одной длины (10 символов).
Добавлен парсер для грамматики, задающий язык { [^n (^m ]^n )^m }. Она применима в биоинформатике для поиска pseudoknots. |
Добавлен парсер для языка While.
Добавлены парсеры для грамматик из биоинформатики.