Skip to content

Conversation

onewhl
Copy link
Collaborator

@onewhl onewhl commented May 18, 2017

Добавлен парсер для языка While.
Добавлены парсеры для грамматик из биоинформатики.


val corep: Recognizer<Expr> = fix { (number map { Expr.Con(it) as Expr }) /
(symbol map { Expr.Var(it) as Expr }) /
paren( sp(it) ) }
Copy link
Owner

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))
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тесты по-больше?

Copy link
Collaborator Author

@onewhl onewhl May 19, 2017

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 символов).

@onewhl onewhl changed the title Added parser for L. Added parser for While. May 21, 2017
@onewhl
Copy link
Collaborator Author

onewhl commented May 22, 2017

Добавлен парсер для грамматики, задающий язык { [^n (^m ]^n )^m }. Она применима в биоинформатике для поиска pseudoknots.
В последнем коммите в тесте изменена длина строки, поскольку тут тест не прошел, однако локально все ОК.

@onewhl onewhl mentioned this pull request May 22, 2017
7 tasks
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

Successfully merging this pull request may close these issues.

2 participants