Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
0b8578f7
Commit
0b8578f7
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
add -f - featur to wcclparser to parse a mulitline query from stdin
parent
8ed162cd
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wcclparser/main.cpp
+12
-8
12 additions, 8 deletions
wcclparser/main.cpp
with
12 additions
and
8 deletions
wcclparser/main.cpp
+
12
−
8
View file @
0b8578f7
...
...
@@ -185,7 +185,7 @@ int main(int argc, char** argv)
(
"position,p"
,
value
(
&
position
),
"Position in the sentence to use, 'all' iterates through the sentence
\n
"
)
(
"query-file,f"
,
value
(
&
query_load
),
"Run query from file (disables interactive mode)
\n
"
)
"Run query from file (disables inter
ohai
active mode)
(- is stdin)
\n
"
)
(
"query,Q"
,
value
(
&
query
),
"Query to run (disables interactive mode)
\n
"
)
(
"quiet,q"
,
value
(
&
quiet
)
->
zero_tokens
(),
...
...
@@ -237,15 +237,19 @@ int main(int argc, char** argv)
process_line
(
query
,
parser
,
sc
,
position
==
"all"
,
dump_variables
);
return
0
;
}
else
if
(
!
query_load
.
empty
())
{
std
::
ifstream
qf
(
query_load
.
c_str
());
if
(
qf
.
good
())
{
std
::
stringstream
ss
;
ss
<<
qf
.
rdbuf
();
process_line
(
ss
.
str
(),
parser
,
sc
,
position
==
"all"
,
dump_variables
);
return
0
;
std
::
stringstream
ss
;
if
(
query_load
==
"-"
)
{
ss
<<
std
::
cin
.
rdbuf
();
}
else
{
throw
Wccl
::
FileNotFound
(
sentence_load
,
""
,
"Query file"
);
std
::
ifstream
qf
(
query_load
.
c_str
());
if
(
qf
.
good
())
{
ss
<<
qf
.
rdbuf
();
}
else
{
throw
Wccl
::
FileNotFound
(
sentence_load
,
""
,
"Query file"
);
}
}
process_line
(
ss
.
str
(),
parser
,
sc
,
position
==
"all"
,
dump_variables
);
return
0
;
}
boost
::
function
<
bool
(
const
std
::
string
&
)
>
f
;
f
=
boost
::
bind
(
&
process_line
,
_1
,
boost
::
ref
(
parser
),
boost
::
ref
(
sc
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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