1 ;;; make.by -- BY notation for Makefiles.
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eric M. Ludlam
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6 ;; X-RCS: $Id: make.by,v 1.1 2007-11-26 15:11:52 michaels Exp $
8 ;; make.bnf is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; This software is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the
20 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
24 %package semantic-make-by
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 "\\`[\\]\\'"
64 variable: symbol opt-whitespace equals opt-whitespace element-list
65 (VARIABLE-TAG ,$1 nil ,$5)
68 rule: targets opt-whitespace colons opt-whitespace element-list commands
69 (FUNCTION-TAG ,$1 nil ,$5)
72 targets: target opt-whitespace targets
73 ( (car ,$1) (car ,@$3) )
78 target: sub-target target
79 ( (concat (car ,$1) (car ,@$3) ) )
89 conditional: IF whitespace symbol newline
91 | IFDEF whitespace symbol newline
93 | IFNDEF whitespace symbol newline
95 | IFEQ whitespace expression newline
97 | IFNEQ whitespace expression newline
105 expression : semantic-list
108 include: INCLUDE whitespace element-list
109 (INCLUDE-TAG ,$3 nil)
112 equals: COLON EQUAL ()
117 colons: COLON COLON ()
121 element-list: elements newline
125 elements: element whitespace elements
132 element: sub-element element
133 ( (concat (car ,$1) (car ,$2)) )
141 ( (buffer-substring-no-properties
142 (identity start) (identity end)) )
145 varref: DOLLAR semantic-list
146 ( (buffer-substring-no-properties (identity start) (identity end)) )
149 commands: shell-command newline commands
155 opt-whitespace : whitespace ( nil )
159 ;;; make.by ends here