git: Fix bgo 687145 - Critical warning when switching git pane
[anjuta.git] / plugins / am-project / ac-parser.y
blob442ef2cbb7403810515f00977eeb32735c9bce44
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * ac-parser.y
4 * Copyright (C) Sébastien Granjoux 2009 <seb.sfo@free.fr>
6 * main.c is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * main.c is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "ac-scanner.h"
22 #include "ac-parser.h"
24 #include <stdlib.h>
26 #define YYDEBUG 1
28 #include "libanjuta/anjuta-debug.h"
30 /* Token location is found directly from token value, there is no need to
31 * maintain a separate location variable */
32 #define YYLLOC_DEFAULT(Current, Rhs, N) ((Current) = YYRHSLOC(Rhs, (N) ? 1 : 0))
36 %token END_OF_FILE
37 %token END_OF_LINE '\n'
39 %token SPACE ' '
41 %token HASH '#'
42 %token LEFT_PAREN '('
43 %token RIGHT_PAREN ')'
44 %token LEFT_CURLY '{'
45 %token RIGHT_CURLY '}'
46 %token LEFT_BRACE '['
47 %token RIGHT_BRACE ']'
48 %token EQUAL '='
49 %token COMMA ','
50 %token LOWER '<'
51 %token GREATER '>'
52 %token SINGLE_QUOTE '\''
53 %token DOUBLE_QUOTE '\"'
55 %token COMMENT 256
56 %token NAME
57 %token VARIABLE
58 %token MACRO
59 %token OPERATOR
60 %token WORD
61 %token JUNK
63 %token START_SPACE_LIST
65 /* M4 macros */
67 %token DNL
68 %token M4_INCLUDE
71 /* Autoconf macros */
73 %token AC_MACRO_WITH_ARG
74 %token AC_MACRO_WITHOUT_ARG
76 %token AC_ARG_ENABLE
77 %token AC_C_CONST
78 %token AC_CHECK_FUNCS
79 %token AC_CHECK_HEADERS
80 %token AC_CHECK_LIB
81 %token AC_CHECK_PROG
82 %token AC_CONFIG_FILES
83 %token AC_CONFIG_HEADERS
84 %token AC_CONFIG_MACRO_DIR
85 %token AC_CONFIG_SRCDIR
86 %token AC_EGREP_HEADER
87 %token AC_EXEEXT
88 %token AC_HEADER_STDC
89 %token AC_INIT
90 %token AC_OBJEXT
91 %token AC_OUTPUT
92 %token OBSOLETE_AC_OUTPUT
93 %token AC_PREREQ
94 %token AC_PROG_CC
95 %token AC_PROG_CPP
96 %token AC_PROG_CXX
97 %token IT_PROG_INTLTOOL
98 %token AC_PROG_LEX
99 %token AC_PROG_RANLIB
100 %token AC_PROG_YACC
101 %token AC_SUBST
102 %token AC_TYPE_SIZE_T
103 %token AC_TYPE_OFF_T
104 %token AM_INIT_AUTOMAKE
105 %token AM_GLIB_GNU_GETTEXT
106 %token AM_MAINTAINER_MODE
107 %token AM_PROG_LIBTOOL
108 %token AC_PROG_LIBTOOL
109 %token LT_INIT
110 %token DEFAULT_LT_INIT
111 %token LT_PREREQ
112 %token PKG_CHECK_MODULES
113 %token PKG_PROG_PKG_CONFIG
117 %defines
119 %define api.pure
120 %define api.push_pull "push"
122 %parse-param {AmpAcScanner* scanner}
123 %lex-param {AmpAcScanner* scanner}
125 %name-prefix="amp_ac_yy"
127 %locations
129 %start input
131 %debug
135 //amp_ac_yydebug = 1;
137 static gint
138 amp_ac_autoconf_macro (AnjutaToken *token)
140 switch (anjuta_token_get_type (token))
142 case AC_ARG_ENABLE: return AC_TOKEN_AC_ARG_ENABLE;
143 case AC_C_CONST: return AC_TOKEN_AC_C_CONST;
144 case AC_CHECK_FUNCS: return AC_TOKEN_AC_CHECK_FUNCS;
145 case AC_CHECK_HEADERS: return AC_TOKEN_AC_CHECK_HEADERS;
146 case AC_CHECK_LIB: return AC_TOKEN_AC_CHECK_LIB;
147 case AC_CHECK_PROG: return AC_TOKEN_AC_CHECK_PROG;
148 case AC_CONFIG_FILES: return AC_TOKEN_AC_CONFIG_FILES;
149 case AC_CONFIG_HEADERS: return AC_TOKEN_AC_CONFIG_HEADERS;
150 case AC_CONFIG_MACRO_DIR: return AC_TOKEN_AC_CONFIG_MACRO_DIR;
151 case AC_CONFIG_SRCDIR: return AC_TOKEN_AC_CONFIG_SRCDIR;
152 case AC_EGREP_HEADER: return AC_TOKEN_AC_EGREP_HEADER;
153 case AC_EXEEXT: return AC_TOKEN_AC_EXEEXT;
154 case AC_HEADER_STDC: return AC_TOKEN_AC_HEADER_STDC;
155 case AC_INIT: return AC_TOKEN_AC_INIT;
156 case AC_OBJEXT: return AC_TOKEN_AC_OBJEXT;
157 case AC_OUTPUT: return AC_TOKEN_AC_OUTPUT;
158 case OBSOLETE_AC_OUTPUT: return AC_TOKEN_OBSOLETE_AC_OUTPUT;
159 case AC_PREREQ: return AC_TOKEN_AC_PREREQ;
160 case AC_PROG_CC: return AC_TOKEN_AC_PROG_CC;
161 case AC_PROG_CPP: return AC_TOKEN_AC_PROG_CPP;
162 case AC_PROG_CXX: return AC_TOKEN_AC_PROG_CXX;
163 case IT_PROG_INTLTOOL: return AC_TOKEN_IT_PROG_INTLTOOL;
164 case AC_PROG_LEX: return AC_TOKEN_AC_PROG_LEX;
165 case AC_PROG_RANLIB: return AC_TOKEN_AC_PROG_RANLIB;
166 case AC_PROG_YACC: return AC_TOKEN_AC_PROG_YACC;
167 case AC_TYPE_SIZE_T: return AC_TOKEN_AC_TYPE_SIZE_T;
168 case AC_TYPE_OFF_T: return AC_TOKEN_AC_TYPE_OFF_T;
169 case AM_INIT_AUTOMAKE: return AC_TOKEN_AM_INIT_AUTOMAKE;
170 case AM_GLIB_GNU_GETTEXT: return AC_TOKEN_AM_GLIB_GNU_GETTEXT;
171 case AM_MAINTAINER_MODE: return AC_TOKEN_AM_MAINTAINER_MODE;
172 case AC_PROG_LIBTOOL: return AC_TOKEN_AC_PROG_LIBTOOL;
173 case AM_PROG_LIBTOOL: return AC_TOKEN_AM_PROG_LIBTOOL;
174 case LT_INIT: return AC_TOKEN_LT_INIT;
175 case DEFAULT_LT_INIT: return AC_TOKEN_LT_INIT;
176 case LT_PREREQ: return AC_TOKEN_LT_PREREQ;
177 case PKG_CHECK_MODULES: return AC_TOKEN_PKG_CHECK_MODULES;
178 case PKG_PROG_PKG_CONFIG: return AC_TOKEN_PKG_PROG_PKG_CONFIG;
179 default: return anjuta_token_get_type (token);
187 input:
188 file
189 | START_SPACE_LIST space_list
192 file:
193 /* empty */
194 | file line
197 line:
198 optional_spaces end_statement
199 | optional_spaces statement end_statement
203 definition:
204 NAME optional_spaces EQUAL value {
205 $$ = anjuta_token_new_static (ANJUTA_TOKEN_DEFINITION, NULL);
206 if ($2) anjuta_token_set_type ($2, ANJUTA_TOKEN_NEXT);
207 anjuta_token_merge ($$, $1);
208 anjuta_token_merge ($$, $2);
209 anjuta_token_merge ($$, $3);
210 anjuta_token_merge ($$, $4);
211 amp_ac_scanner_update_variable (scanner, $$);
213 | NAME optional_spaces EQUAL {
214 $$ = anjuta_token_new_static (ANJUTA_TOKEN_DEFINITION, NULL);
215 if ($2) anjuta_token_set_type ($2, ANJUTA_TOKEN_NEXT);
216 anjuta_token_merge ($$, $1);
217 anjuta_token_merge ($$, $2);
218 anjuta_token_merge ($$, $3);
219 amp_ac_scanner_update_variable (scanner, $$);
223 statement:
224 definition
225 | other_statement
228 other_statement:
229 no_name_token
230 | no_name_token value
231 | NAME optional_spaces
232 | NAME optional_spaces no_equal_token
233 | NAME optional_spaces no_equal_token value
236 value:
237 value_token {
238 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
239 anjuta_token_merge ($$, $1);
241 | value value_token {
242 anjuta_token_merge ($1, $2);
246 value_token:
247 m4_string
248 | shell_string
249 | args_token
250 | macro
251 | EQUAL
252 | LOWER
253 | GREATER
254 | NAME
255 | VARIABLE
256 | WORD
257 | SPACE
260 no_name_token:
261 m4_string
262 | shell_string
263 | args_token
264 | macro
265 | EQUAL
266 | LOWER
267 | GREATER
268 | VARIABLE
269 | WORD
272 no_equal_token:
273 m4_string
274 | shell_string
275 | args_token
276 | macro
277 | LOWER
278 | GREATER
279 | NAME
280 | VARIABLE
281 | WORD
285 macro:
286 include
287 | ac_macro_with_arg
288 | ac_macro_without_arg
289 | ac_subst
290 | pkg_check_modules
291 | obsolete_ac_output
292 | ac_output
293 | ac_config_files
296 /* Space list
297 *----------------------------------------------------------------------------*/
299 space_list:
300 /* empty */
301 | space_list_body
302 | space_list_body spaces_with_eol {
303 anjuta_token_set_type ($2, ANJUTA_TOKEN_LAST);
307 space_list_body:
308 item
309 | spaces_with_eol item {
310 anjuta_token_set_type ($1, ANJUTA_TOKEN_NEXT);
312 | space_list_body spaces_with_eol item {
313 anjuta_token_set_type ($2, ANJUTA_TOKEN_NEXT);
317 item:
318 name
319 | operator
322 operator:
323 OPERATOR {
324 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPERATOR);
328 name:
329 not_operator_token {
330 $$ = anjuta_token_new_static (ANJUTA_TOKEN_NAME, NULL);
331 anjuta_token_merge ($$, $1);
333 | name word_token {
334 anjuta_token_merge ($1, $2);
338 /* Macros
339 *----------------------------------------------------------------------------*/
341 end_statement:
343 | comment
344 | end_of_line
347 dnl:
348 DNL not_eol_list end_of_line {
349 $$ = anjuta_token_new_static (ANJUTA_TOKEN_COMMENT, NULL);
350 anjuta_token_merge ($$, $1);
351 anjuta_token_merge ($$, $2);
352 anjuta_token_merge ($$, $3);
356 include:
357 M4_INCLUDE arg_list {
358 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
359 anjuta_token_merge ($$, $1);
360 anjuta_token_merge ($$, $2);
361 amp_ac_scanner_include (scanner, $$);
366 pkg_check_modules:
367 PKG_CHECK_MODULES arg_list {
368 $$ = anjuta_token_new_static (AC_TOKEN_PKG_CHECK_MODULES, NULL);
369 anjuta_token_merge ($$, $1);
370 anjuta_token_merge ($$, $2);
371 amp_ac_scanner_load_module (scanner, $2);
375 optional_arg:
376 /* empty */ %prec EMPTY
377 | COMMA NAME %prec ARG
380 ac_macro_with_arg:
381 ac_macro_with_arg_token arg_list {
382 $$ = anjuta_token_new_static (amp_ac_autoconf_macro ($1), NULL);
383 anjuta_token_merge ($$, $1);
384 anjuta_token_merge ($$, $2);
385 amp_ac_scanner_load_properties (scanner, $$, $2);
389 ac_macro_without_arg:
390 ac_macro_without_arg_token {
391 anjuta_token_set_type ($1, amp_ac_autoconf_macro ($1));
392 amp_ac_scanner_load_properties (scanner, $$, NULL);
395 ac_subst:
396 AC_SUBST arg_list {
397 $$ = anjuta_token_new_static (AC_TOKEN_AC_SUBST, NULL);
398 anjuta_token_merge ($$, $1);
399 anjuta_token_merge ($$, $2);
400 amp_ac_scanner_subst_variable (scanner, $2);
404 ac_output:
405 AC_OUTPUT {
406 anjuta_token_set_type ($1, AC_TOKEN_AC_OUTPUT);
410 obsolete_ac_output:
411 OBSOLETE_AC_OUTPUT arg_list {
412 $$ = anjuta_token_new_static (AC_TOKEN_OBSOLETE_AC_OUTPUT, NULL);
413 anjuta_token_merge ($$, $1);
414 anjuta_token_merge ($$, $2);
415 amp_ac_scanner_load_config (scanner, $2);
419 ac_config_files:
420 AC_CONFIG_FILES arg_list {
421 $$ = anjuta_token_new_static (AC_TOKEN_AC_CONFIG_FILES, NULL);
422 anjuta_token_merge ($$, $1);
423 anjuta_token_merge ($$, $2);
424 amp_ac_scanner_load_config (scanner, $2);
428 /* Lists
429 *----------------------------------------------------------------------------*/
431 arg_list:
432 arg_list_body RIGHT_PAREN {
433 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LAST, NULL);
434 anjuta_token_merge ($$, $2);
435 anjuta_token_merge ($1, $$);
436 $$ = $1;
438 | spaces_with_eol arg_list_body RIGHT_PAREN {
439 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LAST, NULL);
440 anjuta_token_merge ($$, $3);
441 anjuta_token_merge ($2, $$);
442 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
443 anjuta_token_set_type ($1, ANJUTA_TOKEN_START);
444 anjuta_token_merge ($$, $1);
445 anjuta_token_merge_children ($$, $2);
449 arg_list_body:
450 arg {
451 $$ = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
452 anjuta_token_merge ($$, $1);
453 //fprintf(stdout, "arg_list_body arg\n");
454 //anjuta_token_dump ($1);
456 | arg_list_body separator arg {
457 //fprintf(stdout, "arg_list_body body\n");
458 //anjuta_token_dump ($1);
459 //fprintf(stdout, "arg_list_body separator\n");
460 //anjuta_token_dump ($2);
461 //fprintf(stdout, "arg_list_body arg\n");
462 //anjuta_token_dump ($3);
463 anjuta_token_merge ($1, $2);
464 anjuta_token_merge ($1, $3);
465 //fprintf(stdout, "arg_list_body merge\n");
466 //anjuta_token_dump ($1);
470 comment:
471 HASH not_eol_list end_of_line {
472 $$ = anjuta_token_new_static (ANJUTA_TOKEN_COMMENT, NULL);
473 anjuta_token_merge ($$, $1);
474 anjuta_token_merge ($$, $2);
475 anjuta_token_merge ($$, $3);
479 not_eol_list:
480 /* empty */ {
481 $$ = NULL;
483 | not_eol_list not_eol_token {
484 $$ = $2;
488 shell_string:
489 single_string
490 | double_string
493 single_string:
494 SINGLE_QUOTE single_string_body SINGLE_QUOTE {
495 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
496 anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
497 $$ = anjuta_token_merge_previous ($2, $1);
498 anjuta_token_merge ($2, $3);
502 single_string_body:
503 /* empty */ {
504 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
506 | single_string_body not_single_token {
507 anjuta_token_merge ($1, $2);
511 not_single_token:
512 m4_string
513 | args_token
514 | macro
515 | dnl
516 | EQUAL
517 | LOWER
518 | GREATER
519 | NAME
520 | VARIABLE
521 | WORD
522 | SPACE
523 | HASH
524 | END_OF_LINE
525 | DOUBLE_QUOTE
526 | RIGHT_BRACE
529 double_string:
530 DOUBLE_QUOTE double_string_body DOUBLE_QUOTE {
531 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
532 anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
533 $$ = anjuta_token_merge_previous ($2, $1);
534 anjuta_token_merge ($2, $3);
538 double_string_body:
539 /* empty */ {
540 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
542 | double_string_body not_double_token {
543 anjuta_token_merge ($1, $2);
547 not_double_token:
548 m4_string
549 | args_token
550 | macro
551 | dnl
552 | EQUAL
553 | LOWER
554 | GREATER
555 | NAME
556 | VARIABLE
557 | WORD
558 | SPACE
559 | HASH
560 | END_OF_LINE
561 | SINGLE_QUOTE
564 m4_string:
565 LEFT_BRACE m4_string_body RIGHT_BRACE {
566 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
567 anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
568 $$ = anjuta_token_merge_previous ($2, $1);
569 anjuta_token_merge ($2, $3);
573 m4_string_body:
574 /* empty */ {
575 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
577 | m4_string_body not_brace_token {
578 anjuta_token_merge ($1, $2);
580 | m4_string_body m4_string {
581 anjuta_token_merge ($1, $2);
585 raw_string:
586 LEFT_BRACE raw_string_body RIGHT_BRACE {
587 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
588 anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
589 $$ = anjuta_token_merge_previous ($2, $1);
590 anjuta_token_merge ($2, $3);
594 raw_string_body:
595 /* empty */ {
596 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
598 | raw_string_body not_brace_token {
599 anjuta_token_merge ($1, $2);
601 | raw_string_body raw_string {
602 anjuta_token_merge ($1, $2);
606 arg_string:
607 LEFT_BRACE arg_string_body RIGHT_BRACE {
608 anjuta_token_set_type ($1, ANJUTA_TOKEN_OPEN_QUOTE);
609 anjuta_token_set_type ($3, ANJUTA_TOKEN_CLOSE_QUOTE);
610 $$ = anjuta_token_merge_previous ($2, $1);
611 anjuta_token_merge ($2, $3);
615 arg_string_body:
616 /* empty */ {
617 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
619 | arg_string_body SPACE {
620 anjuta_token_merge ($1, $2);
622 | arg_string_body END_OF_LINE {
623 anjuta_token_merge ($1, $2);
625 | arg_string_body HASH {
626 anjuta_token_merge ($1, $2);
628 | arg_string_body LEFT_PAREN {
629 anjuta_token_merge ($1, $2);
631 | arg_string_body RIGHT_PAREN {
632 anjuta_token_merge ($1, $2);
634 | arg_string_body COMMA {
635 anjuta_token_merge ($1, $2);
637 | arg_string_body EQUAL {
638 anjuta_token_merge ($1, $2);
640 | arg_string_body GREATER {
641 anjuta_token_merge ($1, $2);
643 | arg_string_body LOWER {
644 anjuta_token_merge ($1, $2);
646 | arg_string_body NAME {
647 anjuta_token_merge ($1, $2);
649 | arg_string_body VARIABLE {
650 anjuta_token_merge ($1, $2);
652 | arg_string_body WORD {
653 anjuta_token_merge ($1, $2);
655 | arg_string_body SINGLE_QUOTE {
656 anjuta_token_merge ($1, $2);
658 | arg_string_body DOUBLE_QUOTE {
659 anjuta_token_merge ($1, $2);
661 | arg_string_body macro
662 | arg_string_body dnl
663 | arg_string_body raw_string {
664 anjuta_token_merge ($1, $2);
668 /* Items
669 *----------------------------------------------------------------------------*/
671 arg:
672 /* empty */ {
673 $$ = anjuta_token_new_static (ANJUTA_TOKEN_ITEM, NULL);
675 | arg_part arg_body {
676 //fprintf(stdout, "arg part\n");
677 //anjuta_token_dump ($1);
678 //fprintf(stdout, "arg body\n");
679 //anjuta_token_dump ($2);
680 $$ = anjuta_token_new_static (ANJUTA_TOKEN_ITEM, NULL);
681 anjuta_token_merge ($$, $1);
682 anjuta_token_merge_children ($$, $2);
683 //fprintf(stdout, "arg merge\n");
684 //anjuta_token_dump ($1);
688 arg_body:
689 /* empty */ {
690 $$ = anjuta_token_new_static (ANJUTA_TOKEN_ITEM, NULL);
692 | arg_body arg_part_or_space {
693 $$ = anjuta_token_merge ($1, $2);
697 arg_part_or_space:
698 SPACE
699 | END_OF_LINE
700 | arg_part
703 arg_part:
704 arg_string
705 | expression
706 | macro
707 | dnl
708 | arg_token
711 arg_token:
712 HASH
713 | EQUAL
714 | LOWER
715 | GREATER
716 | NAME
717 | VARIABLE
718 | WORD
719 | SINGLE_QUOTE
720 | DOUBLE_QUOTE
723 separator:
724 COMMA {
725 $$ = anjuta_token_new_static (ANJUTA_TOKEN_NEXT, NULL);
726 anjuta_token_merge ($$, $1);
728 | COMMA spaces_with_eol {
729 $$ = anjuta_token_new_static (ANJUTA_TOKEN_NEXT, NULL);
730 //fprintf(stdout, "separator spaces\n");
731 //anjuta_token_dump ($2);
732 //fprintf(stdout, "separator comma\n");
733 //anjuta_token_dump ($1);
734 //fprintf(stdout, "separator next\n");
735 //anjuta_token_dump ($$);
736 anjuta_token_merge ($$, $1);
737 anjuta_token_merge_children ($$, $2);
738 //fprintf(stdout, "separator merge\n");
739 //anjuta_token_dump ($$);
743 expression:
744 LEFT_PAREN expression_body RIGHT_PAREN {
745 $$ = anjuta_token_merge_previous ($2, $1);
746 anjuta_token_merge ($2, $3);
750 expression_body:
751 /* empty */ {
752 $$ = anjuta_token_new_static (ANJUTA_TOKEN_STRING, NULL);
754 | expression_body SPACE {
755 anjuta_token_merge ($1, $2);
757 | expression_body END_OF_LINE {
758 anjuta_token_merge ($1, $2);
760 | expression_body comment
761 | expression_body COMMA {
762 anjuta_token_merge ($1, $2);
764 | expression_body EQUAL {
765 anjuta_token_merge ($1, $2);
767 | expression_body LOWER {
768 anjuta_token_merge ($1, $2);
770 | expression_body GREATER {
771 anjuta_token_merge ($1, $2);
773 | expression_body NAME {
774 anjuta_token_merge ($1, $2);
776 | expression_body VARIABLE {
777 anjuta_token_merge ($1, $2);
779 | expression_body WORD {
780 anjuta_token_merge ($1, $2);
782 | expression_body SINGLE_QUOTE {
783 anjuta_token_merge ($1, $2);
785 | expression_body DOUBLE_QUOTE {
786 anjuta_token_merge ($1, $2);
788 | expression_body macro
789 | expression_body expression {
790 anjuta_token_merge ($1, $2);
792 | expression_body arg_string {
793 anjuta_token_merge ($1, $2);
797 optional_spaces:
798 /* empty */ {
799 $$ = NULL;
801 | spaces
804 spaces:
805 SPACE {
806 $$ = anjuta_token_new_static (ANJUTA_TOKEN_SPACE, NULL);
807 anjuta_token_merge ($$, $1);
809 | spaces SPACE {
810 anjuta_token_merge ($1, $2);
814 spaces_with_eol:
815 SPACE {
816 $$ = anjuta_token_new_static (ANJUTA_TOKEN_SPACE, NULL);
817 anjuta_token_merge ($$, $1);
819 | END_OF_LINE {
820 $$ = anjuta_token_new_static (ANJUTA_TOKEN_SPACE, NULL);
821 anjuta_token_merge ($$, $1);
823 | spaces_with_eol SPACE {
824 anjuta_token_merge ($1, $2);
826 | spaces_with_eol END_OF_LINE {
827 anjuta_token_merge ($1, $2);
832 /* Tokens
833 *----------------------------------------------------------------------------*/
835 not_eol_token:
836 SPACE
837 | args_token
838 | HASH
839 | OPERATOR
840 | EQUAL
841 | LOWER
842 | GREATER
843 | NAME
844 | VARIABLE
845 | WORD
846 | SINGLE_QUOTE
847 | DOUBLE_QUOTE
848 | any_macro
849 | M4_INCLUDE
850 | LEFT_BRACE
851 | RIGHT_BRACE
854 not_brace_token:
855 SPACE
856 | END_OF_LINE
857 | args_token
858 | HASH
859 | EQUAL
860 | LOWER
861 | GREATER
862 | OPERATOR
863 | NAME
864 | VARIABLE
865 | WORD
866 | SINGLE_QUOTE
867 | DOUBLE_QUOTE
868 | any_macro
869 | M4_INCLUDE
872 space_token:
873 SPACE
874 | END_OF_LINE
877 args_token:
878 LEFT_PAREN
879 | RIGHT_PAREN
880 | COMMA
883 not_operator_token:
884 HASH
885 | LEFT_BRACE
886 | RIGHT_BRACE
887 | LEFT_PAREN
888 | RIGHT_PAREN
889 | COMMA
890 | NAME
891 | VARIABLE
892 | WORD
893 | SINGLE_QUOTE
894 | DOUBLE_QUOTE
895 | any_macro
896 | include
899 word_token:
900 HASH
901 | LEFT_BRACE
902 | RIGHT_BRACE
903 | LEFT_PAREN
904 | RIGHT_PAREN
905 | COMMA
906 | OPERATOR
907 | EQUAL
908 | LOWER
909 | GREATER
910 | NAME
911 | VARIABLE
912 | WORD
913 | SINGLE_QUOTE
914 | DOUBLE_QUOTE
915 | any_macro
916 | include
919 any_macro:
920 AC_CONFIG_FILES
921 | AC_OUTPUT
922 | DNL
923 | OBSOLETE_AC_OUTPUT
924 | PKG_CHECK_MODULES
925 | AC_INIT
926 | AC_SUBST
927 | ac_macro_with_arg_token
928 | ac_macro_without_arg_token
931 ac_macro_without_arg_token:
932 AC_MACRO_WITHOUT_ARG
933 | AC_C_CONST
934 | AC_EXEEXT
935 | AC_HEADER_STDC
936 | AC_OBJEXT
937 | AC_PROG_CC
938 | AC_PROG_CPP
939 | AC_PROG_CXX
940 | AC_PROG_LEX
941 | AC_PROG_RANLIB
942 | AC_PROG_YACC
943 | AC_TYPE_SIZE_T
944 | AC_TYPE_OFF_T
945 | AM_MAINTAINER_MODE
946 | AM_PROG_LIBTOOL
947 | AC_PROG_LIBTOOL
948 | DEFAULT_LT_INIT
951 ac_macro_with_arg_token:
952 AC_MACRO_WITH_ARG
953 | AC_ARG_ENABLE
954 | AC_CHECK_FUNCS
955 | AC_CHECK_HEADERS
956 | AC_CHECK_LIB
957 | AC_CHECK_PROG
958 | AC_CONFIG_HEADERS
959 | AC_CONFIG_MACRO_DIR
960 | AC_CONFIG_SRCDIR
961 | AC_EGREP_HEADER
962 | AC_PREREQ
963 | AC_INIT
964 | IT_PROG_INTLTOOL
965 | AM_INIT_AUTOMAKE
966 | AM_GLIB_GNU_GETTEXT
967 | LT_INIT
968 | LT_PREREQ
969 | PKG_PROG_PKG_CONFIG
972 end_of_line:
973 END_OF_LINE {
974 anjuta_token_set_type ($1, ANJUTA_TOKEN_EOL);
976 | END_OF_FILE