/usr/include/scilab/parser_private.hxx is in scilab-include 6.0.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | /*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
*
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* pursuant to article 5.3.4 of the CeCILL v.2.1.
* This file was originally licensed under the terms of the CeCILL v2.1,
* and continues to be available under such terms.
* For more information, see the COPYING file which you should have received
* along with this program.
*
*/
#ifndef __PARSER_PRIVATE_HXX__
#define __PARSER_PRIVATE_HXX__
#include "parser.hxx"
class ParserSingleInstance
{
public :
static Parser::ControlStatus getControlStatus(void)
{
if (!_control_status.empty())
{
return _control_status.front();
}
return Parser::AllControlClosed;
}
static void pushControlStatus(Parser::ControlStatus control_status)
{
_control_status.push_front(control_status);
}
static void popControlStatus(void)
{
if (!_control_status.empty())
{
_control_status.pop_front();
}
}
static void resetControlStatus(void)
{
_control_status.clear();
}
static Parser::ParserStatus getExitStatus(void)
{
return _exit_status;
}
static void setExitStatus(Parser::ParserStatus exit_status)
{
_exit_status = exit_status;
}
static ast::Exp* getTree(void)
{
return _the_program;
}
static void setTree(ast::Exp* theProgram)
{
_the_program = theProgram;
}
/*
** Parsing functions
*/
static void parse(const char *command);
static void parseFile(const std::wstring& fileName, const std::wstring& progName);
/*
** Manage strict Mode
*/
static bool isStrictMode(void)
{
return _strict_mode;
}
static void enableStrictMode(void)
{
_strict_mode = true;
}
static void disableStrictMode(void)
{
_strict_mode = false;
}
/*
** Manage error recovery mode
*/
static bool stopOnFirstError(void)
{
return _stop_on_first_error;
}
static void enableStopOnFirstError(void)
{
_stop_on_first_error = true;
}
static void disableStopOnFirstError(void)
{
_stop_on_first_error = false;
}
/*
** Bison Debug management
*/
static void enableParseTrace(void);
static void disableParseTrace(void);
/*
** File name management
*/
static const std::wstring getFileName(void)
{
return _file_name;
}
static void setFileName(const std::wstring& fileName)
{
_file_name = fileName;
}
/*
** Program Name Management
*/
static const std::wstring getProgName(void)
{
return L"Scilab";
}
static void setProgName(const std::wstring& progName)
{
_prog_name = progName;
}
/*
** Error Message management
*/
static std::wstring& getErrorMessage(void);
static void appendErrorMessage(const std::wstring& ostr);
static void resetErrorMessage(void)
{
_error_message.clear();
}
static void releaseTmpFile();
/*
** \brief This funnction returns the parsed code written
** at the given line.
** out = getCodeLine(10, codeline)
** When returning, out == *codeLine, _BUT_ out is allocated by a inner
** function and must be manually free.
*/
static char* getCodeLine(int line, char **codeLine);
static void PrintError(const std::wstring& msg);
private :
static std::wstring _file_name;
static std::wstring _prog_name;
static std::wstring _error_message;
static bool _strict_mode;
static bool _stop_on_first_error;
static ast::Exp* _the_program;
static Parser::ParserStatus _exit_status;
static std::list<Parser::ControlStatus> _control_status;
static FILE* fileLocker;
};
#endif /* !__PARSER_PRIVATE_HXX__ */
|