summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Makefile.am45
-rw-r--r--builtin.c2
-rw-r--r--configure.ac11
-rw-r--r--execute.c2
-rw-r--r--jq_parser.h (renamed from parser.h)4
-rw-r--r--lexer.l2
-rw-r--r--parser.gen.info3565
-rw-r--r--parser.y2
-rwxr-xr-xsetup.sh14
10 files changed, 55 insertions, 3597 deletions
diff --git a/.gitignore b/.gitignore
index e43b388c..56c1a5ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,10 @@
*.o
*~
-# Autogenerated
-*.gen.*
-
# Test binaries
jv_test
jv_parse
parsertest*~
# Something delightfully recursive happens otherwise
-docs/content/2.download/source/* \ No newline at end of file
+docs/content/2.download/source/*
diff --git a/Makefile.am b/Makefile.am
index 62d035d8..18acb864 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,26 +3,30 @@
# setup is only used by distribution developers, not package developers.
# Still, as a matter of allowing patching, its not a bad idea to distribute
# the developer setup script in the tarball.
-EXTRA_DIST = setup.sh config.h.in ChangeLog
+EXTRA_DIST = setup.sh config.h.in ChangeLog VERSION lexer.l lexer.h gen_utf8_tables.py
# README.md is expected in Github projects, good stuff in it, so we'll
# distribute it and install it with the package in the doc directory.
docdir = ${datadir}/doc/${PACKAGE}
dist_doc_DATA = README.md INSTALL COPYING AUTHORS README NEWS
-JQ_SRC = opcode.c bytecode.c compile.c execute.c builtin.c jv.c jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c
-# If we distribute the generated files in the source release, packagers won't have to have
-# python, bison, and flex
-DIST_JQ_SRC = parser.gen.c lexer.gen.c jv_utf8_tables.gen.h parser.gen.h lexer.gen.h
+JQ_INCS = jq_parser.h builtin.h bytecode.h compile.h execute.h forkable_stack.h frame_layout.h jv.h jv_dtoa.h jv_parse.h jv_unicode.h locfile.h opcode.h opcode_list.h parser.y jv_utf8_tables.gen.h
+
+JQ_SRC = opcode.c bytecode.c compile.c execute.c builtin.c jv.c jv_parse.c jv_print.c jv_dtoa.c jv_unicode.c lexer.c $(JQ_INCS)
-bin_PROGRAMS = jq jq_test
if DEVCFLAGS_ENABLED
-DEVCFLAGS = -Wextra -Wall -Wno-missing-field-initializers -Wno-unused -parameter -std=gnu99 -ggdb -Wno-unused-function
+DEVCFLAGS = -Wextra -Wall -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu99 -ggdb -Wno-unused-function
AM_CPPFLAGS = $(DEVCFLAGS)
endif
+# Tell YACC (bison) autoconf macros that you want a header file created.
+# If the --warnings=all fails, you probably have an old version of bison
+# OSX ships an old bison, so update with homebrew or macports
+AM_YFLAGS = --warnings=all -d
+
+bin_PROGRAMS = jq jq_test
+BUILT_SOURCES = jv_utf8_tables.gen.h lexer.h lexer.c
jq_SOURCES = $(JQ_SRC) main.c
-dist_jq_SOURCES = $(DIST_JQ_SRC)
jq_CPPFLAGS = -O $(DEVCFLAGS) -DJQ_DEBUG=0
@@ -33,18 +37,22 @@ jq_test_CPPFLAGS = $(DEVCFLAGS) -DJQ_DEBUG=1
LOG_COMPILER = valgrind
AM_LOG_FLAGS = --error-exitcode=1 -q --leak-check=full
-lexer.gen.c: lexer.l
- flex -o lexer.gen.c --header-file=lexer.gen.h lexer.l
-lexer.gen.h: lexer.gen.c
+# nasty circular dependency on header files between the generated C files
+parser.o: lexer.c
+
+lexer.o: parcer.c
-# if this fails on OSX, install bison from macports or homebrew. OSX comes
-# with bison 2.3 which is too old
-parser.gen.c: parser.y lexer.gen.h
- bison --warnings=all -d parser.y -v --report-file=parser.gen.info -o $@
-parser.gen.h: parser.gen.c
+lexer.c: parser.h
+
+# While there is some autoconf macro support for lex/flex, it doesn't support
+# header file creation so we'll use good old make
+lexer.c: lexer.l
+ flex -o lexer.c --header-file=lexer.h lexer.l
+lexer.h: lexer.c
jv_utf8_tables.gen.h: gen_utf8_tables.py
python $^ > $@
+
jv_unicode.c: jv_utf8_tables.gen.h
ChangeLog:
@@ -52,8 +60,6 @@ ChangeLog:
main.c: config.h
-releasedep: lexer.gen.c parser.gen.c jv_utf8_tables.gen.h
-
releasetag:
git tag -s "jq-$$(cat VERSION)" -m "jq release $$(cat VERSION)"
@@ -67,3 +73,6 @@ rpmbuild: jq
cp jq jq-$$(cat VERSION)/bin
tar -zcf rpm/SOURCES/jq-$$(cat VERSION).tgz jq-$$(cat VERSION)/bin/jq
rpmbuild --target $$(uname -m) --buildroot ${PWD}/rpm/BUILDROOT/jq-$$(cat VERSION)-${RELEASE}.noarch --define "_topdir ${PWD}/rpm" --define "version $$(cat VERSION)" --define "release ${RELEASE}" -bb --clean rpm/SPECS/jq.spec
+
+dist-clean-local:
+ rm -f $(BUILT_SOURCES)
diff --git a/builtin.c b/builtin.c
index fb6f072c..bbda554d 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1,7 +1,7 @@
#include <string.h>
#include "builtin.h"
#include "compile.h"
-#include "parser.h"
+#include "jq_parser.h"
#include "locfile.h"
enum {
diff --git a/configure.ac b/configure.ac
index 09997385..52037ca8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,9 +8,13 @@ AM_INIT_AUTOMAKE([parallel-tests])
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_CPP_WERROR
+AC_PROG_YACC
AM_PROG_CC_C_O
+dnl couldn't use AM_PROG_LEX as it doesn't support header files like the
+dnl AC_PROG_YACC macros...
+
dnl CFLAGS is concidered a packagers variable, not a developer variable
dnl in Auto-tools. For developer ease of use, CFLAGS are set how the
dnl developers like them by default but the packager can disable if so
@@ -28,6 +32,10 @@ if test "$enable_devcflags" = "yes"; then
AM_CONDITIONAL(DEVCFLAGS_ENABLED, true)
fi
+dnl
+dnl these program checks should probably be deleted
+dnl
+
dnl Check for sed
AC_CHECK_PROGS(regex_cmd, sed)
if test x$regex_cmd = "x" ; then
@@ -46,8 +54,6 @@ if test x$bison_cmd = "x" ; then
AC_MSG_NOTICE([bison is required to patch jq.])
fi
- AC_CONFIG_HEADERS(config.h)
-
dnl Check for python
AC_CHECK_PROGS(python_cmd, python)
if test x$python_cmd = "x" ; then
@@ -61,6 +67,7 @@ if test x$valgrind_cmd = "x" ; then
fi
dnl AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([-Wall dist-bzip2 dist-zip])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/execute.c b/execute.c
index 93aefc0e..a596e28b 100644
--- a/execute.c
+++ b/execute.c
@@ -14,7 +14,7 @@
#include "locfile.h"
#include "jv.h"
-#include "parser.h"
+#include "jq_parser.h"
#include "builtin.h"
typedef struct {
diff --git a/parser.h b/jq_parser.h
index 25eff019..8dc37163 100644
--- a/parser.h
+++ b/jq_parser.h
@@ -1,5 +1,5 @@
-#ifndef PARSER_H
-#define PARSER_H
+#ifndef JQ_PARSER_H
+#define JQ_PARSER_H
int jq_parse(struct locfile* source, block* answer);
int jq_parse_library(struct locfile* locations, block* answer);
diff --git a/lexer.l b/lexer.l
index 368d4989..ec01d25e 100644
--- a/lexer.l
+++ b/lexer.l
@@ -3,7 +3,7 @@
struct lexer_param;
-#include "parser.gen.h" /* Generated by bison. */
+#include "parser.h" /* Generated by bison. */
#define YY_USER_ACTION \
do { \
diff --git a/parser.gen.info b/parser.gen.info
deleted file mode 100644
index 8f1f5656..00000000
--- a/parser.gen.info
+++ /dev/null
@@ -1,3565 +0,0 @@
-Terminals unused in grammar
-
- INVALID_CHARACTER
-
-
-Grammar
-
- 0 $accept: TopLevel $end
-
- 1 TopLevel: Exp
- 2 | FuncDefs
-
- 3 FuncDefs: /* empty */
- 4 | FuncDef FuncDefs
-
- 5 Exp: FuncDef Exp
- 6 | Term "as" '$' IDENT '|' Exp
- 7 | "if" Exp "then" Exp ElseBody
- 8 | "if" Exp error
- 9 | Exp '=' Exp
- 10 | Exp "or" Exp
- 11 | Exp "and" Exp
- 12 | Exp "//" Exp
- 13 | Exp "//=" Exp
- 14 | Exp "|=" Exp
- 15 | Exp '|' Exp
- 16 | Exp ',' Exp
- 17 | Exp '+' Exp
- 18 | Exp "+=" Exp
- 19 | Exp '-' Exp
- 20 | Exp "-=" Exp
- 21 | Exp '*' Exp
- 22 | Exp "*=" Exp
- 23 | Exp '/' Exp
- 24 | Exp "/=" Exp
- 25 | Exp "==" Exp
- 26 | Exp "!=" Exp
- 27 | Exp '<' Exp
- 28 | Exp '>' Exp
- 29 | Exp "<=" Exp
- 30 | Exp ">=" Exp
- 31 | Exp "contains" Exp
- 32 | Term
-
- 33 String: QQSTRING_START QQString QQSTRING_END
-
- 34 FuncDef: "def" IDENT ':' Exp ';'
- 35 | "def" IDENT '(' IDENT ')' ':' Exp ';'
-
- 36 QQString: /* empty */
- 37 | QQString QQSTRING_TEXT
- 38 | QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
-
- 39 ElseBody: "elif" Exp "then" Exp ElseBody
- 40 | "else" Exp "end"
-
- 41 ExpD: ExpD '|' ExpD
- 42 | Term
-
- 43 Term: '.'
- 44 | Term '.' IDENT
- 45 | '.' IDENT
- 46 | Term '[' Exp ']'
- 47 | Term '[' ']'
- 48 | LITERAL
- 49 | String
- 50 | '(' Exp ')'
- 51 | '[' Exp ']'
- 52 | '[' ']'
- 53 | '{' MkDict '}'
- 54 | '$' IDENT
- 55 | IDENT
- 56 | IDENT '(' Exp ')'
- 57 | '(' error ')'
- 58 | '[' error ']'
- 59 | Term '[' error ']'
- 60 | '{' error '}'
-
- 61 MkDict: /* empty */
- 62 | MkDictPair
- 63 | MkDictPair ',' MkDict
- 64 | error ',' MkDict
-
- 65 MkDictPair: IDENT ':' ExpD
- 66 | String ':' ExpD
- 67 | IDENT
- 68 | '(' Exp ')' ':' ExpD
- 69 | '(' error ')' ':' ExpD
-
-
-Terminals, with rules where they appear
-
-$end (0) 0
-'$' (36) 6 54
-'(' (40) 35 50 56 57 68 69
-')' (41) 35 50 56 57 68 69
-'*' (42) 21
-'+' (43) 17
-',' (44) 16 63 64
-'-' (45) 19
-'.' (46) 43 44 45
-'/' (47) 23
-':' (58) 34 35 65 66 68 69
-';' (59) 34 35
-'<' (60) 27
-'=' (61) 9
-'>' (62) 28
-'[' (91) 46 47 51 52 58 59
-']' (93) 46 47 51 52 58 59
-'{' (123) 53 60
-'|' (124) 6 15 41
-'}' (125) 53 60
-error (256) 8 57 58 59 60 64 69
-INVALID_CHARACTER (258)
-IDENT (259) 6 34 35 44 45 54 55 56 65 67
-LITERAL (260) 48
-"==" (261) 25
-"!=" (262) 26
-"//" (263) 12
-"as" (264) 6
-"def" (265) 34 35
-"if" (266) 7 8
-"then" (267) 7 39
-"else" (268) 40
-"elif" (269) 39
-"end" (270) 40
-"and" (271) 11
-"or" (272) 10
-"|=" (273) 14
-"+=" (274) 18
-"-=" (275) 20
-"*=" (276) 22
-"/=" (277) 24
-"//=" (278) 13
-"<=" (279) 29
-">=" (280) 30
-"contains" (281) 31
-QQSTRING_START (282) 33
-QQSTRING_TEXT (283) 37
-QQSTRING_INTERP_START (284) 38
-QQSTRING_INTERP_END (285) 38
-QQSTRING_END (286) 33
-
-
-Nonterminals, with rules where they appear
-
-$accept (51)
- on left: 0
-TopLevel (52)
- on left: 1 2, on right: 0
-FuncDefs (53)
- on left: 3 4, on right: 2 4
-Exp (54)
- on left: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
- 25 26 27 28 29 30 31 32, on right: 1 5 6 7 8 9 10 11 12 13 14 15
- 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 34 35 38 39 40
- 46 50 51 56 68
-String (55)
- on left: 33, on right: 49 66
-FuncDef (56)
- on left: 34 35, on right: 4 5
-QQString (57)
- on left: 36 37 38, on right: 33 37 38
-ElseBody (58)
- on left: 39 40, on right: 7 39
-ExpD (59)
- on left: 41 42, on right: 41 65 66 68 69
-Term (60)
- on left: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60,
- on right: 6 32 42 44 46 47 59
-MkDict (61)
- on left: 61 62 63 64, on right: 53 63 64
-MkDictPair (62)
- on left: 65 66 67 68 69, on right: 62 63
-
-
-state 0
-
- 0 $accept: . TopLevel $end
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- $default reduce using rule 3 (FuncDefs)
-
- TopLevel go to state 11
- FuncDefs go to state 12
- Exp go to state 13
- String go to state 14
- FuncDef go to state 15
- Term go to state 16
-
-
-state 1
-
- 55 Term: IDENT .
- 56 | IDENT . '(' Exp ')'
-
- '(' shift, and go to state 17
-
- $default reduce using rule 55 (Term)
-
-
-state 2
-
- 48 Term: LITERAL .
-
- $default reduce using rule 48 (Term)
-
-
-state 3
-
- 34 FuncDef: "def" . IDENT ':' Exp ';'
- 35 | "def" . IDENT '(' IDENT ')' ':' Exp ';'
-
- IDENT shift, and go to state 18
-
-
-state 4
-
- 7 Exp: "if" . Exp "then" Exp ElseBody
- 8 | "if" . Exp error
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 19
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 5
-
- 33 String: QQSTRING_START . QQString QQSTRING_END
-
- $default reduce using rule 36 (QQString)
-
- QQString go to state 21
-
-
-state 6
-
- 54 Term: '$' . IDENT
-
- IDENT shift, and go to state 22
-
-
-state 7
-
- 50 Term: '(' . Exp ')'
- 57 | '(' . error ')'
-
- error shift, and go to state 23
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 24
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 8
-
- 43 Term: '.' .
- 45 | '.' . IDENT
-
- IDENT shift, and go to state 25
-
- $default reduce using rule 43 (Term)
-
-
-state 9
-
- 51 Term: '[' . Exp ']'
- 52 | '[' . ']'
- 58 | '[' . error ']'
-
- error shift, and go to state 26
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- ']' shift, and go to state 27
- '{' shift, and go to state 10
-
- Exp go to state 28
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 10
-
- 53 Term: '{' . MkDict '}'
- 60 | '{' . error '}'
-
- error shift, and go to state 29
- IDENT shift, and go to state 30
- QQSTRING_START shift, and go to state 5
- '(' shift, and go to state 31
-
- '}' reduce using rule 61 (MkDict)
-
- String go to state 32
- MkDict go to state 33
- MkDictPair go to state 34
-
-
-state 11
-
- 0 $accept: TopLevel . $end
-
- $end shift, and go to state 35
-
-
-state 12
-
- 2 TopLevel: FuncDefs .
-
- $default reduce using rule 2 (TopLevel)
-
-
-state 13
-
- 1 TopLevel: Exp .
- 9 Exp: Exp . '=' Exp
- 10 | Exp . "or" Exp
- 11 | Exp . "and" Exp
- 12 | Exp . "//" Exp
- 13 | Exp . "//=" Exp
- 14 | Exp . "|=" Exp
- 15 | Exp . '|' Exp
- 16 | Exp . ',' Exp
- 17 | Exp . '+' Exp
- 18 | Exp . "+=" Exp
- 19 | Exp . '-' Exp
- 20 | Exp . "-=" Exp
- 21 | Exp . '*' Exp
- 22 | Exp . "*=" Exp
- 23 | Exp . '/' Exp
- 24 | Exp . "/=" Exp
- 25 | Exp . "==" Exp
- 26 | Exp . "!=" Exp
- 27 | Exp . '<' Exp
- 28 | Exp . '>' Exp
- 29 | Exp . "<=" Exp
- 30 | Exp . ">=" Exp
- 31 | Exp . "contains" Exp
-
- "==" shift, and go to state 36
- "!=" shift, and go to state 37
- "//" shift, and go to state 38
- "and" shift, and go to state 39
- "or" shift, and go to state 40
- "|=" shift, and go to state 41
- "+=" shift, and go to state 42
- "-=" shift, and go to state 43
- "*=" shift, and go to state 44
- "/=" shift, and go to state 45
- "//=" shift, and go to state 46
- "<=" shift, and go to state 47
- ">=" shift, and go to state 48
- "contains" shift, and go to state 49
- '|' shift, and go to state 50
- ',' shift, and go to state 51
- '=' shift, and go to state 52
- '<' shift, and go to state 53
- '>' shift, and go to state 54
- '+' shift, and go to state 55
- '-' shift, and go to state 56
- '*' shift, and go to state 57
- '/' shift, and go to state 58
-
- $default reduce using rule 1 (TopLevel)
-
-
-state 14
-
- 49 Term: String .
-
- $default reduce using rule 49 (Term)
-
-
-state 15
-
- 4 FuncDefs: FuncDef . FuncDefs
- 5 Exp: FuncDef . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- $default reduce using rule 3 (FuncDefs)
-
- FuncDefs go to state 59
- Exp go to state 60
- String go to state 14
- FuncDef go to state 15
- Term go to state 16
-
-
-state 16
-
- 6 Exp: Term . "as" '$' IDENT '|' Exp
- 32 | Term .
- 44 Term: Term . '.' IDENT
- 46 | Term . '[' Exp ']'
- 47 | Term . '[' ']'
- 59 | Term . '[' error ']'
-
- "as" shift, and go to state 61
- '.' shift, and go to state 62
- '[' shift, and go to state 63
-
- $default reduce using rule 32 (Exp)
-
-
-state 17
-
- 56 Term: IDENT '(' . Exp ')'
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 64
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 18
-
- 34 FuncDef: "def" IDENT . ':' Exp ';'
- 35 | "def" IDENT . '(' IDENT ')' ':' Exp ';'
-
- ':' shift, and go to state 65
- '(' shift, and go to state 66
-
-
-state 19
-
- 7 Exp: "if" Exp . "then" Exp ElseBody
- 8 | "if" Exp . error
- 9 | Exp . '=' Exp
- 10 | Exp . "or" Exp
- 11 | Exp . "and" Exp
- 12 | Exp . "//" Exp
- 13 | Exp . "//=" Exp
- 14 | Exp . "|=" Exp
- 15 | Exp . '|' Exp
- 16 | Exp . ',' Exp
- 17 | Exp . '+' Exp
- 18 | Exp . "+=" Exp
- 19 | Exp . '-' Exp
- 20 | Exp . "-=" Exp
- 21 | Exp . '*' Exp
- 22 | Exp . "*=" Exp
- 23 | Exp . '/' Exp
- 24 | Exp . "/=" Exp
- 25 | Exp . "==" Exp
- 26 | Exp . "!=" Exp
- 27 | Exp . '<' Exp
- 28 | Exp . '>' Exp
- 29 | Exp . "<=" Exp
- 30 | Exp . ">=" Exp
- 31 | Exp . "contains" Exp
-
- error shift, and go to state 67
- "==" shift, and go to state 36
- "!=" shift, and go to state 37
- "//" shift, and go to state 38
- "then" shift, and go to state 68
- "and" shift, and go to state 39
- "or" shift, and go to state 40
- "|=" shift, and go to state 41
- "+=" shift, and go to state 42
- "-=" shift, and go to state 43
- "*=" shift, and go to state 44
- "/=" shift, and go to state 45
- "//=" shift, and go to state 46
- "<=" shift, and go to state 47
- ">=" shift, and go to state 48
- "contains" shift, and go to state 49
- '|' shift, and go to state 50
- ',' shift, and go to state 51
- '=' shift, and go to state 52
- '<' shift, and go to state 53
- '>' shift, and go to state 54
- '+' shift, and go to state 55
- '-' shift, and go to state 56
- '*' shift, and go to state 57
- '/' shift, and go to state 58
-
-
-state 20
-
- 5 Exp: FuncDef . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 60
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 21
-
- 33 String: QQSTRING_START QQString . QQSTRING_END
- 37 QQString: QQString . QQSTRING_TEXT
- 38 | QQString . QQSTRING_INTERP_START Exp QQSTRING_INTERP_END
-
- QQSTRING_TEXT shift, and go to state 69
- QQSTRING_INTERP_START shift, and go to state 70
- QQSTRING_END shift, and go to state 71
-
-
-state 22
-
- 54 Term: '$' IDENT .
-
- $default reduce using rule 54 (Term)
-
-
-state 23
-
- 57 Term: '(' error . ')'
-
- ')' shift, and go to state 72
-
-
-state 24
-
- 9 Exp: Exp . '=' Exp
- 10 | Exp . "or" Exp
- 11 | Exp . "and" Exp
- 12 | Exp . "//" Exp
- 13 | Exp . "//=" Exp
- 14 | Exp . "|=" Exp
- 15 | Exp . '|' Exp
- 16 | Exp . ',' Exp
- 17 | Exp . '+' Exp
- 18 | Exp . "+=" Exp
- 19 | Exp . '-' Exp
- 20 | Exp . "-=" Exp
- 21 | Exp . '*' Exp
- 22 | Exp . "*=" Exp
- 23 | Exp . '/' Exp
- 24 | Exp . "/=" Exp
- 25 | Exp . "==" Exp
- 26 | Exp . "!=" Exp
- 27 | Exp . '<' Exp
- 28 | Exp . '>' Exp
- 29 | Exp . "<=" Exp
- 30 | Exp . ">=" Exp
- 31 | Exp . "contains" Exp
- 50 Term: '(' Exp . ')'
-
- "==" shift, and go to state 36
- "!=" shift, and go to state 37
- "//" shift, and go to state 38
- "and" shift, and go to state 39
- "or" shift, and go to state 40
- "|=" shift, and go to state 41
- "+=" shift, and go to state 42
- "-=" shift, and go to state 43
- "*=" shift, and go to state 44
- "/=" shift, and go to state 45
- "//=" shift, and go to state 46
- "<=" shift, and go to state 47
- ">=" shift, and go to state 48
- "contains" shift, and go to state 49
- '|' shift, and go to state 50
- ',' shift, and go to state 51
- '=' shift, and go to state 52
- '<' shift, and go to state 53
- '>' shift, and go to state 54
- '+' shift, and go to state 55
- '-' shift, and go to state 56
- '*' shift, and go to state 57
- '/' shift, and go to state 58
- ')' shift, and go to state 73
-
-
-state 25
-
- 45 Term: '.' IDENT .
-
- $default reduce using rule 45 (Term)
-
-
-state 26
-
- 58 Term: '[' error . ']'
-
- ']' shift, and go to state 74
-
-
-state 27
-
- 52 Term: '[' ']' .
-
- $default reduce using rule 52 (Term)
-
-
-state 28
-
- 9 Exp: Exp . '=' Exp
- 10 | Exp . "or" Exp
- 11 | Exp . "and" Exp
- 12 | Exp . "//" Exp
- 13 | Exp . "//=" Exp
- 14 | Exp . "|=" Exp
- 15 | Exp . '|' Exp
- 16 | Exp . ',' Exp
- 17 | Exp . '+' Exp
- 18 | Exp . "+=" Exp
- 19 | Exp . '-' Exp
- 20 | Exp . "-=" Exp
- 21 | Exp . '*' Exp
- 22 | Exp . "*=" Exp
- 23 | Exp . '/' Exp
- 24 | Exp . "/=" Exp
- 25 | Exp . "==" Exp
- 26 | Exp . "!=" Exp
- 27 | Exp . '<' Exp
- 28 | Exp . '>' Exp
- 29 | Exp . "<=" Exp
- 30 | Exp . ">=" Exp
- 31 | Exp . "contains" Exp
- 51 Term: '[' Exp . ']'
-
- "==" shift, and go to state 36
- "!=" shift, and go to state 37
- "//" shift, and go to state 38
- "and" shift, and go to state 39
- "or" shift, and go to state 40
- "|=" shift, and go to state 41
- "+=" shift, and go to state 42
- "-=" shift, and go to state 43
- "*=" shift, and go to state 44
- "/=" shift, and go to state 45
- "//=" shift, and go to state 46
- "<=" shift, and go to state 47
- ">=" shift, and go to state 48
- "contains" shift, and go to state 49
- '|' shift, and go to state 50
- ',' shift, and go to state 51
- '=' shift, and go to state 52
- '<' shift, and go to state 53
- '>' shift, and go to state 54
- '+' shift, and go to state 55
- '-' shift, and go to state 56
- '*' shift, and go to state 57
- '/' shift, and go to state 58
- ']' shift, and go to state 75
-
-
-state 29
-
- 60 Term: '{' error . '}'
- 64 MkDict: error . ',' MkDict
-
- ',' shift, and go to state 76
- '}' shift, and go to state 77
-
-
-state 30
-
- 65 MkDictPair: IDENT . ':' ExpD
- 67 | IDENT .
-
- ':' shift, and go to state 78
-
- $default reduce using rule 67 (MkDictPair)
-
-
-state 31
-
- 68 MkDictPair: '(' . Exp ')' ':' ExpD
- 69 | '(' . error ')' ':' ExpD
-
- error shift, and go to state 79
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 80
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 32
-
- 66 MkDictPair: String . ':' ExpD
-
- ':' shift, and go to state 81
-
-
-state 33
-
- 53 Term: '{' MkDict . '}'
-
- '}' shift, and go to state 82
-
-
-state 34
-
- 62 MkDict: MkDictPair .
- 63 | MkDictPair . ',' MkDict
-
- ',' shift, and go to state 83
-
- $default reduce using rule 62 (MkDict)
-
-
-state 35
-
- 0 $accept: TopLevel $end .
-
- $default accept
-
-
-state 36
-
- 25 Exp: Exp "==" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 84
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 37
-
- 26 Exp: Exp "!=" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 85
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 38
-
- 12 Exp: Exp "//" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 86
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 39
-
- 11 Exp: Exp "and" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 87
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 40
-
- 10 Exp: Exp "or" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 88
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 41
-
- 14 Exp: Exp "|=" . Exp
-
- IDENT shift, and go to state 1
- LITERAL shift, and go to state 2
- "def" shift, and go to state 3
- "if" shift, and go to state 4
- QQSTRING_START shift, and go to state 5
- '$' shift, and go to state 6
- '(' shift, and go to state 7
- '.' shift, and go to state 8
- '[' shift, and go to state 9
- '{' shift, and go to state 10
-
- Exp go to state 89
- String go to state 14
- FuncDef go to state 20
- Term go to state 16
-
-
-state 42
-
- 18 Exp: Exp "+=" . Exp
-
- IDENT s