SEBA-421 Print error messages to stderr, not stdout;
Add Makefile

Change-Id: I7d4285a343d723ff3fc2aa2f7b1abfb806de8966
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3f64f7d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Configure shell
+SHELL = bash -e -o pipefail
+
+all: test
+
+test: test-unit
+
+test-unit:
+	tox
diff --git a/VERSION b/VERSION
index fcdb2e1..1454f6e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.0.0
+4.0.1
diff --git a/src/plyxproto/helpers.py b/src/plyxproto/helpers.py
index 15136f5..a38d716 100644
--- a/src/plyxproto/helpers.py
+++ b/src/plyxproto/helpers.py
@@ -14,6 +14,7 @@
 
 from __future__ import print_function
 from six.moves import range
+import sys
 
 
 class LexHelper:
@@ -196,7 +197,7 @@
         def f(element):
             if self.verbose:
                 msg = 'unimplemented call to {}; ignoring ({})'
-                print((msg.format(name, element)))
+                print((msg.format(name, element)), file=sys.stderr)
             return True
         return f
 
diff --git a/src/plyxproto/logicparser.py b/src/plyxproto/logicparser.py
index 1c4922b..b948d46 100644
--- a/src/plyxproto/logicparser.py
+++ b/src/plyxproto/logicparser.py
@@ -5,6 +5,7 @@
 __copyright__ = "Copyright (C) 2017 Open Networking Lab"
 __version__ = "1.0"
 
+import sys
 from .helpers import LexHelper
 
 
@@ -78,7 +79,8 @@
 
     def t_error(self, t):
         print(("Illegal character '{}' ({}) in line {}".format(
-            t.value[0], hex(ord(t.value[0])), t.lexer.lineno)))
+            t.value[0], hex(ord(t.value[0])), t.lexer.lineno)),
+            file=sys.stderr)
         t.lexer.skip(1)
 
 
diff --git a/src/plyxproto/parser.py b/src/plyxproto/parser.py
index aabf2eb..f96125c 100755
--- a/src/plyxproto/parser.py
+++ b/src/plyxproto/parser.py
@@ -37,6 +37,7 @@
 from .helpers import LexHelper, LU
 from .logicparser import FOLParser, FOLLexer, FOLParsingError
 import ast
+import sys
 
 
 class PythonError(Exception):
@@ -155,7 +156,8 @@
 
     def t_error(self, t):
         print(("Illegal character '{}' ({}) in line {}".format(
-            t.value[0], hex(ord(t.value[0])), t.lexer.lineno)))
+            t.value[0], hex(ord(t.value[0])), t.lexer.lineno)),
+            file=sys.stderr)
         t.lexer.skip(1)