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
280fb18e
Commit
280fb18e
authored
14 years ago
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Windows compatibility for clear screen.
parent
dadcfced
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
+13
-4
13 additions, 4 deletions
wcclparser/main.cpp
with
13 additions
and
4 deletions
wcclparser/main.cpp
+
13
−
4
View file @
280fb18e
...
...
@@ -10,9 +10,9 @@
#include
<antlr/MismatchedTokenException.hpp>
// ----------------------------------------------------------------------------
//
#ifdef HAVE_LIBEDIT
#ifdef HAVE_LIBEDIT
#include
<histedit.h>
//
#endif
#endif
/**
* @desc A simple command line tester for testing operators
...
...
@@ -34,6 +34,15 @@ void std_read_loop(boost::function<bool (const std::string&)>& line_cb)
}
}
int
clear_screen
()
{
#ifdef _WINDOWS
return
std
::
system
(
"cls"
);
#else
return
std
::
system
(
"clear"
);
#endif
}
#ifdef HAVE_LIBEDIT
const
char
*
query_prompt
(
EditLine
*
)
{
return
_prompt
;
...
...
@@ -81,7 +90,7 @@ bool process_line(const std::string& line, Parser& parser)
if
(
line
.
empty
()
||
line
==
"exit"
||
line
==
"quit"
)
{
return
true
;
}
else
if
(
line
==
"clear"
||
line
==
"cls"
)
{
if
(
system
(
"clear"
))
{}
if
(
clear_screen
(
))
{}
return
false
;
}
...
...
@@ -158,7 +167,7 @@ int main(int argc, char** argv)
const
Corpus2
::
Tagset
&
tagset
=
Corpus2
::
get_named_tagset
(
tagset_load
);
Parser
parser
(
tagset
);
if
(
system
(
"clear"
))
{
if
(
clear_screen
(
))
{
//
}
...
...
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