summaryrefslogtreecommitdiff
path: root/jam-files/boost-build/tools/whale.jam
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-10-11 14:06:32 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-10-11 14:06:32 -0400
commit9339c80d465545aec5a6dccfef7c83ca715bf11f (patch)
tree64c56d558331edad1db3832018c80e799551c39a /jam-files/boost-build/tools/whale.jam
parent438dac41810b7c69fa10203ac5130d20efa2da9f (diff)
parentafd7da3b2338661657ad0c4e9eec681e014d37bf (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'jam-files/boost-build/tools/whale.jam')
-rw-r--r--jam-files/boost-build/tools/whale.jam116
1 files changed, 0 insertions, 116 deletions
diff --git a/jam-files/boost-build/tools/whale.jam b/jam-files/boost-build/tools/whale.jam
deleted file mode 100644
index 9335ff0c..00000000
--- a/jam-files/boost-build/tools/whale.jam
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright (C) Vladimir Prus 2002-2005.
-
-# Use, modification and distribution is subject to the Boost Software
-# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
-# http://www.boost.org/LICENSE_1_0.txt)
-
-# This module implements support for Whale/Dolphin/WD parser/lexer tools.
-# See http://www.cs.queensu.ca/home/okhotin/whale/ for details.
-#
-# There are three interesting target types:
-# - WHL (the parser sources), that are converted to CPP and H
-# - DLP (the lexer sources), that are converted to CPP and H
-# - WD (combined parser/lexer sources), that are converted to WHL + DLP
-
-import type ;
-import generators ;
-import path ;
-import "class" : new ;
-import errors ;
-
-rule init ( path # path the Whale/Dolphin/WD binaries
- )
-{
- if $(.configured) && $(.path) != $(path)
- {
- errors.user-error "Attempt to reconfigure Whale support" :
- "Previously configured with path \"$(.path:E=<empty>)\"" :
- "Now configuring with path \"$(path:E=<empty>)\"" ;
-
- }
- .configured = true ;
- .path = $(path) ;
-
- .whale = [ path.join $(path) whale ] ;
- .dolphin = [ path.join $(path) dolphin ] ;
- .wd = [ path.join $(path) wd ] ;
-}
-
-
-# Declare the types.
-type.register WHL : whl ;
-type.register DLP : dlp ;
-type.register WHL_LR0 : lr0 ;
-type.register WD : wd ;
-
-# Declare standard generators.
-generators.register-standard whale.whale : WHL : CPP H H(%_symbols) ;
-generators.register-standard whale.dolphin : DLP : CPP H ;
-generators.register-standard whale.wd : WD : WHL(%_parser) DLP(%_lexer) ;
-
-# The conversions defines above a ambiguious when we generated CPP from WD.
-# We can either go via WHL type, or via DLP type.
-# The following custom generator handles this by running both conversions.
-
-class wd-to-cpp : generator
-{
- rule __init__ ( * : * : * )
- {
- generator.__init__ $(1) : $(2) : $(3) ;
- }
-
- rule run ( project name ? : property-set : source * )
- {
- if ! $(source[2])
- {
- local new-sources ;
- if ! [ $(source).type ] in WHL DLP
- {
- local r1 = [ generators.construct $(project) $(name)
- : WHL : $(property-set) : $(source) ] ;
- local r2 = [ generators.construct $(project) $(name)
- : DLP : $(property-set) : $(source) ] ;
-
- new-sources = [ sequence.unique $(r1[2-]) $(r2[2-]) ] ;
- }
- else
- {
- new-sources = $(source) ;
- }
-
- local result ;
- for local i in $(new-sources)
- {
- local t = [ generators.construct $(project) $(name) : CPP
- : $(property-set) : $(i) ] ;
- result += $(t[2-]) ;
- }
- return $(result) ;
- }
- }
-
-}
-
-
-generators.override whale.wd-to-cpp : whale.whale ;
-generators.override whale.wd-to-cpp : whale.dolphin ;
-
-
-generators.register [ new wd-to-cpp whale.wd-to-cpp : : CPP ] ;
-
-
-actions whale
-{
- $(.whale) -d $(<[1]:D) $(>)
-}
-
-actions dolphin
-{
- $(.dolphin) -d $(<[1]:D) $(>)
-}
-
-actions wd
-{
- $(.wd) -d $(<[1]:D) -g $(>)
-}
-