Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-fplo
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-fplo
Commits
2d56fb29
Commit
2d56fb29
authored
8 years ago
by
Henning Glawe
Browse files
Options
Downloads
Patches
Plain Diff
integrate FploInputParser into main parser via adHoc wrapper
parent
f50eacd5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-fplo/parser_fplo_14.py
+35
-0
35 additions, 0 deletions
parser/parser-fplo/parser_fplo_14.py
with
35 additions
and
0 deletions
parser/parser-fplo/parser_fplo_14.py
+
35
−
0
View file @
2d56fb29
...
...
@@ -15,6 +15,7 @@ import calendar
from
nomadcore.parser_backend
import
valueForStrValue
from
FploCommon
import
RE_f
,
RE_i
,
cRE_f
,
cRE_i
from
nomadcore.parser_backend
import
valueForStrValue
import
FploInputParser
LOGGER
=
logging
.
getLogger
(
__name__
)
...
...
@@ -184,6 +185,40 @@ class ParserFplo14(object):
def
adHoc_input_content
(
self
,
parser
):
LOGGER
.
error
(
"
TODO: parse C-like echoed input
"
)
input_parser
=
FploInputParser
.
FploInputParser
(
None
,
annotated_line_callback
=
self
.
callback_annotated_input_line
)
while
True
:
fInLine
=
parser
.
fIn
.
readline
()
if
re
.
match
(
r
'
^\s*-{60,}\s*$
'
,
fInLine
):
self
.
callback_annotated_input_line
(
fInLine
)
break
input_parser
.
parse_line
(
fInLine
)
input_parser
.
onEnd_of_file
()
def
callback_annotated_input_line
(
self
,
annotated_input_line
):
minfo
=
{
# raw line
'
fInLine
'
:
''
,
# fInLine,
'
fInLineNr
'
:
self
.
parser
.
fIn
.
lineNr
,
# information about SimpleMatcher
'
matcherName
'
:
'
tokenizer
'
,
'
defFile
'
:
'
FploInputParser.py
'
,
'
defLine
'
:
0
,
'
matcher_does_nothing
'
:
False
,
'
which_re
'
:
'
tokenizer
'
,
# classification of match
'
matchFlags
'
:
1
,
'
match
'
:
3
,
# 0 - no, 1 - partial, 3 - full
'
coverageIgnore
'
:
0
,
# 0 - no, 1 - local, 3 - global
# overall span of match, and spans of group captures
'
span
'
:
[],
# capture group names
'
matcherGroup
'
:
[],
# we have pre-highlighted line
'
highlighted
'
:
annotated_input_line
,
}
self
.
parser
.
annotator
.
annotate
(
minfo
)
def
SMs_input
(
self
):
result
=
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment