diff --git a/src/App/ExpressionParser.l b/src/App/ExpressionParser.l
index 66c4435957..4dce7e319d 100644
--- a/src/App/ExpressionParser.l
+++ b/src/App/ExpressionParser.l
@@ -231,9 +231,9 @@ EXPO [eE][-+]?[0-9]+
"cd" COUNTCHARS; yylval.quantity.scaler = Quantity::Candela; yylval.quantity.unitStr = yytext; return UNIT; // Candela (internal standard luminous intensity)
"in" COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quantity.unitStr = yytext; return UNIT; // inch
-"\"" COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quantity.unitStr = yytext; return UNIT; // inch
+"\"" COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quantity.unitStr = yytext; return USUNIT; // inch
"ft" COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quantity.unitStr = yytext; return UNIT; // foot
-"'" COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quantity.unitStr = yytext; return UNIT; // foot
+"'" COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quantity.unitStr = yytext; return USUNIT; // foot
"thou" COUNTCHARS; yylval.quantity.scaler = Quantity::Thou; yylval.quantity.unitStr = yytext; return UNIT; // thou (in/1000)
"mil" COUNTCHARS; yylval.quantity.scaler = Quantity::Thou; yylval.quantity.unitStr = yytext; return UNIT; // mil (the thou in US)
"yd" COUNTCHARS; yylval.quantity.scaler = Quantity::Yard; yylval.quantity.unitStr = yytext; return UNIT; // yard
diff --git a/src/App/ExpressionParser.tab.c b/src/App/ExpressionParser.tab.c
index 0ec2c544a5..3c1dcc7510 100644
--- a/src/App/ExpressionParser.tab.c
+++ b/src/App/ExpressionParser.tab.c
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
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
@@ -15,7 +16,7 @@
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, see . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -33,6 +34,10 @@
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
@@ -40,11 +45,11 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-/* Identify Bison output. */
-#define YYBISON 1
+/* Identify Bison output, and Bison version. */
+#define YYBISON 30802
-/* Bison version. */
-#define YYBISON_VERSION "3.0.4"
+/* Bison version string. */
+#define YYBISON_VERSION "3.8.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -61,118 +66,198 @@
-/* Copy the first part of user declarations. */
-#line 28 "ExpressionParser.y" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 28 "ExpressionParser.y"
+
+
+#define YYSTYPE App::ExpressionParser::semantic_type
+
+std::stack functions; /**< Function identifier */
+
+ //#define YYSTYPE yystype
+ #define yyparse ExpressionParser_yyparse
+ #define yyerror ExpressionParser_yyerror
+#line 82 "ExpressionParser.tab.c"
-#define YYSTYPE App::ExpressionParser::semantic_type
-
-std::stack functions; /**< Function identifier */
-
- //#define YYSTYPE yystype
- #define yyparse ExpressionParser_yyparse
- #define yyerror ExpressionParser_yyerror
-
-#line 77 "ExpressionParser.tab.c" /* yacc.c:339 */
-
-# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val)
# else
-# define YY_NULLPTR 0
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# else
+# define YY_NULLPTR ((void*)0)
# endif
# endif
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* In a future release of Bison, this section will be replaced
- by #include "ExpressionParser.tab.h". */
-#ifndef YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED
-# define YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED
-/* Debug traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int yydebug;
-#endif
-
-/* Token type. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- enum yytokentype
- {
- FUNC = 258,
- ONE = 259,
- NUM = 260,
- IDENTIFIER = 261,
- UNIT = 262,
- INTEGER = 263,
- CONSTANT = 264,
- CELLADDRESS = 265,
- EQ = 266,
- NEQ = 267,
- LT = 268,
- GT = 269,
- GTE = 270,
- LTE = 271,
- STRING = 272,
- MINUSSIGN = 273,
- PROPERTY_REF = 274,
- DOCUMENT = 275,
- OBJECT = 276,
- EXPONENT = 277,
- NUM_AND_UNIT = 278,
- NEG = 279,
- POS = 280
- };
-#endif
-
-/* Value type. */
+#include "ExpressionParser.tab.h"
+/* Symbol kind. */
+enum yysymbol_kind_t
+{
+ YYSYMBOL_YYEMPTY = -2,
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
+ YYSYMBOL_YYerror = 1, /* error */
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
+ YYSYMBOL_FUNC = 3, /* FUNC */
+ YYSYMBOL_ONE = 4, /* ONE */
+ YYSYMBOL_NUM = 5, /* NUM */
+ YYSYMBOL_IDENTIFIER = 6, /* IDENTIFIER */
+ YYSYMBOL_UNIT = 7, /* UNIT */
+ YYSYMBOL_USUNIT = 8, /* USUNIT */
+ YYSYMBOL_INTEGER = 9, /* INTEGER */
+ YYSYMBOL_CONSTANT = 10, /* CONSTANT */
+ YYSYMBOL_CELLADDRESS = 11, /* CELLADDRESS */
+ YYSYMBOL_EQ = 12, /* EQ */
+ YYSYMBOL_NEQ = 13, /* NEQ */
+ YYSYMBOL_LT = 14, /* LT */
+ YYSYMBOL_GT = 15, /* GT */
+ YYSYMBOL_GTE = 16, /* GTE */
+ YYSYMBOL_LTE = 17, /* LTE */
+ YYSYMBOL_STRING = 18, /* STRING */
+ YYSYMBOL_MINUSSIGN = 19, /* MINUSSIGN */
+ YYSYMBOL_PROPERTY_REF = 20, /* PROPERTY_REF */
+ YYSYMBOL_DOCUMENT = 21, /* DOCUMENT */
+ YYSYMBOL_OBJECT = 22, /* OBJECT */
+ YYSYMBOL_EXPONENT = 23, /* EXPONENT */
+ YYSYMBOL_24_ = 24, /* ':' */
+ YYSYMBOL_25_ = 25, /* '+' */
+ YYSYMBOL_26_ = 26, /* '*' */
+ YYSYMBOL_27_ = 27, /* '/' */
+ YYSYMBOL_28_ = 28, /* '%' */
+ YYSYMBOL_NUM_AND_UNIT = 29, /* NUM_AND_UNIT */
+ YYSYMBOL_30_ = 30, /* '^' */
+ YYSYMBOL_NEG = 31, /* NEG */
+ YYSYMBOL_POS = 32, /* POS */
+ YYSYMBOL_33_ = 33, /* ')' */
+ YYSYMBOL_34_ = 34, /* '?' */
+ YYSYMBOL_35_ = 35, /* '(' */
+ YYSYMBOL_36_ = 36, /* ',' */
+ YYSYMBOL_37_ = 37, /* ';' */
+ YYSYMBOL_38_ = 38, /* '.' */
+ YYSYMBOL_39_ = 39, /* '#' */
+ YYSYMBOL_40_ = 40, /* '[' */
+ YYSYMBOL_41_ = 41, /* ']' */
+ YYSYMBOL_YYACCEPT = 42, /* $accept */
+ YYSYMBOL_input = 43, /* input */
+ YYSYMBOL_unit_num = 44, /* unit_num */
+ YYSYMBOL_exp = 45, /* exp */
+ YYSYMBOL_num = 46, /* num */
+ YYSYMBOL_args = 47, /* args */
+ YYSYMBOL_range = 48, /* range */
+ YYSYMBOL_cond = 49, /* cond */
+ YYSYMBOL_us_building_unit = 50, /* us_building_unit */
+ YYSYMBOL_other_unit = 51, /* other_unit */
+ YYSYMBOL_unit_exp = 52, /* unit_exp */
+ YYSYMBOL_integer = 53, /* integer */
+ YYSYMBOL_id_or_cell = 54, /* id_or_cell */
+ YYSYMBOL_identifier = 55, /* identifier */
+ YYSYMBOL_iden = 56, /* iden */
+ YYSYMBOL_indexer = 57, /* indexer */
+ YYSYMBOL_indexable = 58, /* indexable */
+ YYSYMBOL_document = 59, /* document */
+ YYSYMBOL_object = 60 /* object */
+};
+typedef enum yysymbol_kind_t yysymbol_kind_t;
-extern YYSTYPE yylval;
-int yyparse (void);
-
-#endif /* !YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED */
-
-/* Copy the second part of user declarations. */
-
-#line 149 "ExpressionParser.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ and (if available) are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+/* Work around bug in HP-UX 11.23, which defines these macros
+ incorrectly for preprocessor constants. This workaround can likely
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
+ . */
+#ifdef __hpux
+# undef UINT_LEAST8_MAX
+# undef UINT_LEAST16_MAX
+# define UINT_LEAST8_MAX 255
+# define UINT_LEAST16_MAX 65535
+#endif
+
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short int yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -180,15 +265,28 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_uint8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -202,47 +300,43 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define YY_ATTRIBUTE(Spec) /* empty */
+# define YY_ATTRIBUTE_PURE
# endif
#endif
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
+# define YY_USE(E) ((void) (E))
#else
-# define YYUSE(E) /* empty */
+# define YY_USE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+# else
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# endif
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -255,8 +349,22 @@ typedef short int yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
-#if ! defined yyoverflow || YYERROR_VERBOSE
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
+#if !defined yyoverflow
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -321,8 +429,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
+#endif /* !defined yyoverflow */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
@@ -331,17 +438,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -354,11 +461,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
@@ -370,12 +477,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -385,41 +492,44 @@ union yyalloc
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 38
+#define YYFINAL 42
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 411
+#define YYLAST 425
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 41
+#define YYNTOKENS 42
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 16
+#define YYNNTS 19
/* YYNRULES -- Number of rules. */
-#define YYNRULES 72
+#define YYNRULES 77
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 136
+#define YYNSTATES 143
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 280
+/* YYMAXUTOK -- Last valid token kind. */
+#define YYMAXUTOK 281
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
+#define YYTRANSLATE(YYX) \
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
+ : YYSYMBOL_YYUNDEF)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
-static const yytype_uint8 yytranslate[] =
+ as returned by yylex. */
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 38, 2, 27, 2, 2,
- 34, 32, 25, 24, 35, 2, 37, 26, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 23, 36,
- 2, 2, 2, 33, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 39, 2, 28, 2, 2,
+ 35, 33, 26, 25, 36, 2, 38, 27, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 24, 37,
+ 2, 2, 2, 34, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 39, 2, 40, 29, 2, 2, 2, 2, 2,
+ 2, 40, 2, 41, 30, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -437,294 +547,300 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 28, 30,
- 31
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 29,
+ 31, 32
};
#if YYDEBUG
- /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 85, 85, 86, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 108, 109, 110, 111, 113, 114, 115, 116, 117,
- 118, 121, 124, 125, 126, 127, 128, 129, 130, 133,
- 134, 135, 136, 137, 138, 141, 142, 146, 147, 151,
- 152, 156, 161, 166, 172, 179, 186, 193, 197, 198,
- 199, 200, 201, 202, 203, 204, 208, 209, 210, 214,
- 215, 219, 220
+ 0, 86, 86, 87, 90, 91, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 113, 114, 115, 116, 118, 119, 120,
+ 121, 122, 123, 126, 129, 130, 131, 132, 133, 134,
+ 135, 138, 139, 141, 142, 143, 144, 145, 146, 147,
+ 150, 151, 155, 156, 160, 161, 165, 170, 175, 181,
+ 188, 195, 202, 206, 207, 208, 209, 210, 211, 212,
+ 213, 217, 218, 219, 223, 224, 228, 229
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || 0
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
+
+#if YYDEBUG || 0
+/* The user-facing name of the symbol whose (internal) number is
+ YYSYMBOL. No bounds checking. */
+static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
+
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "FUNC", "ONE", "NUM", "IDENTIFIER",
- "UNIT", "INTEGER", "CONSTANT", "CELLADDRESS", "EQ", "NEQ", "LT", "GT",
- "GTE", "LTE", "STRING", "MINUSSIGN", "PROPERTY_REF", "DOCUMENT",
- "OBJECT", "EXPONENT", "':'", "'+'", "'*'", "'/'", "'%'", "NUM_AND_UNIT",
- "'^'", "NEG", "POS", "')'", "'?'", "'('", "','", "';'", "'.'", "'#'",
- "'['", "']'", "$accept", "input", "exp", "num", "args", "range", "cond",
+ "\"end of file\"", "error", "\"invalid token\"", "FUNC", "ONE", "NUM",
+ "IDENTIFIER", "UNIT", "USUNIT", "INTEGER", "CONSTANT", "CELLADDRESS",
+ "EQ", "NEQ", "LT", "GT", "GTE", "LTE", "STRING", "MINUSSIGN",
+ "PROPERTY_REF", "DOCUMENT", "OBJECT", "EXPONENT", "':'", "'+'", "'*'",
+ "'/'", "'%'", "NUM_AND_UNIT", "'^'", "NEG", "POS", "')'", "'?'", "'('",
+ "','", "';'", "'.'", "'#'", "'['", "']'", "$accept", "input", "unit_num",
+ "exp", "num", "args", "range", "cond", "us_building_unit", "other_unit",
"unit_exp", "integer", "id_or_cell", "identifier", "iden", "indexer",
"indexable", "document", "object", YY_NULLPTR
};
+
+static const char *
+yysymbol_name (yysymbol_kind_t yysymbol)
+{
+ return yytname[yysymbol];
+}
#endif
-# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
- (internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 58, 43, 42, 47, 37, 278, 94,
- 279, 280, 41, 63, 40, 44, 59, 46, 35, 91,
- 93
-};
-# endif
+#define YYPACT_NINF (-18)
-#define YYPACT_NINF -30
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-30)))
+#define YYTABLE_NINF (-78)
-#define YYTABLE_NINF -73
-
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 97, 193, -30, -30, -29, -30, -30, -30, -30, -7,
- 193, 193, 97, 77, 38, 382, -5, 11, 34, 31,
- 19, 54, 30, 55, 59, 193, 382, -21, -30, -18,
- -30, -30, 341, 4, -19, -30, 62, -30, -30, 193,
- 193, 193, 193, 193, 193, 193, 193, 193, 97, 193,
- 193, -5, 63, 193, -5, -5, 0, 149, -30, 102,
- 103, -30, 78, 110, -30, 193, 193, 18, -30, -30,
- -30, 18, 382, 382, 382, 382, 382, 382, 111, 111,
- 81, 81, 63, 81, -30, 363, 63, 63, -30, -30,
- 82, -30, 171, 208, -30, -30, -30, -30, 74, 80,
- -30, 382, -30, 382, -30, -30, -30, 193, -30, 193,
- 227, 17, -30, 113, 18, 21, 265, 193, -30, 193,
- -30, 246, 85, -30, -30, -30, 284, 303, 193, -30,
- 18, -30, -30, 322, -30, -30
+ 103, 206, -18, -18, 9, -18, -18, -18, -18, -18,
+ 1, 206, 206, 103, 10, 57, -18, 395, 7, 29,
+ -18, -18, 38, 54, 60, 64, 34, 66, 88, 206,
+ 395, -7, -18, -16, -18, -18, 354, 82, 23, -18,
+ 91, -18, -18, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 103, 206, 206, 7, 84, 100, 206, 7,
+ 7, 8, 160, -18, 126, 127, -18, 25, 40, -18,
+ 206, 206, 26, -18, -18, -18, 26, 395, 395, 395,
+ 395, 395, 395, 97, 97, 104, 104, 100, 104, -18,
+ 129, 376, 100, 100, -18, -18, 51, -18, 183, 221,
+ -18, -18, -18, -18, 101, 102, -18, 395, -18, 395,
+ -18, -18, -18, -18, 206, -18, 206, 240, 0, -18,
+ 41, 26, 71, 278, 206, -18, 206, -18, 259, 105,
+ -18, -18, -18, 297, 316, 206, -18, 26, -18, -18,
+ 335, -18, -18
};
- /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE does not specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_int8 yydefact[] =
{
- 0, 0, 21, 22, 47, 39, 23, 24, 48, 6,
- 0, 0, 0, 0, 0, 2, 4, 0, 3, 49,
- 7, 50, 17, 0, 0, 0, 25, 0, 26, 49,
- 8, 9, 0, 0, 0, 47, 0, 52, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5, 0, 0, 0, 0, 0, 66, 0,
- 0, 67, 0, 0, 18, 0, 0, 0, 20, 38,
- 44, 0, 32, 33, 34, 35, 36, 37, 11, 10,
- 12, 13, 15, 14, 16, 0, 41, 40, 46, 45,
- 0, 42, 0, 0, 57, 68, 71, 72, 0, 0,
- 54, 27, 29, 28, 30, 31, 51, 0, 43, 0,
- 0, 0, 58, 0, 0, 19, 0, 0, 60, 0,
- 59, 0, 0, 55, 53, 61, 0, 0, 0, 62,
- 0, 64, 63, 0, 56, 65
+ 0, 0, 23, 24, 52, 42, 41, 25, 26, 53,
+ 8, 0, 0, 0, 0, 0, 7, 2, 6, 0,
+ 44, 43, 3, 54, 9, 55, 19, 0, 0, 0,
+ 27, 0, 28, 54, 10, 11, 0, 0, 0, 52,
+ 0, 57, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 44, 4, 0, 0,
+ 0, 0, 0, 71, 0, 0, 72, 0, 0, 20,
+ 0, 0, 0, 22, 40, 49, 0, 34, 35, 36,
+ 37, 38, 39, 13, 12, 14, 15, 17, 16, 18,
+ 0, 0, 46, 45, 51, 50, 0, 47, 0, 0,
+ 62, 73, 76, 77, 0, 0, 59, 29, 31, 30,
+ 32, 33, 56, 5, 0, 48, 0, 0, 0, 63,
+ 0, 0, 21, 0, 0, 65, 0, 64, 0, 0,
+ 60, 58, 66, 0, 0, 0, 67, 0, 69, 68,
+ 0, 61, 70
};
- /* YYPGOTO[NTERM-NUM]. */
+/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -30, -30, 32, -30, -30, -13, -9, 1, 28, -1,
- -30, -30, 104, -30, -30, 66
+ -18, -18, -18, 33, 79, -18, 47, -6, -17, -18,
+ 2, 46, -1, -18, -18, 118, -18, -18, 78
};
- /* YYDEFGOTO[NTERM-NUM]. */
+/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 14, 32, 16, 27, 28, 17, 34, 91, 19,
- 20, 21, 58, 22, 23, 24
+ 0, 15, 16, 36, 18, 31, 32, 19, 20, 21,
+ 38, 97, 23, 24, 25, 63, 26, 27, 28
};
- /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule whose
- number is the opposite. If YYTABLE_NINF, syntax error. */
+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 29, 18, 5, 33, 88, 67, 54, 55, 89, -70,
- 56, 64, 37, 70, 65, 66, 33, 52, 90, -72,
- 1, 2, 3, 4, 35, 6, 7, 8, 8, 51,
- -71, -69, 15, 26, 9, 10, 69, 53, 38, 45,
- 119, 11, 30, 31, 53, 46, 47, 48, 49, 82,
- 50, 25, 102, 104, 13, 86, 87, 120, 57, 54,
- 55, 97, 100, 56, 29, 29, 105, 60, -72, 57,
- 106, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 83, 84, 35, 35, 85, 88, 8, 8, 93,
- 89, 59, 56, 62, 36, 96, 63, 101, 103, 71,
- 1, 2, 3, 4, 5, 6, 7, 8, 94, 95,
- 50, 113, 123, 124, 9, 10, 35, 114, 108, 35,
- 8, 11, 130, 8, 110, 0, 61, 99, 98, 134,
- 122, 12, 0, 0, 13, 0, 47, 48, 49, 115,
- 50, 116, 0, 121, 0, 0, 0, 0, 0, 126,
- 0, 127, 1, 2, 3, 4, 0, 6, 7, 8,
- 133, 0, 0, 0, 0, 0, 9, 10, 0, 0,
- 0, 0, 92, 11, 1, 2, 3, 4, 0, 6,
- 7, 8, 0, 25, 0, 0, 13, 0, 9, 10,
- 0, 0, 0, 0, 109, 11, 1, 2, 3, 4,
- 0, 6, 7, 8, 0, 25, 0, 0, 13, 0,
- 9, 10, 0, 0, 0, 0, 0, 11, 0, 39,
- 40, 41, 42, 43, 44, 0, 45, 25, 0, 0,
- 13, 111, 46, 47, 48, 49, 0, 50, 39, 40,
- 41, 42, 43, 44, 0, 45, 0, 0, 112, 0,
- 117, 46, 47, 48, 49, 0, 50, 39, 40, 41,
- 42, 43, 44, 0, 45, 0, 0, 118, 0, 128,
- 46, 47, 48, 49, 0, 50, 39, 40, 41, 42,
- 43, 44, 0, 45, 0, 0, 129, 0, 0, 46,
- 47, 48, 49, 0, 50, 39, 40, 41, 42, 43,
- 44, 0, 45, 0, 0, 125, 0, 0, 46, 47,
- 48, 49, 0, 50, 39, 40, 41, 42, 43, 44,
- 0, 45, 0, 0, 131, 0, 0, 46, 47, 48,
- 49, 0, 50, 39, 40, 41, 42, 43, 44, 0,
- 45, 0, 0, 132, 0, 0, 46, 47, 48, 49,
- 0, 50, 39, 40, 41, 42, 43, 44, 0, 45,
- 0, 0, 135, 0, 0, 46, 47, 48, 49, 0,
- 50, 0, 0, 68, 39, 40, 41, 42, 43, 44,
- 0, 45, 0, 0, 0, 0, 107, 46, 47, 48,
- 49, 0, 50, 39, 40, 41, 42, 43, 44, 0,
- 45, 0, 0, 0, 0, 0, 46, 47, 48, 49,
- 0, 50
+ 33, 56, 22, 1, 2, 3, 4, 37, 72, 7,
+ 8, 9, 94, 41, 5, 6, 39, 95, 10, 11,
+ 57, 9, -77, 37, 126, 12, 69, 96, 40, 70,
+ 71, 39, 39, 17, 30, 29, 9, 9, 14, -76,
+ -74, 127, 55, 102, 34, 35, 39, 39, -75, 59,
+ 60, 9, 9, 61, 87, 94, 75, 42, 105, 129,
+ 95, 92, 93, 58, 59, 60, 103, 106, 61, 33,
+ 33, 111, 65, 113, 62, 112, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 88, 89, 2, 3,
+ 49, 91, -77, 7, 8, 99, 50, 51, 52, 53,
+ 62, 54, 64, 107, 109, 67, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 74, 58, 108, 110, 130,
+ 131, 10, 11, 51, 52, 53, 68, 54, 12, 76,
+ 61, 117, 100, 101, 54, 90, 141, 6, 13, 120,
+ 121, 14, 115, 137, 66, 104, 0, 122, 0, 123,
+ 0, 128, 0, 0, 0, 0, 0, 133, 0, 134,
+ 0, 0, 0, 1, 2, 3, 4, 0, 140, 7,
+ 8, 9, 0, 0, 0, 0, 0, 0, 10, 11,
+ 0, 0, 0, 0, 98, 12, 1, 2, 3, 4,
+ 0, 0, 7, 8, 9, 29, 0, 0, 14, 0,
+ 0, 10, 11, 0, 0, 0, 0, 116, 12, 1,
+ 2, 3, 4, 0, 0, 7, 8, 9, 29, 0,
+ 0, 14, 0, 0, 10, 11, 0, 0, 0, 0,
+ 0, 12, 0, 43, 44, 45, 46, 47, 48, 0,
+ 49, 29, 0, 0, 14, 118, 50, 51, 52, 53,
+ 0, 54, 43, 44, 45, 46, 47, 48, 0, 49,
+ 0, 0, 119, 0, 124, 50, 51, 52, 53, 0,
+ 54, 43, 44, 45, 46, 47, 48, 0, 49, 0,
+ 0, 125, 0, 135, 50, 51, 52, 53, 0, 54,
+ 43, 44, 45, 46, 47, 48, 0, 49, 0, 0,
+ 136, 0, 0, 50, 51, 52, 53, 0, 54, 43,
+ 44, 45, 46, 47, 48, 0, 49, 0, 0, 132,
+ 0, 0, 50, 51, 52, 53, 0, 54, 43, 44,
+ 45, 46, 47, 48, 0, 49, 0, 0, 138, 0,
+ 0, 50, 51, 52, 53, 0, 54, 43, 44, 45,
+ 46, 47, 48, 0, 49, 0, 0, 139, 0, 0,
+ 50, 51, 52, 53, 0, 54, 43, 44, 45, 46,
+ 47, 48, 0, 49, 0, 0, 142, 0, 0, 50,
+ 51, 52, 53, 0, 54, 0, 0, 73, 43, 44,
+ 45, 46, 47, 48, 0, 49, 0, 0, 0, 0,
+ 114, 50, 51, 52, 53, 0, 54, 43, 44, 45,
+ 46, 47, 48, 0, 49, 0, 0, 0, 0, 0,
+ 50, 51, 52, 53, 0, 54
};
static const yytype_int16 yycheck[] =
{
- 1, 0, 7, 12, 4, 23, 25, 26, 8, 38,
- 29, 32, 13, 32, 35, 36, 25, 16, 18, 37,
- 3, 4, 5, 6, 6, 8, 9, 10, 10, 34,
- 37, 38, 0, 1, 17, 18, 32, 33, 0, 18,
- 23, 24, 10, 11, 33, 24, 25, 26, 27, 48,
- 29, 34, 65, 66, 37, 54, 55, 40, 39, 25,
- 26, 62, 63, 29, 65, 66, 67, 37, 37, 39,
- 71, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 6, 6, 53, 4, 10, 10, 57,
- 8, 37, 29, 38, 17, 17, 37, 65, 66, 37,
- 3, 4, 5, 6, 7, 8, 9, 10, 6, 6,
- 29, 37, 113, 114, 17, 18, 6, 37, 90, 6,
- 10, 24, 37, 10, 92, -1, 22, 17, 62, 130,
- 17, 34, -1, -1, 37, -1, 25, 26, 27, 107,
- 29, 109, -1, 111, -1, -1, -1, -1, -1, 117,
- -1, 119, 3, 4, 5, 6, -1, 8, 9, 10,
- 128, -1, -1, -1, -1, -1, 17, 18, -1, -1,
- -1, -1, 23, 24, 3, 4, 5, 6, -1, 8,
- 9, 10, -1, 34, -1, -1, 37, -1, 17, 18,
- -1, -1, -1, -1, 23, 24, 3, 4, 5, 6,
- -1, 8, 9, 10, -1, 34, -1, -1, 37, -1,
- 17, 18, -1, -1, -1, -1, -1, 24, -1, 11,
- 12, 13, 14, 15, 16, -1, 18, 34, -1, -1,
- 37, 23, 24, 25, 26, 27, -1, 29, 11, 12,
- 13, 14, 15, 16, -1, 18, -1, -1, 40, -1,
- 23, 24, 25, 26, 27, -1, 29, 11, 12, 13,
- 14, 15, 16, -1, 18, -1, -1, 40, -1, 23,
- 24, 25, 26, 27, -1, 29, 11, 12, 13, 14,
- 15, 16, -1, 18, -1, -1, 40, -1, -1, 24,
- 25, 26, 27, -1, 29, 11, 12, 13, 14, 15,
- 16, -1, 18, -1, -1, 40, -1, -1, 24, 25,
- 26, 27, -1, 29, 11, 12, 13, 14, 15, 16,
- -1, 18, -1, -1, 40, -1, -1, 24, 25, 26,
- 27, -1, 29, 11, 12, 13, 14, 15, 16, -1,
- 18, -1, -1, 40, -1, -1, 24, 25, 26, 27,
- -1, 29, 11, 12, 13, 14, 15, 16, -1, 18,
- -1, -1, 40, -1, -1, 24, 25, 26, 27, -1,
- 29, -1, -1, 32, 11, 12, 13, 14, 15, 16,
- -1, 18, -1, -1, -1, -1, 23, 24, 25, 26,
- 27, -1, 29, 11, 12, 13, 14, 15, 16, -1,
- 18, -1, -1, -1, -1, -1, 24, 25, 26, 27,
- -1, 29
+ 1, 18, 0, 3, 4, 5, 6, 13, 24, 9,
+ 10, 11, 4, 14, 7, 8, 6, 9, 18, 19,
+ 18, 11, 38, 29, 24, 25, 33, 19, 18, 36,
+ 37, 6, 6, 0, 1, 35, 11, 11, 38, 38,
+ 39, 41, 35, 18, 11, 12, 6, 6, 39, 26,
+ 27, 11, 11, 30, 52, 4, 33, 0, 18, 18,
+ 9, 59, 60, 34, 26, 27, 67, 68, 30, 70,
+ 71, 72, 38, 90, 40, 76, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 4, 5,
+ 19, 58, 38, 9, 10, 62, 25, 26, 27, 28,
+ 40, 30, 38, 70, 71, 39, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 33, 34, 70, 71, 120,
+ 121, 18, 19, 26, 27, 28, 38, 30, 25, 38,
+ 30, 98, 6, 6, 30, 56, 137, 8, 35, 38,
+ 38, 38, 96, 38, 26, 67, -1, 114, -1, 116,
+ -1, 118, -1, -1, -1, -1, -1, 124, -1, 126,
+ -1, -1, -1, 3, 4, 5, 6, -1, 135, 9,
+ 10, 11, -1, -1, -1, -1, -1, -1, 18, 19,
+ -1, -1, -1, -1, 24, 25, 3, 4, 5, 6,
+ -1, -1, 9, 10, 11, 35, -1, -1, 38, -1,
+ -1, 18, 19, -1, -1, -1, -1, 24, 25, 3,
+ 4, 5, 6, -1, -1, 9, 10, 11, 35, -1,
+ -1, 38, -1, -1, 18, 19, -1, -1, -1, -1,
+ -1, 25, -1, 12, 13, 14, 15, 16, 17, -1,
+ 19, 35, -1, -1, 38, 24, 25, 26, 27, 28,
+ -1, 30, 12, 13, 14, 15, 16, 17, -1, 19,
+ -1, -1, 41, -1, 24, 25, 26, 27, 28, -1,
+ 30, 12, 13, 14, 15, 16, 17, -1, 19, -1,
+ -1, 41, -1, 24, 25, 26, 27, 28, -1, 30,
+ 12, 13, 14, 15, 16, 17, -1, 19, -1, -1,
+ 41, -1, -1, 25, 26, 27, 28, -1, 30, 12,
+ 13, 14, 15, 16, 17, -1, 19, -1, -1, 41,
+ -1, -1, 25, 26, 27, 28, -1, 30, 12, 13,
+ 14, 15, 16, 17, -1, 19, -1, -1, 41, -1,
+ -1, 25, 26, 27, 28, -1, 30, 12, 13, 14,
+ 15, 16, 17, -1, 19, -1, -1, 41, -1, -1,
+ 25, 26, 27, 28, -1, 30, 12, 13, 14, 15,
+ 16, 17, -1, 19, -1, -1, 41, -1, -1, 25,
+ 26, 27, 28, -1, 30, -1, -1, 33, 12, 13,
+ 14, 15, 16, 17, -1, 19, -1, -1, -1, -1,
+ 24, 25, 26, 27, 28, -1, 30, 12, 13, 14,
+ 15, 16, 17, -1, 19, -1, -1, -1, -1, -1,
+ 25, 26, 27, 28, -1, 30
};
- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+ state STATE-NUM. */
+static const yytype_int8 yystos[] =
{
- 0, 3, 4, 5, 6, 7, 8, 9, 10, 17,
- 18, 24, 34, 37, 42, 43, 44, 47, 48, 50,
- 51, 52, 54, 55, 56, 34, 43, 45, 46, 50,
- 43, 43, 43, 47, 48, 6, 17, 50, 0, 11,
- 12, 13, 14, 15, 16, 18, 24, 25, 26, 27,
- 29, 34, 48, 33, 25, 26, 29, 39, 53, 37,
- 37, 53, 38, 37, 32, 35, 36, 23, 32, 32,
- 32, 37, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 48, 43, 43, 43, 48, 48, 4, 8,
- 18, 49, 23, 43, 6, 6, 17, 50, 56, 17,
- 50, 43, 46, 43, 46, 50, 50, 23, 49, 23,
- 43, 23, 40, 37, 37, 43, 43, 23, 40, 23,
- 40, 43, 17, 50, 50, 40, 43, 43, 23, 40,
- 37, 40, 40, 43, 50, 40
+ 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 18, 19, 25, 35, 38, 43, 44, 45, 46, 49,
+ 50, 51, 52, 54, 55, 56, 58, 59, 60, 35,
+ 45, 47, 48, 54, 45, 45, 45, 49, 52, 6,
+ 18, 54, 0, 12, 13, 14, 15, 16, 17, 19,
+ 25, 26, 27, 28, 30, 35, 50, 52, 34, 26,
+ 27, 30, 40, 57, 38, 38, 57, 39, 38, 33,
+ 36, 37, 24, 33, 33, 33, 38, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 52, 45, 45,
+ 46, 45, 52, 52, 4, 9, 19, 53, 24, 45,
+ 6, 6, 18, 54, 60, 18, 54, 45, 48, 45,
+ 48, 54, 54, 50, 24, 53, 24, 45, 24, 41,
+ 38, 38, 45, 45, 24, 41, 24, 41, 45, 18,
+ 54, 54, 41, 45, 45, 24, 41, 38, 41, 41,
+ 45, 54, 41
};
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr1[] =
{
- 0, 41, 42, 42, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 44, 44, 44, 44, 45, 45, 45, 45, 45,
- 45, 46, 47, 47, 47, 47, 47, 47, 47, 48,
- 48, 48, 48, 48, 48, 49, 49, 50, 50, 51,
- 51, 52, 52, 52, 52, 52, 52, 52, 53, 53,
- 53, 53, 53, 53, 53, 53, 54, 54, 54, 55,
- 55, 56, 56
+ 0, 42, 43, 43, 44, 44, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 46, 46, 46, 46, 47, 47, 47,
+ 47, 47, 47, 48, 49, 49, 49, 49, 49, 49,
+ 49, 50, 51, 52, 52, 52, 52, 52, 52, 52,
+ 53, 53, 54, 54, 55, 55, 56, 56, 56, 56,
+ 56, 56, 56, 57, 57, 57, 57, 57, 57, 57,
+ 57, 58, 58, 58, 59, 59, 60, 60
};
- /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
+static const yytype_int8 yyr2[] =
{
- 0, 2, 1, 1, 1, 2, 1, 1, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 1, 3, 5,
- 3, 1, 1, 1, 1, 1, 1, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
- 3, 3, 3, 4, 3, 1, 1, 1, 1, 1,
- 1, 4, 2, 5, 3, 5, 7, 3, 3, 4,
- 4, 5, 5, 6, 6, 7, 2, 2, 3, 1,
- 1, 1, 1
+ 0, 2, 1, 1, 2, 4, 1, 1, 1, 1,
+ 2, 2, 3, 3, 3, 3, 3, 3, 3, 1,
+ 3, 5, 3, 1, 1, 1, 1, 1, 1, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 1, 1, 1, 1, 3, 3, 3, 4, 3,
+ 1, 1, 1, 1, 1, 1, 4, 2, 5, 3,
+ 5, 7, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 2, 2, 3, 1, 1, 1, 1
};
+enum { YYENOMEM = -2 };
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
+#define YYNOMEM goto yyexhaustedlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
-
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
+/* Backward compatibility with an undocumented macro.
+ Use YYerror or YYUNDEF. */
+#define YYERRCODE YYUNDEF
/* Enable debugging if requested. */
@@ -741,55 +857,52 @@ do { \
YYFPRINTF Args; \
} while (0)
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value); \
+ Kind, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YY_USE (yyoutput);
if (!yyvaluep)
return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YY_USE (yykind);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo,
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyoutput, "%s %s (",
- yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+ YYFPRINTF (yyo, "%s %s (",
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
+ yy_symbol_value_print (yyo, yykind, yyvaluep);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -798,7 +911,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -821,21 +934,21 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
+ int yyrule)
{
- unsigned long int yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
+ &yyvsp[(yyi + 1) - (yynrhs)]);
YYFPRINTF (stderr, "\n");
}
}
@@ -850,8 +963,8 @@ do { \
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YYDPRINTF(Args) ((void) 0)
+# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
@@ -874,292 +987,74 @@ int yydebug;
#endif
-#if YYERROR_VERBOSE
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-yystrlen (const char *yystr)
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# endif
-# endif
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-{
- char *yyd = yydest;
- const char *yys = yysrc;
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- YYSIZE_T yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
-{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- {
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
- }
-
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
-
- {
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
-
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
-
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
-}
-#endif /* YYERROR_VERBOSE */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg,
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
- YYUSE (yyvaluep);
+ YY_USE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- switch (yytype)
+ switch (yykind)
{
- case 43: /* exp */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1118 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_exp: /* exp */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1014 "ExpressionParser.tab.c"
break;
- case 44: /* num */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1124 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_num: /* num */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1020 "ExpressionParser.tab.c"
break;
- case 45: /* args */
-#line 79 "ExpressionParser.y" /* yacc.c:1257 */
- { std::vector::const_iterator i = ((*yyvaluep).arguments).begin(); while (i != ((*yyvaluep).arguments).end()) { delete *i; ++i; } }
-#line 1130 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_args: /* args */
+#line 80 "ExpressionParser.y"
+ { std::vector::const_iterator i = ((*yyvaluep).arguments).begin(); while (i != ((*yyvaluep).arguments).end()) { delete *i; ++i; } }
+#line 1026 "ExpressionParser.tab.c"
break;
- case 46: /* range */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1136 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_range: /* range */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1032 "ExpressionParser.tab.c"
break;
- case 47: /* cond */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1142 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_cond: /* cond */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1038 "ExpressionParser.tab.c"
break;
- case 48: /* unit_exp */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1148 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_unit_exp: /* unit_exp */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1044 "ExpressionParser.tab.c"
break;
- case 53: /* indexer */
-#line 78 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).component); }
-#line 1154 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_indexer: /* indexer */
+#line 79 "ExpressionParser.y"
+ { delete ((*yyvaluep).component); }
+#line 1050 "ExpressionParser.tab.c"
break;
- case 54: /* indexable */
-#line 77 "ExpressionParser.y" /* yacc.c:1257 */
- { delete ((*yyvaluep).expr); }
-#line 1160 "ExpressionParser.tab.c" /* yacc.c:1257 */
+ case YYSYMBOL_indexable: /* indexable */
+#line 78 "ExpressionParser.y"
+ { delete ((*yyvaluep).expr); }
+#line 1056 "ExpressionParser.tab.c"
break;
-
default:
break;
}
@@ -1167,9 +1062,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
}
-
-
-/* The lookahead symbol. */
+/* Lookahead token kind. */
int yychar;
/* The semantic value of the lookahead symbol. */
@@ -1178,6 +1071,8 @@ YYSTYPE yylval;
int yynerrs;
+
+
/*----------.
| yyparse. |
`----------*/
@@ -1185,43 +1080,36 @@ int yynerrs;
int
yyparse (void)
{
- int yystate;
+ yy_state_fast_t yystate = 0;
/* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
+ int yyerrstatus = 0;
- /* The stacks and their tools:
- 'yyss': related to states.
- 'yyvs': related to semantic values.
-
- Refer to the stacks through separate pointers, to allow yyoverflow
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ /* Their size. */
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
- /* The semantic value stack. */
+ /* The state stack: array, bottom, top. */
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss = yyssa;
+ yy_state_t *yyssp = yyss;
+
+ /* The semantic value stack: array, bottom, top. */
YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
-
- YYSIZE_T yystacksize;
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp = yyvs;
int yyn;
+ /* The return value of yyparse. */
int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
+ /* Lookahead symbol kind. */
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
+
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
@@ -1229,71 +1117,75 @@ yyparse (void)
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yyssp = yyss = yyssa;
- yyvsp = yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
+
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
+ YY_STACK_PRINT (yyss, yyssp);
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ YYNOMEM;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
&yystacksize);
-
yyss = yyss1;
yyvs = yyvs1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ YYNOMEM;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
- goto yyexhaustedlab;
+ YYNOMEM;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
@@ -1301,30 +1193,31 @@ yyparse (void)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1335,18 +1228,29 @@ yybackup:
/* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+ YYDPRINTF ((stderr, "Reading a token\n"));
yychar = yylex ();
}
if (yychar <= YYEOF)
{
- yychar = yytoken = YYEOF;
+ yychar = YYEOF;
+ yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == YYerror)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = YYUNDEF;
+ yytoken = YYSYMBOL_YYerror;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1374,15 +1278,13 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -1397,7 +1299,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1417,464 +1319,495 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
-#line 85 "ExpressionParser.y" /* yacc.c:1646 */
- { ScanResult = (yyvsp[0].expr); valueExpression = true; }
-#line 1424 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 2: /* input: exp */
+#line 86 "ExpressionParser.y"
+ { ScanResult = (yyvsp[0].expr); valueExpression = true; }
+#line 1326 "ExpressionParser.tab.c"
break;
- case 3:
-#line 86 "ExpressionParser.y" /* yacc.c:1646 */
- { ScanResult = (yyvsp[0].expr); unitExpression = true; }
-#line 1430 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 3: /* input: unit_exp */
+#line 87 "ExpressionParser.y"
+ { ScanResult = (yyvsp[0].expr); unitExpression = true; }
+#line 1332 "ExpressionParser.tab.c"
break;
- case 4:
-#line 89 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[0].expr); }
-#line 1436 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 4: /* unit_num: num unit_exp */
+#line 90 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-1].expr), OperatorExpression::UNIT, (yyvsp[0].expr)); }
+#line 1338 "ExpressionParser.tab.c"
break;
- case 5:
-#line 90 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-1].expr), OperatorExpression::UNIT, (yyvsp[0].expr)); }
-#line 1442 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 5: /* unit_num: num us_building_unit num us_building_unit */
+#line 91 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, new OperatorExpression(DocumentObject, (yyvsp[-3].expr), OperatorExpression::UNIT, (yyvsp[-2].expr)), OperatorExpression::ADD, new OperatorExpression(DocumentObject, (yyvsp[-1].expr), OperatorExpression::UNIT, (yyvsp[0].expr)));}
+#line 1344 "ExpressionParser.tab.c"
break;
- case 6:
-#line 91 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new StringExpression(DocumentObject, (yyvsp[0].string)); }
-#line 1448 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 6: /* exp: num */
+#line 94 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[0].expr); }
+#line 1350 "ExpressionParser.tab.c"
break;
- case 7:
-#line 92 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new VariableExpression(DocumentObject, (yyvsp[0].path)); }
-#line 1454 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 7: /* exp: unit_num */
+#line 95 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[0].expr); }
+#line 1356 "ExpressionParser.tab.c"
break;
- case 8:
-#line 93 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[0].expr), OperatorExpression::NEG, new NumberExpression(DocumentObject, Quantity(-1))); }
-#line 1460 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 8: /* exp: STRING */
+#line 96 "ExpressionParser.y"
+ { (yyval.expr) = new StringExpression(DocumentObject, (yyvsp[0].string)); }
+#line 1362 "ExpressionParser.tab.c"
break;
- case 9:
-#line 94 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[0].expr), OperatorExpression::POS, new NumberExpression(DocumentObject, Quantity(1))); }
-#line 1466 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 9: /* exp: identifier */
+#line 97 "ExpressionParser.y"
+ { (yyval.expr) = new VariableExpression(DocumentObject, (yyvsp[0].path)); }
+#line 1368 "ExpressionParser.tab.c"
break;
- case 10:
-#line 95 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::ADD, (yyvsp[0].expr)); }
-#line 1472 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 10: /* exp: MINUSSIGN exp */
+#line 98 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[0].expr), OperatorExpression::NEG, new NumberExpression(DocumentObject, Quantity(-1))); }
+#line 1374 "ExpressionParser.tab.c"
break;
- case 11:
-#line 96 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::SUB, (yyvsp[0].expr)); }
-#line 1478 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 11: /* exp: '+' exp */
+#line 99 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[0].expr), OperatorExpression::POS, new NumberExpression(DocumentObject, Quantity(1))); }
+#line 1380 "ExpressionParser.tab.c"
break;
- case 12:
-#line 97 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MUL, (yyvsp[0].expr)); }
-#line 1484 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 12: /* exp: exp '+' exp */
+#line 100 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::ADD, (yyvsp[0].expr)); }
+#line 1386 "ExpressionParser.tab.c"
break;
- case 13:
-#line 98 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
-#line 1490 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 13: /* exp: exp MINUSSIGN exp */
+#line 101 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::SUB, (yyvsp[0].expr)); }
+#line 1392 "ExpressionParser.tab.c"
break;
- case 14:
-#line 99 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MOD, (yyvsp[0].expr)); }
-#line 1496 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 14: /* exp: exp '*' exp */
+#line 102 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MUL, (yyvsp[0].expr)); }
+#line 1398 "ExpressionParser.tab.c"
break;
- case 15:
-#line 100 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
-#line 1502 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 15: /* exp: exp '/' exp */
+#line 103 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
+#line 1404 "ExpressionParser.tab.c"
break;
- case 16:
-#line 101 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::POW, (yyvsp[0].expr)); }
-#line 1508 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 16: /* exp: exp '%' exp */
+#line 104 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MOD, (yyvsp[0].expr)); }
+#line 1410 "ExpressionParser.tab.c"
break;
- case 17:
-#line 102 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[0].expr); }
-#line 1514 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 17: /* exp: exp '/' unit_exp */
+#line 105 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
+#line 1416 "ExpressionParser.tab.c"
break;
- case 18:
-#line 103 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new FunctionExpression(DocumentObject, (yyvsp[-2].func).first, std::move((yyvsp[-2].func).second), (yyvsp[-1].arguments)); }
-#line 1520 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 18: /* exp: exp '^' exp */
+#line 106 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::POW, (yyvsp[0].expr)); }
+#line 1422 "ExpressionParser.tab.c"
break;
- case 19:
-#line 104 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new ConditionalExpression(DocumentObject, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); }
-#line 1526 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 19: /* exp: indexable */
+#line 107 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[0].expr); }
+#line 1428 "ExpressionParser.tab.c"
break;
- case 20:
-#line 105 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[-1].expr); }
-#line 1532 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 20: /* exp: FUNC args ')' */
+#line 108 "ExpressionParser.y"
+ { (yyval.expr) = new FunctionExpression(DocumentObject, (yyvsp[-2].func).first, std::move((yyvsp[-2].func).second), (yyvsp[-1].arguments));}
+#line 1434 "ExpressionParser.tab.c"
break;
- case 21:
-#line 108 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((yyvsp[0].fvalue))); }
-#line 1538 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 21: /* exp: cond '?' exp ':' exp */
+#line 109 "ExpressionParser.y"
+ { (yyval.expr) = new ConditionalExpression(DocumentObject, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); }
+#line 1440 "ExpressionParser.tab.c"
break;
- case 22:
-#line 109 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((yyvsp[0].fvalue))); }
-#line 1544 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 22: /* exp: '(' exp ')' */
+#line 110 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[-1].expr); }
+#line 1446 "ExpressionParser.tab.c"
break;
- case 23:
-#line 110 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue))); }
-#line 1550 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 23: /* num: ONE */
+#line 113 "ExpressionParser.y"
+ { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((yyvsp[0].fvalue))); }
+#line 1452 "ExpressionParser.tab.c"
break;
- case 24:
-#line 111 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new ConstantExpression(DocumentObject, (yyvsp[0].constant).name, Quantity((yyvsp[0].constant).fvalue)); }
-#line 1556 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 24: /* num: NUM */
+#line 114 "ExpressionParser.y"
+ { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((yyvsp[0].fvalue))); }
+#line 1458 "ExpressionParser.tab.c"
break;
- case 25:
-#line 113 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.arguments).push_back((yyvsp[0].expr)); }
-#line 1562 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 25: /* num: INTEGER */
+#line 115 "ExpressionParser.y"
+ { (yyval.expr) = new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue))); }
+#line 1464 "ExpressionParser.tab.c"
break;
- case 26:
-#line 114 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.arguments).push_back((yyvsp[0].expr)); }
-#line 1568 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 26: /* num: CONSTANT */
+#line 116 "ExpressionParser.y"
+ { (yyval.expr) = new ConstantExpression(DocumentObject, (yyvsp[0].constant).name, Quantity((yyvsp[0].constant).fvalue)); }
+#line 1470 "ExpressionParser.tab.c"
break;
- case 27:
-#line 115 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
-#line 1574 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 27: /* args: exp */
+#line 118 "ExpressionParser.y"
+ { (yyval.arguments).push_back((yyvsp[0].expr)); }
+#line 1476 "ExpressionParser.tab.c"
break;
- case 28:
-#line 116 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
-#line 1580 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 28: /* args: range */
+#line 119 "ExpressionParser.y"
+ { (yyval.arguments).push_back((yyvsp[0].expr)); }
+#line 1482 "ExpressionParser.tab.c"
break;
- case 29:
-#line 117 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
-#line 1586 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 29: /* args: args ',' exp */
+#line 120 "ExpressionParser.y"
+ { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
+#line 1488 "ExpressionParser.tab.c"
break;
- case 30:
-#line 118 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
-#line 1592 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 30: /* args: args ';' exp */
+#line 121 "ExpressionParser.y"
+ { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
+#line 1494 "ExpressionParser.tab.c"
break;
- case 31:
-#line 121 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new RangeExpression(DocumentObject, (yyvsp[-2].string), (yyvsp[0].string)); }
-#line 1598 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 31: /* args: args ',' range */
+#line 122 "ExpressionParser.y"
+ { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
+#line 1500 "ExpressionParser.tab.c"
break;
- case 32:
-#line 124 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::EQ, (yyvsp[0].expr)); }
-#line 1604 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 32: /* args: args ';' range */
+#line 123 "ExpressionParser.y"
+ { (yyvsp[-2].arguments).push_back((yyvsp[0].expr)); (yyval.arguments) = (yyvsp[-2].arguments); }
+#line 1506 "ExpressionParser.tab.c"
break;
- case 33:
-#line 125 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::NEQ, (yyvsp[0].expr)); }
-#line 1610 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 33: /* range: id_or_cell ':' id_or_cell */
+#line 126 "ExpressionParser.y"
+ { (yyval.expr) = new RangeExpression(DocumentObject, (yyvsp[-2].string), (yyvsp[0].string)); }
+#line 1512 "ExpressionParser.tab.c"
break;
- case 34:
-#line 126 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::LT, (yyvsp[0].expr)); }
-#line 1616 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 34: /* cond: exp EQ exp */
+#line 129 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::EQ, (yyvsp[0].expr)); }
+#line 1518 "ExpressionParser.tab.c"
break;
- case 35:
-#line 127 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::GT, (yyvsp[0].expr)); }
-#line 1622 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 35: /* cond: exp NEQ exp */
+#line 130 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::NEQ, (yyvsp[0].expr)); }
+#line 1524 "ExpressionParser.tab.c"
break;
- case 36:
-#line 128 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::GTE, (yyvsp[0].expr)); }
-#line 1628 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 36: /* cond: exp LT exp */
+#line 131 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::LT, (yyvsp[0].expr)); }
+#line 1530 "ExpressionParser.tab.c"
break;
- case 37:
-#line 129 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::LTE, (yyvsp[0].expr)); }
-#line 1634 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 37: /* cond: exp GT exp */
+#line 132 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::GT, (yyvsp[0].expr)); }
+#line 1536 "ExpressionParser.tab.c"
break;
- case 38:
-#line 130 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[-1].expr); }
-#line 1640 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 38: /* cond: exp GTE exp */
+#line 133 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::GTE, (yyvsp[0].expr)); }
+#line 1542 "ExpressionParser.tab.c"
break;
- case 39:
-#line 133 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new UnitExpression(DocumentObject, (yyvsp[0].quantity).scaler, (yyvsp[0].quantity).unitStr ); }
-#line 1646 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 39: /* cond: exp LTE exp */
+#line 134 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::LTE, (yyvsp[0].expr)); }
+#line 1548 "ExpressionParser.tab.c"
break;
- case 40:
-#line 134 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
-#line 1652 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 40: /* cond: '(' cond ')' */
+#line 135 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[-1].expr); }
+#line 1554 "ExpressionParser.tab.c"
break;
- case 41:
-#line 135 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MUL, (yyvsp[0].expr)); }
-#line 1658 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 41: /* us_building_unit: USUNIT */
+#line 138 "ExpressionParser.y"
+ { (yyval.expr) = new UnitExpression(DocumentObject, (yyvsp[0].quantity).scaler, (yyvsp[0].quantity).unitStr ); }
+#line 1560 "ExpressionParser.tab.c"
break;
- case 42:
-#line 136 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::POW, new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue)))); }
-#line 1664 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 42: /* other_unit: UNIT */
+#line 139 "ExpressionParser.y"
+ { (yyval.expr) = new UnitExpression(DocumentObject, (yyvsp[0].quantity).scaler, (yyvsp[0].quantity).unitStr ); }
+#line 1566 "ExpressionParser.tab.c"
break;
- case 43:
-#line 137 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-3].expr), OperatorExpression::POW, new OperatorExpression(DocumentObject, new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue))), OperatorExpression::NEG, new NumberExpression(DocumentObject, Quantity(-1)))); }
-#line 1670 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 43: /* unit_exp: other_unit */
+#line 141 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[0].expr); }
+#line 1572 "ExpressionParser.tab.c"
break;
- case 44:
-#line 138 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = (yyvsp[-1].expr); }
-#line 1676 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 44: /* unit_exp: us_building_unit */
+#line 142 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[0].expr); }
+#line 1578 "ExpressionParser.tab.c"
break;
- case 45:
-#line 141 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.ivalue) = (yyvsp[0].ivalue); }
-#line 1682 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 45: /* unit_exp: unit_exp '/' unit_exp */
+#line 143 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::DIV, (yyvsp[0].expr)); }
+#line 1584 "ExpressionParser.tab.c"
break;
- case 46:
-#line 142 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.ivalue) = (yyvsp[0].fvalue); }
-#line 1688 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 46: /* unit_exp: unit_exp '*' unit_exp */
+#line 144 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::MUL, (yyvsp[0].expr)); }
+#line 1590 "ExpressionParser.tab.c"
break;
- case 47:
-#line 146 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string) = std::move((yyvsp[0].string)); }
-#line 1694 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 47: /* unit_exp: unit_exp '^' integer */
+#line 145 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-2].expr), OperatorExpression::POW, new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue)))); }
+#line 1596 "ExpressionParser.tab.c"
break;
- case 48:
-#line 147 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string) = std::move((yyvsp[0].string)); }
-#line 1700 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 48: /* unit_exp: unit_exp '^' MINUSSIGN integer */
+#line 146 "ExpressionParser.y"
+ { (yyval.expr) = new OperatorExpression(DocumentObject, (yyvsp[-3].expr), OperatorExpression::POW, new OperatorExpression(DocumentObject, new NumberExpression(DocumentObject, Quantity((double)(yyvsp[0].ivalue))), OperatorExpression::NEG, new NumberExpression(DocumentObject, Quantity(-1)))); }
+#line 1602 "ExpressionParser.tab.c"
break;
- case 49:
-#line 151 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.path) = ObjectIdentifier(DocumentObject); (yyval.path) << ObjectIdentifier::SimpleComponent((yyvsp[0].string)); }
-#line 1706 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 49: /* unit_exp: '(' unit_exp ')' */
+#line 147 "ExpressionParser.y"
+ { (yyval.expr) = (yyvsp[-1].expr); }
+#line 1608 "ExpressionParser.tab.c"
break;
- case 50:
-#line 152 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.path) = std::move((yyvsp[0].path)); }
-#line 1712 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 50: /* integer: INTEGER */
+#line 150 "ExpressionParser.y"
+ { (yyval.ivalue) = (yyvsp[0].ivalue); }
+#line 1614 "ExpressionParser.tab.c"
break;
- case 51:
-#line 156 "ExpressionParser.y" /* yacc.c:1646 */
- { /* Path to property of a sub-object of the current object*/
- (yyval.path) = ObjectIdentifier(DocumentObject,true);
- (yyval.path).setDocumentObjectName(DocumentObject,false,ObjectIdentifier::String(std::move((yyvsp[-2].string)),true),true);
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ case 51: /* integer: ONE */
+#line 151 "ExpressionParser.y"
+ { (yyval.ivalue) = (yyvsp[0].fvalue); }
+#line 1620 "ExpressionParser.tab.c"
+ break;
+
+ case 52: /* id_or_cell: IDENTIFIER */
+#line 155 "ExpressionParser.y"
+ { (yyval.string) = std::move((yyvsp[0].string)); }
+#line 1626 "ExpressionParser.tab.c"
+ break;
+
+ case 53: /* id_or_cell: CELLADDRESS */
+#line 156 "ExpressionParser.y"
+ { (yyval.string) = std::move((yyvsp[0].string)); }
+#line 1632 "ExpressionParser.tab.c"
+ break;
+
+ case 54: /* identifier: id_or_cell */
+#line 160 "ExpressionParser.y"
+ { (yyval.path) = ObjectIdentifier(DocumentObject); (yyval.path) << ObjectIdentifier::SimpleComponent((yyvsp[0].string)); }
+#line 1638 "ExpressionParser.tab.c"
+ break;
+
+ case 55: /* identifier: iden */
+#line 161 "ExpressionParser.y"
+ { (yyval.path) = std::move((yyvsp[0].path)); }
+#line 1644 "ExpressionParser.tab.c"
+ break;
+
+ case 56: /* iden: '.' STRING '.' id_or_cell */
+#line 165 "ExpressionParser.y"
+ { /* Path to property of a sub-object of the current object*/
+ (yyval.path) = ObjectIdentifier(DocumentObject,true);
+ (yyval.path).setDocumentObjectName(DocumentObject,false,ObjectIdentifier::String(std::move((yyvsp[-2].string)),true),true);
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
}
-#line 1722 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1654 "ExpressionParser.tab.c"
break;
- case 52:
-#line 161 "ExpressionParser.y" /* yacc.c:1646 */
- { /* Path to property of the current document object */
- (yyval.path) = ObjectIdentifier(DocumentObject,true);
- (yyval.path).setDocumentObjectName(DocumentObject);
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ case 57: /* iden: '.' id_or_cell */
+#line 170 "ExpressionParser.y"
+ { /* Path to property of the current document object */
+ (yyval.path) = ObjectIdentifier(DocumentObject,true);
+ (yyval.path).setDocumentObjectName(DocumentObject);
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
}
-#line 1732 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1664 "ExpressionParser.tab.c"
break;
- case 53:
-#line 166 "ExpressionParser.y" /* yacc.c:1646 */
- { /* Path to property of a sub-object */
- (yyval.path) = ObjectIdentifier(DocumentObject);
- (yyval.path).setDocumentObjectName(std::move((yyvsp[-4].string_or_identifier)), true, ObjectIdentifier::String(std::move((yyvsp[-2].string)),true),true);
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
- (yyval.path).resolveAmbiguity();
+ case 58: /* iden: object '.' STRING '.' id_or_cell */
+#line 175 "ExpressionParser.y"
+ { /* Path to property of a sub-object */
+ (yyval.path) = ObjectIdentifier(DocumentObject);
+ (yyval.path).setDocumentObjectName(std::move((yyvsp[-4].string_or_identifier)), true, ObjectIdentifier::String(std::move((yyvsp[-2].string)),true),true);
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ (yyval.path).resolveAmbiguity();
}
-#line 1743 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1675 "ExpressionParser.tab.c"
break;
- case 54:
-#line 172 "ExpressionParser.y" /* yacc.c:1646 */
- { /* Path to property of a given document object */
- (yyval.path) = ObjectIdentifier(DocumentObject);
- (yyvsp[-2].string_or_identifier).checkImport(DocumentObject);
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[-2].string_or_identifier)));
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
- (yyval.path).resolveAmbiguity();
+ case 59: /* iden: object '.' id_or_cell */
+#line 181 "ExpressionParser.y"
+ { /* Path to property of a given document object */
+ (yyval.path) = ObjectIdentifier(DocumentObject);
+ (yyvsp[-2].string_or_identifier).checkImport(DocumentObject);
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[-2].string_or_identifier)));
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ (yyval.path).resolveAmbiguity();
}
-#line 1755 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1687 "ExpressionParser.tab.c"
break;
- case 55:
-#line 179 "ExpressionParser.y" /* yacc.c:1646 */
- { /* Path to property from an external document, within a named document object */
- (yyval.path) = ObjectIdentifier(DocumentObject);
- (yyval.path).setDocumentName(std::move((yyvsp[-4].string_or_identifier)), true);
- (yyval.path).setDocumentObjectName(std::move((yyvsp[-2].string_or_identifier)), true);
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
- (yyval.path).resolveAmbiguity();
+ case 60: /* iden: document '#' object '.' id_or_cell */
+#line 188 "ExpressionParser.y"
+ { /* Path to property from an external document, within a named document object */
+ (yyval.path) = ObjectIdentifier(DocumentObject);
+ (yyval.path).setDocumentName(std::move((yyvsp[-4].string_or_identifier)), true);
+ (yyval.path).setDocumentObjectName(std::move((yyvsp[-2].string_or_identifier)), true);
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ (yyval.path).resolveAmbiguity();
}
-#line 1767 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1699 "ExpressionParser.tab.c"
break;
- case 56:
-#line 187 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.path) = ObjectIdentifier(DocumentObject);
- (yyval.path).setDocumentName(std::move((yyvsp[-6].string_or_identifier)), true);
- (yyval.path).setDocumentObjectName(std::move((yyvsp[-4].string_or_identifier)), true, ObjectIdentifier::String(std::move((yyvsp[-2].string)),true));
- (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
- (yyval.path).resolveAmbiguity();
+ case 61: /* iden: document '#' object '.' STRING '.' id_or_cell */
+#line 196 "ExpressionParser.y"
+ { (yyval.path) = ObjectIdentifier(DocumentObject);
+ (yyval.path).setDocumentName(std::move((yyvsp[-6].string_or_identifier)), true);
+ (yyval.path).setDocumentObjectName(std::move((yyvsp[-4].string_or_identifier)), true, ObjectIdentifier::String(std::move((yyvsp[-2].string)),true));
+ (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string)));
+ (yyval.path).resolveAmbiguity();
}
-#line 1778 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1710 "ExpressionParser.tab.c"
break;
- case 57:
-#line 193 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.path)= std::move((yyvsp[-2].path)); (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string))); }
-#line 1784 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 62: /* iden: iden '.' IDENTIFIER */
+#line 202 "ExpressionParser.y"
+ { (yyval.path)= std::move((yyvsp[-2].path)); (yyval.path).addComponent(ObjectIdentifier::SimpleComponent((yyvsp[0].string))); }
+#line 1716 "ExpressionParser.tab.c"
break;
- case 58:
-#line 197 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent((yyvsp[-1].expr)); }
-#line 1790 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 63: /* indexer: '[' exp ']' */
+#line 206 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent((yyvsp[-1].expr)); }
+#line 1722 "ExpressionParser.tab.c"
break;
- case 59:
-#line 198 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent((yyvsp[-2].expr),0,0,true); }
-#line 1796 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 64: /* indexer: '[' exp ':' ']' */
+#line 207 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent((yyvsp[-2].expr),0,0,true); }
+#line 1728 "ExpressionParser.tab.c"
break;
- case 60:
-#line 199 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent(0,(yyvsp[-1].expr)); }
-#line 1802 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 65: /* indexer: '[' ':' exp ']' */
+#line 208 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent(0,(yyvsp[-1].expr)); }
+#line 1734 "ExpressionParser.tab.c"
break;
- case 61:
-#line 200 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent(0,0,(yyvsp[-1].expr)); }
-#line 1808 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 66: /* indexer: '[' ':' ':' exp ']' */
+#line 209 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent(0,0,(yyvsp[-1].expr)); }
+#line 1740 "ExpressionParser.tab.c"
break;
- case 62:
-#line 201 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent((yyvsp[-3].expr),(yyvsp[-1].expr));}
-#line 1814 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 67: /* indexer: '[' exp ':' exp ']' */
+#line 210 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent((yyvsp[-3].expr),(yyvsp[-1].expr));}
+#line 1746 "ExpressionParser.tab.c"
break;
- case 63:
-#line 202 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent((yyvsp[-4].expr),0,(yyvsp[-1].expr)); }
-#line 1820 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 68: /* indexer: '[' exp ':' ':' exp ']' */
+#line 211 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent((yyvsp[-4].expr),0,(yyvsp[-1].expr)); }
+#line 1752 "ExpressionParser.tab.c"
break;
- case 64:
-#line 203 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent(0,(yyvsp[-3].expr),(yyvsp[-1].expr)); }
-#line 1826 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 69: /* indexer: '[' ':' exp ':' exp ']' */
+#line 212 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent(0,(yyvsp[-3].expr),(yyvsp[-1].expr)); }
+#line 1758 "ExpressionParser.tab.c"
break;
- case 65:
-#line 204 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.component) = Expression::createComponent((yyvsp[-5].expr),(yyvsp[-3].expr),(yyvsp[-1].expr));}
-#line 1832 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 70: /* indexer: '[' exp ':' exp ':' exp ']' */
+#line 213 "ExpressionParser.y"
+ { (yyval.component) = Expression::createComponent((yyvsp[-5].expr),(yyvsp[-3].expr),(yyvsp[-1].expr));}
+#line 1764 "ExpressionParser.tab.c"
break;
- case 66:
-#line 208 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.expr) = new VariableExpression(DocumentObject,(yyvsp[-1].path)); (yyval.expr)->addComponent((yyvsp[0].component)); }
-#line 1838 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 71: /* indexable: identifier indexer */
+#line 217 "ExpressionParser.y"
+ { (yyval.expr) = new VariableExpression(DocumentObject,(yyvsp[-1].path)); (yyval.expr)->addComponent((yyvsp[0].component)); }
+#line 1770 "ExpressionParser.tab.c"
break;
- case 67:
-#line 209 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-1].expr)->addComponent(std::move((yyvsp[0].component))); (yyval.expr) = (yyvsp[-1].expr); }
-#line 1844 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 72: /* indexable: indexable indexer */
+#line 218 "ExpressionParser.y"
+ { (yyvsp[-1].expr)->addComponent(std::move((yyvsp[0].component))); (yyval.expr) = (yyvsp[-1].expr); }
+#line 1776 "ExpressionParser.tab.c"
break;
- case 68:
-#line 210 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyvsp[-2].expr)->addComponent(Expression::createComponent((yyvsp[0].string))); (yyval.expr) = (yyvsp[-2].expr); }
-#line 1850 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 73: /* indexable: indexable '.' IDENTIFIER */
+#line 219 "ExpressionParser.y"
+ { (yyvsp[-2].expr)->addComponent(Expression::createComponent((yyvsp[0].string))); (yyval.expr) = (yyvsp[-2].expr); }
+#line 1782 "ExpressionParser.tab.c"
break;
- case 69:
-#line 214 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), true); }
-#line 1856 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 74: /* document: STRING */
+#line 223 "ExpressionParser.y"
+ { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), true); }
+#line 1788 "ExpressionParser.tab.c"
break;
- case 70:
-#line 215 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), false, true);}
-#line 1862 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 75: /* document: IDENTIFIER */
+#line 224 "ExpressionParser.y"
+ { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), false, true);}
+#line 1794 "ExpressionParser.tab.c"
break;
- case 71:
-#line 219 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), true); }
-#line 1868 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 76: /* object: STRING */
+#line 228 "ExpressionParser.y"
+ { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), true); }
+#line 1800 "ExpressionParser.tab.c"
break;
- case 72:
-#line 220 "ExpressionParser.y" /* yacc.c:1646 */
- { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), false);}
-#line 1874 "ExpressionParser.tab.c" /* yacc.c:1646 */
+ case 77: /* object: id_or_cell */
+#line 229 "ExpressionParser.y"
+ { (yyval.string_or_identifier) = ObjectIdentifier::String(std::move((yyvsp[0].string)), false);}
+#line 1806 "ExpressionParser.tab.c"
break;
-#line 1878 "ExpressionParser.tab.c" /* yacc.c:1646 */
+#line 1810 "ExpressionParser.tab.c"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1888,25 +1821,23 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -1917,50 +1848,14 @@ yyreduce:
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
-#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
- {
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
- }
-# undef YYSYNTAX_ERROR
-#endif
}
-
-
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
@@ -1989,12 +1884,11 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
+ ++yynerrs;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -2011,13 +1905,14 @@ yyerrorlab:
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
+ /* Pop stack until we find a state that shifts the error token. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
{
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ yyn += YYSYMBOL_YYerror;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
{
yyn = yytable[yyn];
if (0 < yyn)
@@ -2031,7 +1926,7 @@ yyerrlab1:
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ YY_ACCESSING_SYMBOL (yystate), yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -2043,7 +1938,7 @@ yyerrlab1:
/* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -2054,26 +1949,30 @@ yyerrlab1:
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
- goto yyreturn;
+ goto yyreturnlab;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
- goto yyreturn;
+ goto yyreturnlab;
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
+
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
+`-----------------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
- /* Fall through. */
-#endif
+ goto yyreturnlab;
-yyreturn:
+
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return. |
+`----------------------------------------------------------*/
+yyreturnlab:
if (yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
@@ -2089,18 +1988,16 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
-#endif
+
return yyresult;
}
-#line 223 "ExpressionParser.y" /* yacc.c:1906 */
+#line 232 "ExpressionParser.y"
+
diff --git a/src/App/ExpressionParser.tab.h b/src/App/ExpressionParser.tab.h
index 906d447a65..effb065853 100644
--- a/src/App/ExpressionParser.tab.h
+++ b/src/App/ExpressionParser.tab.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
+ Inc.
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
@@ -15,7 +16,7 @@
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, see . */
+ along with this program. If not, see . */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -30,6 +31,10 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+ especially those whose name start with YY_ or yy_. They are
+ private implementation details that can be changed or removed. */
+
#ifndef YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED
# define YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED
/* Debug traces. */
@@ -40,35 +45,41 @@
extern int yydebug;
#endif
-/* Token type. */
+/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
- FUNC = 258,
- ONE = 259,
- NUM = 260,
- IDENTIFIER = 261,
- UNIT = 262,
- INTEGER = 263,
- CONSTANT = 264,
- CELLADDRESS = 265,
- EQ = 266,
- NEQ = 267,
- LT = 268,
- GT = 269,
- GTE = 270,
- LTE = 271,
- STRING = 272,
- MINUSSIGN = 273,
- PROPERTY_REF = 274,
- DOCUMENT = 275,
- OBJECT = 276,
- EXPONENT = 277,
- NUM_AND_UNIT = 278,
- NEG = 279,
- POS = 280
+ YYEMPTY = -2,
+ YYEOF = 0, /* "end of file" */
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
+ FUNC = 258, /* FUNC */
+ ONE = 259, /* ONE */
+ NUM = 260, /* NUM */
+ IDENTIFIER = 261, /* IDENTIFIER */
+ UNIT = 262, /* UNIT */
+ USUNIT = 263, /* USUNIT */
+ INTEGER = 264, /* INTEGER */
+ CONSTANT = 265, /* CONSTANT */
+ CELLADDRESS = 266, /* CELLADDRESS */
+ EQ = 267, /* EQ */
+ NEQ = 268, /* NEQ */
+ LT = 269, /* LT */
+ GT = 270, /* GT */
+ GTE = 271, /* GTE */
+ LTE = 272, /* LTE */
+ STRING = 273, /* STRING */
+ MINUSSIGN = 274, /* MINUSSIGN */
+ PROPERTY_REF = 275, /* PROPERTY_REF */
+ DOCUMENT = 276, /* DOCUMENT */
+ OBJECT = 277, /* OBJECT */
+ EXPONENT = 278, /* EXPONENT */
+ NUM_AND_UNIT = 279, /* NUM_AND_UNIT */
+ NEG = 280, /* NEG */
+ POS = 281 /* POS */
};
+ typedef enum yytokentype yytoken_kind_t;
#endif
/* Value type. */
@@ -76,6 +87,8 @@ extern int yydebug;
extern YYSTYPE yylval;
+
int yyparse (void);
+
#endif /* !YY_YY_EXPRESSIONPARSER_TAB_H_INCLUDED */
diff --git a/src/App/ExpressionParser.y b/src/App/ExpressionParser.y
index 0a3a1f25e9..976d3eaa20 100644
--- a/src/App/ExpressionParser.y
+++ b/src/App/ExpressionParser.y
@@ -40,7 +40,7 @@ std::stack functions; /**< Function
%token ONE
%token NUM
%token IDENTIFIER
- %token UNIT
+ %token UNIT USUNIT
%token INTEGER
%token CONSTANT
%token CELLADDRESS
@@ -49,8 +49,8 @@ std::stack functions; /**< Function
%token DOCUMENT OBJECT
%token EXPONENT
%type args
- %type input exp unit_exp cond indexable
- %type UNIT
+ %type input unit_num us_building_unit other_unit exp unit_exp cond indexable
+ %type UNIT USUNIT
%type id_or_cell STRING IDENTIFIER CELLADDRESS
%type INTEGER
%type PROPERTY_REF
@@ -79,28 +79,32 @@ std::stack functions; /**< Function
%destructor { std::vector::const_iterator i = $$.begin(); while (i != $$.end()) { delete *i; ++i; } } args
%start input
-
%%
-input: exp { ScanResult = $1; valueExpression = true; }
- | unit_exp { ScanResult = $1; unitExpression = true; }
+
+input: exp { ScanResult = $1; valueExpression = true; }
+ | unit_exp { ScanResult = $1; unitExpression = true; }
;
-exp: num { $$ = $1; }
- | num unit_exp %prec NUM_AND_UNIT { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::UNIT, $2); }
+unit_num: num unit_exp %prec NUM_AND_UNIT { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::UNIT, $2); }
+ | num us_building_unit num us_building_unit %prec NUM_AND_UNIT { $$ = new OperatorExpression(DocumentObject, new OperatorExpression(DocumentObject, $1, OperatorExpression::UNIT, $2), OperatorExpression::ADD, new OperatorExpression(DocumentObject, $3, OperatorExpression::UNIT, $4));}
+ ;
+
+exp: num { $$ = $1; }
+ | unit_num { $$ = $1; }
| STRING { $$ = new StringExpression(DocumentObject, $1); }
| identifier { $$ = new VariableExpression(DocumentObject, $1); }
| MINUSSIGN exp %prec NEG { $$ = new OperatorExpression(DocumentObject, $2, OperatorExpression::NEG, new NumberExpression(DocumentObject, Quantity(-1))); }
| '+' exp %prec POS { $$ = new OperatorExpression(DocumentObject, $2, OperatorExpression::POS, new NumberExpression(DocumentObject, Quantity(1))); }
- | exp '+' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::ADD, $3); }
+ | exp '+' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::ADD, $3); }
| exp MINUSSIGN exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::SUB, $3); }
- | exp '*' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::MUL, $3); }
- | exp '/' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::DIV, $3); }
- | exp '%' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::MOD, $3); }
+ | exp '*' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::MUL, $3); }
+ | exp '/' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::DIV, $3); }
+ | exp '%' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::MOD, $3); }
| exp '/' unit_exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::DIV, $3); }
| exp '^' exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::POW, $3); }
- | indexable { $$ = $1; }
- | FUNC args ')' { $$ = new FunctionExpression(DocumentObject, $1.first, std::move($1.second), $2); }
+ | indexable { $$ = $1; }
+ | FUNC args ')' { $$ = new FunctionExpression(DocumentObject, $1.first, std::move($1.second), $2);}
| cond '?' exp ':' exp { $$ = new ConditionalExpression(DocumentObject, $1, $3, $5); }
| '(' exp ')' { $$ = $2; }
;
@@ -130,7 +134,11 @@ cond: exp EQ exp { $$ = new OperatorExpression(Do
| '(' cond ')' { $$ = $2; }
;
-unit_exp: UNIT { $$ = new UnitExpression(DocumentObject, $1.scaler, $1.unitStr ); }
+us_building_unit: USUNIT { $$ = new UnitExpression(DocumentObject, $1.scaler, $1.unitStr ); }
+other_unit: UNIT { $$ = new UnitExpression(DocumentObject, $1.scaler, $1.unitStr ); }
+
+unit_exp: other_unit { $$ = $1; }
+ | us_building_unit { $$ = $1; }
| unit_exp '/' unit_exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::DIV, $3); }
| unit_exp '*' unit_exp { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::MUL, $3); }
| unit_exp '^' integer { $$ = new OperatorExpression(DocumentObject, $1, OperatorExpression::POW, new NumberExpression(DocumentObject, Quantity((double)$3))); }
diff --git a/src/App/lex.ExpressionParser.c b/src/App/lex.ExpressionParser.c
index e56ab51d23..02d975762d 100644
--- a/src/App/lex.ExpressionParser.c
+++ b/src/App/lex.ExpressionParser.c
@@ -9131,7 +9131,7 @@ COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quan
case 49:
YY_RULE_SETUP
#line 234 "ExpressionParser.l"
-COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quantity.unitStr = yytext; return UNIT; // inch
+COUNTCHARS; yylval.quantity.scaler = Quantity::Inch; yylval.quantity.unitStr = yytext; return USUNIT; // inch
YY_BREAK
case 50:
YY_RULE_SETUP
@@ -9141,7 +9141,7 @@ COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quan
case 51:
YY_RULE_SETUP
#line 236 "ExpressionParser.l"
-COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quantity.unitStr = yytext; return UNIT; // foot
+COUNTCHARS; yylval.quantity.scaler = Quantity::Foot; yylval.quantity.unitStr = yytext; return USUNIT; // foot
YY_BREAK
case 52:
YY_RULE_SETUP