1 ;;; make.by -- BY notation for Makefiles.
3 ;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6 ;; David Ponce <david@dponce.com>
7 ;; Klaus Berndl <klaus.berndl@sdm.de>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26 %languagemode makefile-mode
29 ;; This was always a test case.
34 %token IFNDEF "ifndef"
39 %token INCLUDE "include"
41 %put { IF ELSE ENDIF } summary "Conditional: if (expression) ... else ... endif"
42 %put IFDEF summary "Conditional: ifdef (expression) ... else ... endif"
43 %put IFNDEF summary "Conditional: ifndef (expression) ... else ... endif"
44 %put IFEQ summary "Conditional: ifeq (expression) ... else ... endif"
45 %put IFNEQ summary "Conditional: ifneq (expression) ... else ... endif"
46 %put INCLUDE summary "Macro: include filename1 filename2 ..."
48 %token <punctuation> COLON "\\`[:]\\'"
49 %token <punctuation> PLUS "\\`[+]\\'"
50 %token <punctuation> EQUAL "\\`[=]\\'"
51 %token <punctuation> DOLLAR "\\`[$]\\'"
52 %token <punctuation> BACKSLASH "\\`[\\]\\'"
56 Makefile : bol newline (nil)
69 variable: symbol opt-whitespace equals opt-whitespace element-list
70 (VARIABLE-TAG ,$1 nil ,$5)
73 rule: targets opt-whitespace colons opt-whitespace element-list commands
74 (FUNCTION-TAG ,$1 nil ,$5)
77 targets: target opt-whitespace targets
78 ( (car ,$1) (car ,@$3) )
83 target: sub-target target
84 ( (concat (car ,$1) (car ,@$3) ) )
94 conditional: IF some-whitespace symbol newline
96 | IFDEF some-whitespace symbol newline
98 | IFNDEF some-whitespace symbol newline
100 | IFEQ some-whitespace expression newline
102 | IFNEQ some-whitespace expression newline
110 expression : semantic-list
113 include: INCLUDE some-whitespace element-list
114 (INCLUDE-TAG ,$3 nil)
117 equals: COLON EQUAL ()
122 colons: COLON COLON ()
126 element-list: elements newline
130 elements: element some-whitespace elements
137 element: sub-element element
138 ( (concat (car ,$1) (car ,$2)) )
146 ( (buffer-substring-no-properties
147 (identity start) (identity end)) )
150 varref: DOLLAR semantic-list
151 ( (buffer-substring-no-properties (identity start) (identity end)) )
154 commands: bol shell-command newline commands
160 opt-whitespace : some-whitespace ( nil )
164 some-whitespace : whitespace some-whitespace (nil)
168 ;;; make.by ends here