1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15 
16 #ifndef __CODE_PRINTER_HXX__
17 #define __CODE_PRINTER_HXX__
18 
19 #include <string>
20 
21 #include "exp.hxx"
22 
23 namespace coverage
24 {
25 
26 class CodePrinter
27 {
28 
29 public:
30 
31     virtual void handleDefault(const std::wstring & seq) = 0;
32     virtual void handleOperator(const std::wstring & seq) = 0;
33     virtual void handleOpenClose(const std::wstring & seq) = 0;
34     virtual void handleFunctionKwds(const std::wstring & seq) = 0;
35     virtual void handleStructureKwds(const std::wstring & seq) = 0;
36     virtual void handleControlKwds(const std::wstring & seq) = 0;
37     virtual void handleConstants(const std::wstring & seq) = 0;
38     virtual void handleCommands(const std::wstring & seq) = 0;
39     virtual void handleMacros(const std::wstring & seq) = 0;
40     virtual void handleFunctionName(const std::wstring & seq) = 0;
41     virtual void handleFunctionNameDec(const std::wstring & seq) = 0;
42     virtual void handleName(const std::wstring & seq) = 0;
43     virtual void handleInOutArgsDec(const std::wstring & seq) = 0;
44     virtual void handleInOutArgs(const std::wstring & seq) = 0;
45     virtual void handleNumber(const std::wstring & seq) = 0;
46     virtual void handleSpecial(const std::wstring & seq) = 0;
47     virtual void handleString(const std::wstring & seq) = 0;
48     virtual void handleNothing(const std::wstring & seq) = 0;
49     virtual void handleField(const std::wstring & seq) = 0;
50     virtual void handleComment(const std::wstring & seq) = 0;
51     virtual void handleNewLine() = 0;
52     virtual void handleExpStart(const ast::Exp * e) = 0;
53     virtual void handleExpEnd(const ast::Exp * e) = 0;
54     virtual unsigned int getLineCharCount() const = 0;
55     virtual std::size_t getIndentSize() const = 0;
56     virtual void incIndent() = 0;
57     virtual void decIndent() = 0;
58 };
59 
60 } // namespace coverage
61 
62 
63 #endif // __CODE_PRINTER_HXX__
64