Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stash FTLocation changes on a branch for now
- Loading branch information
Showing
3 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
use v6; | ||
|
||
# Using a variation on the old NCBI FT BNF, but perl6-ized | ||
|
||
use Bio::Grammar::FTLocation; | ||
|
||
class Bio::Tools::FTLocationParser { | ||
|
||
my class FTLocation::Actions { | ||
method location($/) { say $/.perl ~ "\n"; } | ||
|
||
has @!location-stack; | ||
|
||
method local_location($/) { | ||
say $/.gist | ||
} | ||
} | ||
|
||
method from-string(Str $locstr) { | ||
my $loc; | ||
|
||
# grab the AST from the grammar | ||
my $ast = Bio::Grammar::FTLocation.parse($locstr, :actions(FTLocation::Actions)); | ||
#my $ast = Bio::Grammar::FTLocation.parse($locstr); | ||
|
||
# we can do this lazily and let the class deal with the AST, or create objects | ||
# on the fly (not an easy way to do this lazily currently) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters