2013-11-03 12:40:39 +01:00
|
|
|
%{
|
2014-03-21 10:22:59 +01:00
|
|
|
#define YYDEBUG 1
|
|
|
|
|
2012-05-31 16:04:51 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* Icinga 2 *
|
2014-03-19 01:02:29 +01:00
|
|
|
* Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org) *
|
2012-05-31 16:04:51 +02:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 2 *
|
|
|
|
* of the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software Foundation *
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
|
|
******************************************************************************/
|
|
|
|
|
2012-09-07 10:27:31 +02:00
|
|
|
#include "i2-config.h"
|
2013-03-17 20:19:29 +01:00
|
|
|
#include "config/configitembuilder.h"
|
|
|
|
#include "config/configcompiler.h"
|
|
|
|
#include "config/configcompilercontext.h"
|
2014-03-21 15:39:25 +01:00
|
|
|
#include "config/configerror.h"
|
2013-03-17 20:19:29 +01:00
|
|
|
#include "config/typerule.h"
|
|
|
|
#include "config/typerulelist.h"
|
2013-10-20 15:06:05 +02:00
|
|
|
#include "config/aexpression.h"
|
2014-03-18 11:44:09 +01:00
|
|
|
#include "config/applyrule.h"
|
2013-03-17 20:19:29 +01:00
|
|
|
#include "base/value.h"
|
2013-03-18 11:02:18 +01:00
|
|
|
#include "base/utility.h"
|
2013-03-17 20:19:29 +01:00
|
|
|
#include "base/array.h"
|
2013-06-25 09:21:25 +02:00
|
|
|
#include "base/scriptvariable.h"
|
2013-11-20 21:55:14 +01:00
|
|
|
#include "base/exception.h"
|
2014-03-18 11:44:09 +01:00
|
|
|
#include "base/dynamictype.h"
|
2013-03-16 21:18:53 +01:00
|
|
|
#include <sstream>
|
|
|
|
#include <stack>
|
2013-03-27 13:50:53 +01:00
|
|
|
#include <boost/foreach.hpp>
|
2012-05-31 16:04:51 +02:00
|
|
|
|
2013-03-17 20:19:29 +01:00
|
|
|
#define YYLTYPE icinga::DebugInfo
|
2014-03-21 10:22:59 +01:00
|
|
|
#define YYERROR_VERBOSE
|
|
|
|
|
2014-03-21 14:43:45 +01:00
|
|
|
#define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
|
|
do { \
|
2014-03-21 15:41:00 +01:00
|
|
|
if (N) { \
|
2014-03-21 14:43:45 +01:00
|
|
|
(Current).Path = YYRHSLOC(Rhs, 1).Path; \
|
|
|
|
(Current).FirstLine = YYRHSLOC(Rhs, 1).FirstLine; \
|
|
|
|
(Current).FirstColumn = YYRHSLOC(Rhs, 1).FirstColumn; \
|
|
|
|
(Current).LastLine = YYRHSLOC(Rhs, N).LastLine; \
|
|
|
|
(Current).LastColumn = YYRHSLOC(Rhs, N).LastColumn; \
|
|
|
|
} else { \
|
|
|
|
(Current).Path = YYRHSLOC(Rhs, 0).Path; \
|
|
|
|
(Current).FirstLine = (Current).LastLine = \
|
|
|
|
YYRHSLOC(Rhs, 0).LastLine; \
|
|
|
|
(Current).FirstColumn = (Current).LastColumn = \
|
|
|
|
YYRHSLOC(Rhs, 0).LastColumn; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2014-03-21 10:22:59 +01:00
|
|
|
#define YY_LOCATION_PRINT(file, loc) \
|
|
|
|
do { \
|
|
|
|
std::ostringstream msgbuf; \
|
|
|
|
msgbuf << loc; \
|
|
|
|
std::string str = msgbuf.str(); \
|
|
|
|
fputs(str.c_str(), file); \
|
|
|
|
} while (0)
|
2012-06-06 14:38:28 +02:00
|
|
|
|
2013-11-03 12:40:39 +01:00
|
|
|
using namespace icinga;
|
|
|
|
|
|
|
|
%}
|
2012-05-31 16:04:51 +02:00
|
|
|
|
2012-05-31 08:45:02 +02:00
|
|
|
%pure-parser
|
|
|
|
|
|
|
|
%locations
|
|
|
|
%defines
|
|
|
|
%error-verbose
|
|
|
|
|
2012-06-06 14:38:28 +02:00
|
|
|
%parse-param { ConfigCompiler *context }
|
2012-05-31 08:45:02 +02:00
|
|
|
%lex-param { void *scanner }
|
|
|
|
|
|
|
|
%union {
|
|
|
|
char *text;
|
2012-07-11 21:03:22 +02:00
|
|
|
double num;
|
2012-08-02 09:38:08 +02:00
|
|
|
icinga::Value *variant;
|
2014-03-23 11:27:40 +01:00
|
|
|
icinga::AExpression::OpCallback op;
|
2013-02-02 14:28:11 +01:00
|
|
|
icinga::TypeSpecifier type;
|
2013-03-27 13:50:53 +01:00
|
|
|
std::vector<String> *slist;
|
|
|
|
Array *array;
|
2012-05-31 08:45:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
%token <text> T_STRING
|
2013-02-01 22:44:58 +01:00
|
|
|
%token <text> T_STRING_ANGLE
|
2012-05-31 08:45:02 +02:00
|
|
|
%token <num> T_NUMBER
|
2012-06-01 16:49:33 +02:00
|
|
|
%token T_NULL
|
2012-05-31 16:04:51 +02:00
|
|
|
%token <text> T_IDENTIFIER
|
2014-03-23 11:27:40 +01:00
|
|
|
|
2014-03-18 08:34:56 +01:00
|
|
|
%token <op> T_SET "= (T_SET)"
|
2014-03-23 11:27:40 +01:00
|
|
|
%token <op> T_SET_PLUS "+= (T_SET_PLUS)"
|
|
|
|
%token <op> T_SET_MINUS "-= (T_SET_MINUS)"
|
|
|
|
%token <op> T_SET_MULTIPLY "*= (T_SET_MULTIPLY)"
|
|
|
|
%token <op> T_SET_DIVIDE "/= (T_SET_DIVIDE)"
|
|
|
|
|
|
|
|
%token <op> T_SHIFT_LEFT "<< (T_SHIFT_LEFT)"
|
|
|
|
%token <op> T_SHIFT_RIGHT ">> (T_SHIFT_RIGHT)"
|
|
|
|
%token <op> T_EQUAL "== (T_EQUAL)"
|
|
|
|
%token <op> T_NOT_EQUAL "!= (T_NOT_EQUAL)"
|
|
|
|
%token <op> T_IN "in (T_IN)"
|
|
|
|
%token <op> T_NOT_IN "!in (T_NOT_IN)"
|
|
|
|
%token <op> T_LOGICAL_AND "&& (T_LOGICAL_AND)"
|
|
|
|
%token <op> T_LOGICAL_OR "|| (T_LOGICAL_OR)"
|
|
|
|
%token <op> T_LESS_THAN_OR_EQUAL "<= (T_LESS_THAN_OR_EQUAL)"
|
|
|
|
%token <op> T_GREATER_THAN_OR_EQUAL ">= (T_GREATER_THAN_OR_EQUAL)"
|
|
|
|
%token <op> T_PLUS "+ (T_PLUS)"
|
|
|
|
%token <op> T_MINUS "- (T_MINUS)"
|
|
|
|
%token <op> T_MULTIPLY "* (T_MULTIPLY)"
|
|
|
|
%token <op> T_DIVIDE "/ (T_DIVIDE)"
|
|
|
|
%token <op> T_BINARY_AND "& (T_BINARY_AND)"
|
|
|
|
%token <op> T_BINARY_OR "| (T_BINARY_OR)"
|
|
|
|
%token <op> T_LESS_THAN "< (T_LESS_THAN)"
|
|
|
|
%token <op> T_GREATER_THAN "> (T_GREATER_THAN)"
|
|
|
|
|
2013-12-04 11:04:36 +01:00
|
|
|
%token T_VAR "var (T_VAR)"
|
|
|
|
%token T_CONST "const (T_CONST)"
|
2013-03-27 13:50:53 +01:00
|
|
|
%token <type> T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)"
|
|
|
|
%token <type> T_TYPE_ARRAY "array (T_TYPE_ARRAY)"
|
|
|
|
%token <type> T_TYPE_NUMBER "number (T_TYPE_NUMBER)"
|
|
|
|
%token <type> T_TYPE_STRING "string (T_TYPE_STRING)"
|
|
|
|
%token <type> T_TYPE_SCALAR "scalar (T_TYPE_SCALAR)"
|
|
|
|
%token <type> T_TYPE_ANY "any (T_TYPE_ANY)"
|
2013-05-03 10:48:28 +02:00
|
|
|
%token <type> T_TYPE_NAME "name (T_TYPE_NAME)"
|
2013-03-27 13:50:53 +01:00
|
|
|
%token T_VALIDATOR "%validator (T_VALIDATOR)"
|
|
|
|
%token T_REQUIRE "%require (T_REQUIRE)"
|
|
|
|
%token T_ATTRIBUTE "%attribute (T_ATTRIBUTE)"
|
|
|
|
%token T_TYPE "type (T_TYPE)"
|
|
|
|
%token T_OBJECT "object (T_OBJECT)"
|
|
|
|
%token T_TEMPLATE "template (T_TEMPLATE)"
|
|
|
|
%token T_INCLUDE "include (T_INCLUDE)"
|
2013-11-29 10:39:48 +01:00
|
|
|
%token T_INCLUDE_RECURSIVE "include_recursive (T_INCLUDE_RECURSIVE)"
|
2013-03-27 13:50:53 +01:00
|
|
|
%token T_LIBRARY "library (T_LIBRARY)"
|
|
|
|
%token T_INHERITS "inherits (T_INHERITS)"
|
|
|
|
%token T_PARTIAL "partial (T_PARTIAL)"
|
2014-03-18 11:44:09 +01:00
|
|
|
%token T_APPLY "apply (T_APPLY)"
|
|
|
|
%token T_TO "to (T_TO)"
|
|
|
|
%token T_WHERE "where (T_WHERE)"
|
2013-01-29 12:11:05 +01:00
|
|
|
%type <text> identifier
|
2014-03-23 11:27:40 +01:00
|
|
|
%type <array> rterm_items
|
|
|
|
%type <array> rterm_items_inner
|
|
|
|
%type <array> lterm_items
|
|
|
|
%type <array> lterm_items_inner
|
2013-02-02 14:28:11 +01:00
|
|
|
%type <variant> typerulelist
|
2014-03-23 11:27:40 +01:00
|
|
|
%type <op> lbinary_op
|
|
|
|
%type <op> rbinary_op
|
2013-02-02 14:28:11 +01:00
|
|
|
%type <type> type
|
|
|
|
%type <num> partial_specifier
|
2013-03-27 13:50:53 +01:00
|
|
|
%type <slist> object_inherits_list
|
|
|
|
%type <slist> object_inherits_specifier
|
2014-03-23 11:27:40 +01:00
|
|
|
%type <variant> rterm
|
2014-03-23 22:41:37 +01:00
|
|
|
%type <variant> rterm_scope
|
2014-03-23 11:27:40 +01:00
|
|
|
%type <variant> lterm
|
2013-12-04 11:04:36 +01:00
|
|
|
%type <num> variable_decl
|
2014-03-18 15:29:04 +01:00
|
|
|
%left T_LOGICAL_OR
|
|
|
|
%left T_LOGICAL_AND
|
|
|
|
%left T_IN
|
|
|
|
%left T_NOT_IN
|
|
|
|
%nonassoc T_EQUAL
|
|
|
|
%nonassoc T_NOT_EQUAL
|
2012-05-31 16:04:51 +02:00
|
|
|
%left '+' '-'
|
|
|
|
%left '*' '/'
|
2013-06-25 09:21:25 +02:00
|
|
|
%left '&'
|
|
|
|
%left '|'
|
2014-03-19 10:51:09 +01:00
|
|
|
%right '~'
|
|
|
|
%right '!'
|
2012-05-31 08:45:02 +02:00
|
|
|
%{
|
|
|
|
|
2012-05-31 08:59:40 +02:00
|
|
|
int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
|
2012-05-31 08:45:02 +02:00
|
|
|
|
2012-08-07 21:02:12 +02:00
|
|
|
void yyerror(YYLTYPE *locp, ConfigCompiler *, const char *err)
|
2012-05-31 08:45:02 +02:00
|
|
|
{
|
2013-03-16 21:18:53 +01:00
|
|
|
std::ostringstream message;
|
2012-07-09 11:39:14 +02:00
|
|
|
message << *locp << ": " << err;
|
2014-03-21 15:39:25 +01:00
|
|
|
ConfigCompilerContext::GetInstance()->AddMessage(true, message.str(), *locp);
|
2012-05-31 08:45:02 +02:00
|
|
|
}
|
|
|
|
|
2012-06-06 14:38:28 +02:00
|
|
|
int yyparse(ConfigCompiler *context);
|
|
|
|
|
|
|
|
static bool m_Abstract;
|
2013-02-02 14:28:11 +01:00
|
|
|
|
2013-03-16 21:18:53 +01:00
|
|
|
static std::stack<TypeRuleList::Ptr> m_RuleLists;
|
2013-02-02 14:28:11 +01:00
|
|
|
static ConfigType::Ptr m_Type;
|
2012-05-31 10:16:32 +02:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
static Dictionary::Ptr m_ModuleScope;
|
|
|
|
|
2012-06-06 14:38:28 +02:00
|
|
|
void ConfigCompiler::Compile(void)
|
2012-05-31 10:16:32 +02:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
m_ModuleScope = make_shared<Dictionary>();
|
|
|
|
|
2013-02-05 13:06:42 +01:00
|
|
|
try {
|
|
|
|
yyparse(this);
|
2014-03-21 15:39:25 +01:00
|
|
|
} catch (const ConfigError& ex) {
|
2014-03-22 08:40:09 +01:00
|
|
|
const DebugInfo *di = boost::get_error_info<errinfo_debuginfo>(ex);
|
|
|
|
ConfigCompilerContext::GetInstance()->AddMessage(true, ex.what(), di ? *di : DebugInfo());
|
2013-03-16 21:18:53 +01:00
|
|
|
} catch (const std::exception& ex) {
|
2013-11-20 21:55:14 +01:00
|
|
|
ConfigCompilerContext::GetInstance()->AddMessage(true, DiagnosticInformation(ex));
|
2013-02-05 13:06:42 +01:00
|
|
|
}
|
2012-05-31 10:16:32 +02:00
|
|
|
}
|
|
|
|
|
2012-05-31 09:43:46 +02:00
|
|
|
#define scanner (context->GetScanner())
|
2012-05-31 08:45:02 +02:00
|
|
|
|
|
|
|
%}
|
|
|
|
|
|
|
|
%%
|
|
|
|
statements: /* empty */
|
|
|
|
| statements statement
|
|
|
|
;
|
|
|
|
|
2014-03-18 11:44:09 +01:00
|
|
|
statement: object | type | include | include_recursive | library | variable | apply
|
2014-03-22 09:50:44 +01:00
|
|
|
{ }
|
2014-03-23 11:27:40 +01:00
|
|
|
| lterm
|
2014-03-22 09:50:44 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr aexpr = *$1;
|
|
|
|
aexpr->Evaluate(m_ModuleScope);
|
2014-03-22 09:50:44 +01:00
|
|
|
delete $1;
|
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
include: T_INCLUDE rterm
|
2012-07-02 10:29:32 +02:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$2);
|
2013-08-30 12:04:24 +02:00
|
|
|
delete $2;
|
2014-03-23 11:27:40 +01:00
|
|
|
|
|
|
|
context->HandleInclude(aexpr->Evaluate(m_ModuleScope), false, DebugInfoRange(@1, @2));
|
2013-02-01 22:44:58 +01:00
|
|
|
}
|
|
|
|
| T_INCLUDE T_STRING_ANGLE
|
|
|
|
{
|
2014-03-21 10:22:59 +01:00
|
|
|
context->HandleInclude($2, true, DebugInfoRange(@1, @2));
|
2013-02-11 09:55:32 +01:00
|
|
|
free($2);
|
2012-07-02 10:29:32 +02:00
|
|
|
}
|
2013-11-29 10:39:48 +01:00
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
include_recursive: T_INCLUDE_RECURSIVE rterm
|
2013-11-29 10:39:48 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$2);
|
2013-11-29 10:39:48 +01:00
|
|
|
delete $2;
|
2014-03-23 11:27:40 +01:00
|
|
|
|
|
|
|
context->HandleIncludeRecursive(aexpr->Evaluate(m_ModuleScope), "*.conf", DebugInfoRange(@1, @2));
|
2013-11-29 10:39:48 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| T_INCLUDE_RECURSIVE rterm rterm
|
2013-11-29 10:39:48 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr aexpr1 = static_cast<AExpression::Ptr>(*$2);
|
2013-11-29 10:39:48 +01:00
|
|
|
delete $2;
|
2014-03-23 11:27:40 +01:00
|
|
|
|
|
|
|
AExpression::Ptr aexpr2 = static_cast<AExpression::Ptr>(*$3);
|
2013-11-29 10:39:48 +01:00
|
|
|
delete $3;
|
2014-03-23 11:27:40 +01:00
|
|
|
|
|
|
|
context->HandleIncludeRecursive(aexpr1->Evaluate(m_ModuleScope), aexpr2->Evaluate(m_ModuleScope), DebugInfoRange(@1, @3));
|
2013-11-29 10:39:48 +01:00
|
|
|
}
|
|
|
|
;
|
2012-05-31 08:45:02 +02:00
|
|
|
|
2013-01-17 15:05:34 +01:00
|
|
|
library: T_LIBRARY T_STRING
|
|
|
|
{
|
|
|
|
context->HandleLibrary($2);
|
2013-02-11 10:10:17 +01:00
|
|
|
free($2);
|
2013-01-17 15:05:34 +01:00
|
|
|
}
|
2013-12-04 11:04:36 +01:00
|
|
|
;
|
2013-01-17 15:05:34 +01:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
variable: variable_decl identifier T_SET rterm
|
2013-06-25 09:21:25 +02:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$4);
|
|
|
|
delete $4;
|
2013-09-10 16:03:36 +02:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
ScriptVariable::Ptr sv = ScriptVariable::Set($2, aexpr->Evaluate(m_ModuleScope));
|
2014-02-12 11:49:38 +01:00
|
|
|
sv->SetConstant(true);
|
2013-12-04 11:04:36 +01:00
|
|
|
|
2013-06-25 09:21:25 +02:00
|
|
|
free($2);
|
|
|
|
}
|
2013-12-04 11:04:36 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
variable_decl: T_VAR
|
|
|
|
{
|
|
|
|
$$ = true;
|
|
|
|
}
|
|
|
|
| T_CONST
|
|
|
|
{
|
|
|
|
$$ = false;
|
|
|
|
}
|
|
|
|
;
|
2013-06-25 09:21:25 +02:00
|
|
|
|
2013-01-29 12:11:05 +01:00
|
|
|
identifier: T_IDENTIFIER
|
|
|
|
| T_STRING
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2013-02-02 14:28:11 +01:00
|
|
|
type: partial_specifier T_TYPE identifier
|
|
|
|
{
|
|
|
|
String name = String($3);
|
2013-02-11 09:55:32 +01:00
|
|
|
free($3);
|
|
|
|
|
2013-08-20 11:06:04 +02:00
|
|
|
m_Type = ConfigType::GetByName(name);
|
2013-02-11 09:55:32 +01:00
|
|
|
|
2013-02-02 14:28:11 +01:00
|
|
|
if (!m_Type) {
|
|
|
|
if ($1)
|
2014-03-22 08:40:09 +01:00
|
|
|
BOOST_THROW_EXCEPTION(ConfigError("Partial type definition for unknown type '" + name + "'") << errinfo_debuginfo(DebugInfoRange(@1, @3)));
|
2013-02-02 14:28:11 +01:00
|
|
|
|
2014-03-21 10:22:59 +01:00
|
|
|
m_Type = make_shared<ConfigType>(name, DebugInfoRange(@1, @3));
|
2013-08-20 11:06:04 +02:00
|
|
|
m_Type->Register();
|
2013-02-02 14:28:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
type_inherits_specifier typerulelist
|
|
|
|
{
|
|
|
|
TypeRuleList::Ptr ruleList = *$6;
|
|
|
|
m_Type->GetRuleList()->AddRules(ruleList);
|
2013-02-06 00:32:05 +01:00
|
|
|
m_Type->GetRuleList()->AddRequires(ruleList);
|
|
|
|
|
|
|
|
String validator = ruleList->GetValidator();
|
|
|
|
if (!validator.IsEmpty())
|
|
|
|
m_Type->GetRuleList()->SetValidator(validator);
|
|
|
|
|
2013-02-02 14:28:11 +01:00
|
|
|
delete $6;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
partial_specifier: /* Empty */
|
|
|
|
{
|
|
|
|
$$ = 0;
|
|
|
|
}
|
|
|
|
| T_PARTIAL
|
|
|
|
{
|
|
|
|
$$ = 1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
typerulelist: '{'
|
|
|
|
{
|
2013-11-06 08:51:56 +01:00
|
|
|
m_RuleLists.push(make_shared<TypeRuleList>());
|
2013-02-02 14:28:11 +01:00
|
|
|
}
|
|
|
|
typerules
|
|
|
|
'}'
|
|
|
|
{
|
|
|
|
$$ = new Value(m_RuleLists.top());
|
|
|
|
m_RuleLists.pop();
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
typerules: typerules_inner
|
|
|
|
| typerules_inner ','
|
|
|
|
|
|
|
|
typerules_inner: /* empty */
|
|
|
|
| typerule
|
|
|
|
| typerules_inner ',' typerule
|
|
|
|
;
|
|
|
|
|
2013-02-06 00:32:05 +01:00
|
|
|
typerule: T_REQUIRE T_STRING
|
|
|
|
{
|
|
|
|
m_RuleLists.top()->AddRequire($2);
|
2013-02-11 10:10:17 +01:00
|
|
|
free($2);
|
2013-02-06 00:32:05 +01:00
|
|
|
}
|
|
|
|
| T_VALIDATOR T_STRING
|
|
|
|
{
|
|
|
|
m_RuleLists.top()->SetValidator($2);
|
2013-02-11 10:10:17 +01:00
|
|
|
free($2);
|
2013-02-06 00:32:05 +01:00
|
|
|
}
|
|
|
|
| T_ATTRIBUTE type T_STRING
|
2013-02-02 14:28:11 +01:00
|
|
|
{
|
2014-03-21 10:22:59 +01:00
|
|
|
TypeRule rule($2, String(), $3, TypeRuleList::Ptr(), DebugInfoRange(@1, @3));
|
2013-02-11 10:10:17 +01:00
|
|
|
free($3);
|
|
|
|
|
2013-02-02 14:28:11 +01:00
|
|
|
m_RuleLists.top()->AddRule(rule);
|
|
|
|
}
|
2013-05-03 10:48:28 +02:00
|
|
|
| T_ATTRIBUTE T_TYPE_NAME '(' identifier ')' T_STRING
|
|
|
|
{
|
2014-03-21 10:22:59 +01:00
|
|
|
TypeRule rule($2, $4, $6, TypeRuleList::Ptr(), DebugInfoRange(@1, @6));
|
2013-05-03 10:48:28 +02:00
|
|
|
free($4);
|
|
|
|
free($6);
|
|
|
|
|
|
|
|
m_RuleLists.top()->AddRule(rule);
|
|
|
|
}
|
2013-02-06 00:32:05 +01:00
|
|
|
| T_ATTRIBUTE type T_STRING typerulelist
|
2013-02-02 14:28:11 +01:00
|
|
|
{
|
2014-03-21 10:22:59 +01:00
|
|
|
TypeRule rule($2, String(), $3, *$4, DebugInfoRange(@1, @4));
|
2013-02-11 10:10:17 +01:00
|
|
|
free($3);
|
2013-02-06 00:32:05 +01:00
|
|
|
delete $4;
|
2013-02-02 14:28:11 +01:00
|
|
|
m_RuleLists.top()->AddRule(rule);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
type_inherits_specifier: /* empty */
|
2013-06-06 11:26:00 +02:00
|
|
|
| T_INHERITS identifier
|
2013-02-02 14:28:11 +01:00
|
|
|
{
|
|
|
|
m_Type->SetParent($2);
|
2013-02-11 10:10:17 +01:00
|
|
|
free($2);
|
2013-02-02 14:28:11 +01:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
type: T_TYPE_DICTIONARY
|
2013-03-14 12:17:46 +01:00
|
|
|
| T_TYPE_ARRAY
|
2013-02-02 14:28:11 +01:00
|
|
|
| T_TYPE_NUMBER
|
|
|
|
| T_TYPE_STRING
|
|
|
|
| T_TYPE_SCALAR
|
|
|
|
| T_TYPE_ANY
|
2013-05-03 10:48:28 +02:00
|
|
|
| T_TYPE_NAME
|
2013-02-02 14:28:11 +01:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2013-02-11 09:55:32 +01:00
|
|
|
object:
|
2012-06-01 16:49:33 +02:00
|
|
|
{
|
|
|
|
m_Abstract = false;
|
|
|
|
}
|
2014-03-23 22:41:37 +01:00
|
|
|
object_declaration identifier rterm object_inherits_specifier rterm_scope
|
2012-06-01 16:49:33 +02:00
|
|
|
{
|
2014-03-21 14:48:18 +01:00
|
|
|
DebugInfo di = DebugInfoRange(@2, @6);
|
|
|
|
ConfigItemBuilder::Ptr item = make_shared<ConfigItemBuilder>(di);
|
2013-02-11 09:55:32 +01:00
|
|
|
|
2014-03-23 22:41:37 +01:00
|
|
|
AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$4);
|
|
|
|
delete $4;
|
|
|
|
|
|
|
|
String name = aexpr->Evaluate(m_ModuleScope);
|
|
|
|
|
|
|
|
ConfigItem::Ptr oldItem = ConfigItem::GetObject($3, name);
|
2014-03-20 15:37:59 +01:00
|
|
|
|
|
|
|
if (oldItem) {
|
|
|
|
std::ostringstream msgbuf;
|
2014-03-23 22:41:37 +01:00
|
|
|
msgbuf << "Object '" << name << "' of type '" << $3 << "' re-defined: " << di << "; previous definition: " << oldItem->GetDebugInfo();
|
2014-03-20 15:37:59 +01:00
|
|
|
free($3);
|
|
|
|
delete $5;
|
2014-03-22 08:40:09 +01:00
|
|
|
BOOST_THROW_EXCEPTION(ConfigError(msgbuf.str()) << errinfo_debuginfo(di));
|
2014-03-20 15:37:59 +01:00
|
|
|
}
|
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
item->SetType($3);
|
2013-02-11 09:55:32 +01:00
|
|
|
|
2014-03-23 22:41:37 +01:00
|
|
|
if (name.FindFirstOf("!") != String::NPos) {
|
2013-05-08 10:50:56 +02:00
|
|
|
std::ostringstream msgbuf;
|
2014-03-23 22:41:37 +01:00
|
|
|
msgbuf << "Name for object '" << name << "' of type '" << $3 << "' is invalid: Object names may not contain '!'";
|
2013-05-08 10:50:56 +02:00
|
|
|
free($3);
|
2014-03-22 08:40:09 +01:00
|
|
|
BOOST_THROW_EXCEPTION(ConfigError(msgbuf.str()) << errinfo_debuginfo(@4));
|
2013-05-08 10:50:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
free($3);
|
2013-05-07 09:22:39 +02:00
|
|
|
|
2014-03-23 22:41:37 +01:00
|
|
|
item->SetName(name);
|
2013-02-11 09:55:32 +01:00
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
if ($5) {
|
|
|
|
BOOST_FOREACH(const String& parent, *$5) {
|
|
|
|
item->AddParent(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete $5;
|
|
|
|
}
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr exprl = static_cast<AExpression::Ptr>(*$6);
|
|
|
|
delete $6;
|
|
|
|
|
|
|
|
exprl->MakeInline();
|
|
|
|
item->AddExpression(exprl);
|
2012-05-31 08:45:02 +02:00
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
item->SetAbstract(m_Abstract);
|
2012-06-01 16:49:33 +02:00
|
|
|
|
2013-08-20 11:06:04 +02:00
|
|
|
item->Compile()->Register();
|
2013-03-27 13:50:53 +01:00
|
|
|
item.reset();
|
2012-06-01 16:49:33 +02:00
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
|
|
|
|
2013-09-25 14:10:26 +02:00
|
|
|
object_declaration: T_OBJECT
|
2013-02-16 09:18:34 +01:00
|
|
|
| T_TEMPLATE
|
|
|
|
{
|
|
|
|
m_Abstract = true;
|
|
|
|
}
|
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
object_inherits_list:
|
2012-06-01 16:49:33 +02:00
|
|
|
{
|
2013-03-27 13:50:53 +01:00
|
|
|
$$ = NULL;
|
2012-06-01 16:49:33 +02:00
|
|
|
}
|
2013-03-27 13:50:53 +01:00
|
|
|
| T_STRING
|
|
|
|
{
|
|
|
|
$$ = new std::vector<String>();
|
|
|
|
$$->push_back($1);
|
2013-04-04 13:51:36 +02:00
|
|
|
free($1);
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
|
|
|
| object_inherits_list ',' T_STRING
|
|
|
|
{
|
|
|
|
if ($1)
|
|
|
|
$$ = $1;
|
|
|
|
else
|
|
|
|
$$ = new std::vector<String>();
|
2012-05-31 08:45:02 +02:00
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
$$->push_back($3);
|
2013-04-04 13:51:36 +02:00
|
|
|
free($3);
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
|
|
|
|
2013-03-27 13:50:53 +01:00
|
|
|
object_inherits_specifier:
|
2012-05-31 16:04:51 +02:00
|
|
|
{
|
2013-03-27 13:50:53 +01:00
|
|
|
$$ = NULL;
|
2012-05-31 16:04:51 +02:00
|
|
|
}
|
2013-03-27 13:50:53 +01:00
|
|
|
| T_INHERITS object_inherits_list
|
2012-05-31 16:04:51 +02:00
|
|
|
{
|
2013-03-27 13:50:53 +01:00
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
lbinary_op: T_SET
|
|
|
|
| T_SET_PLUS
|
|
|
|
| T_SET_MINUS
|
|
|
|
| T_SET_MULTIPLY
|
|
|
|
| T_SET_DIVIDE
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
$$ = $1;
|
2012-05-31 16:04:51 +02:00
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
lterm_items: lterm_items_inner
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| lterm_items_inner ','
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2012-06-29 10:39:36 +02:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
lterm_items_inner: /* empty */
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
2014-03-23 19:58:24 +01:00
|
|
|
$$ = new Array();
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| lterm
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
$$ = new Array();
|
|
|
|
$$->Add(*$1);
|
2013-04-04 13:51:36 +02:00
|
|
|
delete $1;
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| lterm_items_inner ',' lterm
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
|
|
|
if ($1)
|
|
|
|
$$ = $1;
|
|
|
|
else
|
2014-03-23 11:27:40 +01:00
|
|
|
$$ = new Array();
|
2013-03-27 13:50:53 +01:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
$$->Add(*$3);
|
2013-04-04 13:51:36 +02:00
|
|
|
delete $3;
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
|
|
|
|
2014-03-23 19:58:24 +01:00
|
|
|
lterm: identifier lbinary_op rterm
|
2012-05-31 16:04:51 +02:00
|
|
|
{
|
2014-03-23 17:26:31 +01:00
|
|
|
AExpression::Ptr aexpr = static_cast<AExpression::Ptr>(*$3);
|
|
|
|
$$ = new Value(make_shared<AExpression>($2, $1, aexpr, DebugInfoRange(@1, @3)));
|
2014-03-23 19:58:24 +01:00
|
|
|
free($1);
|
2012-05-31 16:04:51 +02:00
|
|
|
delete $3;
|
2012-06-01 16:49:33 +02:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| identifier '[' T_STRING ']' lbinary_op rterm
|
2012-06-01 16:49:33 +02:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
AExpression::Ptr subexpr = make_shared<AExpression>($5, $3, static_cast<AExpression::Ptr>(*$6), DebugInfoRange(@1, @6));
|
2012-06-01 16:49:33 +02:00
|
|
|
free($3);
|
|
|
|
delete $6;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
Array::Ptr subexprl = make_shared<Array>();
|
|
|
|
subexprl->Add(subexpr);
|
|
|
|
|
|
|
|
AExpression::Ptr expr = make_shared<AExpression>(&AExpression::OpDict, subexprl, DebugInfoRange(@1, @6));
|
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpSetPlus, $1, expr, DebugInfoRange(@1, @6)));
|
2012-06-06 14:38:28 +02:00
|
|
|
free($1);
|
2012-06-01 16:49:33 +02:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| rterm
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2012-05-31 16:04:51 +02:00
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
rbinary_op: T_PLUS
|
|
|
|
| T_MINUS
|
|
|
|
| T_MULTIPLY
|
|
|
|
| T_DIVIDE
|
|
|
|
| T_BINARY_AND
|
|
|
|
| T_BINARY_OR
|
|
|
|
| T_LESS_THAN
|
|
|
|
| T_GREATER_THAN
|
|
|
|
| T_LESS_THAN_OR_EQUAL
|
|
|
|
| T_GREATER_THAN_OR_EQUAL
|
|
|
|
| T_EQUAL
|
|
|
|
| T_NOT_EQUAL
|
|
|
|
| T_IN
|
|
|
|
| T_NOT_IN
|
|
|
|
| T_LOGICAL_AND
|
|
|
|
| T_LOGICAL_OR
|
|
|
|
| T_SHIFT_LEFT
|
|
|
|
| T_SHIFT_RIGHT
|
2012-05-31 16:04:51 +02:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
;
|
2014-03-23 11:27:40 +01:00
|
|
|
|
|
|
|
rterm_items: rterm_items_inner
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| rterm_items_inner ','
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
;
|
2013-03-14 12:17:46 +01:00
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
rterm_items_inner: /* empty */
|
2013-03-27 13:50:53 +01:00
|
|
|
{
|
2014-03-23 19:58:24 +01:00
|
|
|
$$ = new Array();
|
2013-03-27 13:50:53 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| rterm
|
2013-03-14 12:17:46 +01:00
|
|
|
{
|
2013-03-27 13:50:53 +01:00
|
|
|
$$ = new Array();
|
|
|
|
$$->Add(*$1);
|
2013-04-04 13:51:36 +02:00
|
|
|
delete $1;
|
2013-03-14 12:17:46 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| rterm_items_inner ',' rterm
|
2013-03-14 12:17:46 +01:00
|
|
|
{
|
2013-03-27 13:50:53 +01:00
|
|
|
if ($1)
|
|
|
|
$$ = $1;
|
|
|
|
else
|
|
|
|
$$ = new Array();
|
|
|
|
|
|
|
|
$$->Add(*$3);
|
2013-04-04 13:51:36 +02:00
|
|
|
delete $3;
|
2013-03-14 12:17:46 +01:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
rbinary_op: '+'
|
|
|
|
{
|
|
|
|
$$ = &AExpression::OpAdd;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2014-03-23 22:41:37 +01:00
|
|
|
rterm_scope: '{' lterm_items '}'
|
|
|
|
{
|
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpDict, Array::Ptr($2), DebugInfoRange(@1, @3)));
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
rterm: T_STRING
|
2012-05-31 16:04:51 +02:00
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpLiteral, $1, @1));
|
2012-06-06 14:38:28 +02:00
|
|
|
free($1);
|
2012-05-31 16:04:51 +02:00
|
|
|
}
|
|
|
|
| T_NUMBER
|
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpLiteral, $1, @1));
|
2012-05-31 16:04:51 +02:00
|
|
|
}
|
2012-06-01 16:49:33 +02:00
|
|
|
| T_NULL
|
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpLiteral, Empty, @1));
|
2012-06-01 16:49:33 +02:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| T_IDENTIFIER '(' rterm_items ')'
|
2013-03-14 12:17:46 +01:00
|
|
|
{
|
2014-03-19 10:51:09 +01:00
|
|
|
Array::Ptr arguments = Array::Ptr($3);
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpFunctionCall, $1, make_shared<AExpression>(&AExpression::OpLiteral, arguments, @3), DebugInfoRange(@1, @4)));
|
2014-03-19 10:51:09 +01:00
|
|
|
free($1);
|
2013-08-30 12:04:24 +02:00
|
|
|
}
|
|
|
|
| T_IDENTIFIER
|
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpVariable, $1, @1));
|
2013-06-25 09:21:25 +02:00
|
|
|
free($1);
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| '!' rterm
|
2014-03-19 10:51:09 +01:00
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpNegate, static_cast<AExpression::Ptr>(*$2), DebugInfoRange(@1, @2)));
|
2014-03-19 10:51:09 +01:00
|
|
|
delete $2;
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| '~' rterm
|
2013-11-20 16:41:48 +01:00
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpNegate, static_cast<AExpression::Ptr>(*$2), DebugInfoRange(@1, @2)));
|
2013-12-04 10:39:46 +01:00
|
|
|
delete $2;
|
2013-11-20 16:41:48 +01:00
|
|
|
}
|
2014-03-23 17:26:31 +01:00
|
|
|
| identifier '[' T_STRING ']'
|
|
|
|
{
|
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpIndexer, $1, $3, DebugInfoRange(@1, @4)));
|
|
|
|
free($1);
|
|
|
|
free($3);
|
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| '[' rterm_items ']'
|
2014-03-19 10:51:09 +01:00
|
|
|
{
|
2014-03-22 10:29:45 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>(&AExpression::OpArray, Array::Ptr($2), DebugInfoRange(@1, @3)));
|
2014-03-19 10:51:09 +01:00
|
|
|
}
|
2014-03-23 22:41:37 +01:00
|
|
|
| rterm_scope
|
2013-06-25 09:21:25 +02:00
|
|
|
{
|
2014-03-23 22:41:37 +01:00
|
|
|
$$ = $1;
|
2013-06-25 09:21:25 +02:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| '(' rterm ')'
|
2013-06-25 09:21:25 +02:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
$$ = $2;
|
2014-03-18 15:29:04 +01:00
|
|
|
}
|
2014-03-23 11:27:40 +01:00
|
|
|
| rterm rbinary_op rterm
|
2014-03-18 15:29:04 +01:00
|
|
|
{
|
2014-03-23 11:27:40 +01:00
|
|
|
$$ = new Value(make_shared<AExpression>($2, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3), DebugInfoRange(@1, @3)));
|
2014-03-18 15:29:04 +01:00
|
|
|
delete $1;
|
|
|
|
delete $3;
|
2013-06-25 09:21:25 +02:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2014-03-18 11:44:09 +01:00
|
|
|
optional_template: /* empty */
|
|
|
|
| T_TEMPLATE
|
|
|
|
;
|
|
|
|
|
2014-03-23 11:27:40 +01:00
|
|
|
apply: T_APPLY optional_template identifier identifier T_TO identifier T_WHERE rterm
|
2014-03-18 11:44:09 +01:00
|
|
|
{
|
|
|
|
if (!ApplyRule::IsValidCombination($3, $6)) {
|
2014-03-22 08:40:09 +01:00
|
|
|
BOOST_THROW_EXCEPTION(ConfigError("'apply' cannot be used with types '" + String($3) + "' and '" + String($6) + "'.") << errinfo_debuginfo(@1));
|
2014-03-18 11:44:09 +01:00
|
|
|
}
|
|
|
|
|
2014-03-20 13:02:02 +01:00
|
|
|
Array::Ptr arguments = make_shared<Array>();
|
|
|
|
arguments->Add(*$8);
|
2014-03-18 11:44:09 +01:00
|
|
|
delete $8;
|
2014-03-20 13:02:02 +01:00
|
|
|
|
2014-03-22 10:29:45 +01:00
|
|
|
AExpression::Ptr aexpr = make_shared<AExpression>(&AExpression::OpFunctionCall, "bool", make_shared<AExpression>(&AExpression::OpLiteral, arguments, @8), @8);
|
2014-03-20 13:02:02 +01:00
|
|
|
|
2014-03-21 10:22:59 +01:00
|
|
|
ApplyRule::AddRule($3, $4, $6, aexpr, DebugInfoRange(@1, @8));
|
2014-03-18 11:44:09 +01:00
|
|
|
}
|
2012-05-31 08:45:02 +02:00
|
|
|
%%
|