summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xCHANGES.txt11
-rwxr-xr-xRELEASE.txt8
-rw-r--r--SCons/Tool/lex.py20
-rw-r--r--SCons/Tool/lex.xml10
-rw-r--r--SCons/Tool/yacc.py18
-rw-r--r--SCons/Tool/yacc.xml10
-rw-r--r--test/LEX/FLEXFLAGS.py4
-rw-r--r--test/YACC/BISONFLAGS.py4
8 files changed, 43 insertions, 42 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 42d0cd3..0e54bad 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -209,11 +209,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
Tool module loading no longer special-cases Jython, which is a dead
project as far as SCons (no timeline in sight for Python 3 support).
- Improvements to lex and yacc tools: better documentation of
- extra-file options, add test for extra-file behavior. Two new
- construction variables are introduced for lex (LEXHEADERFILE and
- LEXTABLEFILE) as the preferred way of specifying these extra-file
- options. Two new construction variables are introduced for yacc
- (YACCHEADERFILE and YACCGRAPHFILE) as the preferred way of
+ extra-file options, add test for extra-file behavior.
+ - Two new construction variables are introduced for lex (LEX_HEADER_FILE
+ and LEX_TABLE_FILE) as the preferred way of specifying these extra-file
+ options.
+ - Two new construction variables are introduced for yacc
+ (YACC_HEADER_FILE and YACC_GRAPH_FILE) as the preferred way of
specifying these extra-file options.
diff --git a/RELEASE.txt b/RELEASE.txt
index 31080cb..7e6ea9a 100755
--- a/RELEASE.txt
+++ b/RELEASE.txt
@@ -45,11 +45,11 @@ NEW FUNCTIONALITY
option may be added in a future enhancement.
- Fortran: a new construction variable FORTRANCOMMONFLAGS is added which is
applied to all Fortran dialects, to enable global (all-dialect) settings.
-- lex: two new construction variables are introduced (LEXHEADERFILE
- and LEXTABLEFILE) as the preferred way of specifying extra files that
+- lex: two new construction variables are introduced (LEX_HEADER_ILE
+ and LEX_TABLE_FILE) as the preferred way of specifying extra files that
the tool can generate.
-- yacc: two new construction variables are introduced (YACCHEADERFILE
- and YACCGRAPHFILE) as the preferred way of specifying extra files that
+- yacc: two new construction variables are introduced (YACC_HEADER_FILE
+ and YACC_GRAPH_FILE) as the preferred way of specifying extra files that
the tool can generate (applies only when using GNU flex and GNU bison).
diff --git a/SCons/Tool/lex.py b/SCons/Tool/lex.py
index 55f7112..60ae4bd 100644
--- a/SCons/Tool/lex.py
+++ b/SCons/Tool/lex.py
@@ -80,17 +80,17 @@ def lexEmitter(target, source, env) -> tuple:
file_name = option[l:].strip()
target.append(file_name)
- lexheaderfile = env.subst("$LEXHEADERFILE", target=target, source=source)
+ lexheaderfile = env.subst("$LEX_HEADER_FILE", target=target, source=source)
if lexheaderfile:
target.append(lexheaderfile)
# rewrite user-supplied file string with a node, we need later
- env.Replace(LEXHEADERFILE=env.File(lexheaderfile))
+ env.Replace(LEX_HEADER_FILE=env.File(lexheaderfile))
- lextablesfile = env.subst("$LEXTABLESFILE", target=target, source=source)
+ lextablesfile = env.subst("$LEX_TABLE_FILE", target=target, source=source)
if lextablesfile:
target.append(lextablesfile)
# rewrite user-supplied file string with a node, we need later
- env.Replace(LEXTABLESFILE=env.File(lextablesfile))
+ env.Replace(LEX_TABLE_FILE=env.File(lextablesfile))
return target, source
@@ -148,18 +148,18 @@ def generate(env) -> None:
env.SetDefault(
LEX=env.Detect(BINS),
LEXFLAGS=CLVar(""),
- LEXHEADERFILE="",
- LEXTABLESFILE="",
+ LEX_HEADER_FILE="",
+ LEX_TABLE_FILE="",
)
if sys.platform == 'win32':
env.SetDefault(LEXUNISTD=CLVar(""))
- env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS $_LEXHEADER $_LEXTABLES -t $SOURCES > $TARGET"
+ env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS $_LEX_HEADER $_LEX_TABLES -t $SOURCES > $TARGET"
else:
- env["LEXCOM"] = "$LEX $LEXFLAGS $_LEXHEADER $_LEXTABLES -t $SOURCES > $TARGET"
+ env["LEXCOM"] = "$LEX $LEXFLAGS $_LEX_HEADER $_LEX_TABLES -t $SOURCES > $TARGET"
- env['_LEXHEADER'] = '${LEXHEADERFILE and "--header-file=" + str(LEXHEADERFILE)}'
- env['_LEXTABLES'] = '${LEXTABLESFILE and "--tables-file=" + str(LEXTABLESFILE)}'
+ env['_LEX_HEADER'] = '${LEX_HEADER_FILE and "--header-file=" + str(LEX_HEADER_FILE)}'
+ env['_LEX_TABLES'] = '${LEX_TABLE_FILE and "--tables-file=" + str(LEX_TABLE_FILE)}'
def exists(env) -> Optional[str]:
diff --git a/SCons/Tool/lex.xml b/SCons/Tool/lex.xml
index 897eb49..e68a2bf 100644
--- a/SCons/Tool/lex.xml
+++ b/SCons/Tool/lex.xml
@@ -60,8 +60,8 @@ Sets construction variables for the &lex; lexical analyser.
<uses>
<item>LEXCOMSTR</item>
<item>LEXFLAGS</item>
-<item>LEXHEADERFILE</item>
-<item>LEXTABLESFILE</item>
+<item>LEX_HEADER_FILE</item>
+<item>LEX_TABLE_FILE</item>
</uses>
</tool>
@@ -113,12 +113,12 @@ the output file is named by the option argument.
Note that files specified by <option>--header-file=</option> and
<option>--tables-file=</option> may not be properly handled
by &SCons; in all situations. Consider using
-&cv-link-LEXHEADERFILE; and &cv-link-LEXTABLESFILE; instead.
+&cv-link-LEX_HEADER_FILE; and &cv-link-LEX_TABLE_FILE; instead.
</para>
</summary>
</cvar>
-<cvar name="LEXHEADERFILE">
+<cvar name="LEX_HEADER_FILE">
<summary>
<para>
If supplied, generate a C header file with the name taken from this variable.
@@ -129,7 +129,7 @@ command-line option. Use this in preference to including
</summary>
</cvar>
-<cvar name="LEXTABLESFILE">
+<cvar name="LEX_TABLE_FILE">
<summary>
<para>
If supplied, write the lex tables to a file with the name
diff --git a/SCons/Tool/yacc.py b/SCons/Tool/yacc.py
index 4bc6415..42ef1db 100644
--- a/SCons/Tool/yacc.py
+++ b/SCons/Tool/yacc.py
@@ -98,17 +98,17 @@ def _yaccEmitter(target, source, env, ysuf, hsuf) -> tuple:
fileName = option[l:].strip()
target.append(fileName)
- yaccheaderfile = env.subst("$YACCHEADERFILE", target=target, source=source)
+ yaccheaderfile = env.subst("$YACC_HEADER_FILE", target=target, source=source)
if yaccheaderfile:
target.append(yaccheaderfile)
# rewrite user-supplied file string with a node, we need later
- env.Replace(YACCHEADERFILE=env.File(yaccheaderfile))
+ env.Replace(YACC_HEADER_FILE=env.File(yaccheaderfile))
- yaccgraphfile = env.subst("$YACCGRAPHFILE", target=target, source=source)
+ yaccgraphfile = env.subst("$YACC_GRAPH_FILE", target=target, source=source)
if yaccgraphfile:
target.append(yaccgraphfile)
# rewrite user-supplied file string with a node, we need later
- env.Replace(YACCGRAPHFILE=env.File(yaccgraphfile))
+ env.Replace(YACC_GRAPH_FILE=env.File(yaccgraphfile))
return target, source
@@ -178,16 +178,16 @@ def generate(env) -> None:
env.SetDefault(
YACC=env.Detect(BINS),
YACCFLAGS=CLVar(""),
- YACCHEADERFILE="",
- YACCGRAPHSFILE="",
+ YACC_HEADER_FILE="",
+ YACC_GRAPH_FILE="",
)
- env['YACCCOM'] = '$YACC $YACCFLAGS $_YACCHEADER $_YACCGRAPH -o $TARGET $SOURCES'
+ env['YACCCOM'] = '$YACC $YACCFLAGS $_YACC_HEADER $_YACC_GRAPH -o $TARGET $SOURCES'
env['YACCHFILESUFFIX'] = '.h'
env['YACCHXXFILESUFFIX'] = '.hpp'
env['YACCVCGFILESUFFIX'] = '.vcg'
- env['_YACCHEADER'] = '${YACCHEADERFILE and "--header=" + str(YACCHEADERFILE)}'
- env['_YACCGRAPH'] = '${YACCGRAPHFILE and "--graph=" + str(YACCGRAPHFILE)}'
+ env['_YACC_HEADER'] = '${YACC_HEADER_FILE and "--header=" + str(YACC_HEADER_FILE)}'
+ env['_YACC_GRAPH'] = '${YACC_GRAPH_FILE and "--graph=" + str(YACC_GRAPH_FILE)}'
def exists(env) -> Optional[str]:
diff --git a/SCons/Tool/yacc.xml b/SCons/Tool/yacc.xml
index f22c673..9ccc4e6 100644
--- a/SCons/Tool/yacc.xml
+++ b/SCons/Tool/yacc.xml
@@ -62,8 +62,8 @@ Sets construction variables for the &yacc; parse generator.
<uses>
<item>YACCCOMSTR</item>
<item>YACCFLAGS</item>
-<item>YACCHEADERFILE</item>
-<item>YACCGRAPHFILE</item>
+<item>YACC_HEADER_FILE</item>
+<item>YACC_GRAPH_FILE</item>
</uses>
</tool>
@@ -146,12 +146,12 @@ but the output filename is named by the option argument.
Note that files specified by <option>--header=</option> and
<option>--graph=</option> may not be properly handled
by &SCons; in all situations. Consider using
-&cv-link-YACCHEADERFILE; and &cv-link-YACCGRAPHFILE; instead.
+&cv-link-YACC_HEADER_FILE; and &cv-link-YACC_GRAPH_FILE; instead.
</para>
</summary>
</cvar>
-<cvar name="YACCHEADERFILE">
+<cvar name="YACC_HEADER_FILE">
<summary>
<para>
If supplied, generate a header file with the name taken from this variable.
@@ -162,7 +162,7 @@ command-line option. Use this in preference to including
</summary>
</cvar>
-<cvar name="YACCGRAPHFILE">
+<cvar name="YACC_GRAPH_FILE">
<summary>
<para>
If supplied, write a graph of the automaton to a file with the name
diff --git a/test/LEX/FLEXFLAGS.py b/test/LEX/FLEXFLAGS.py
index 59e4343..1db9f42 100644
--- a/test/LEX/FLEXFLAGS.py
+++ b/test/LEX/FLEXFLAGS.py
@@ -78,8 +78,8 @@ env = Environment(
env.CFile(
target='aaa',
source='aaa.l',
- LEXHEADERFILE='header.h',
- LEXTABLESFILE='tables.t',
+ LEX_HEADER_FILE='header.h',
+ LEX_TABLE_FILE='tables.t',
)
""")
test.write(['sub2', 'aaa.l'], "aaa.l\nLEXFLAGS\n")
diff --git a/test/YACC/BISONFLAGS.py b/test/YACC/BISONFLAGS.py
index 05a99b3..cae673d 100644
--- a/test/YACC/BISONFLAGS.py
+++ b/test/YACC/BISONFLAGS.py
@@ -84,8 +84,8 @@ env = Environment(
env.CFile(
target='aaa',
source='aaa.y',
- YACCHEADERFILE='header.h',
- YACCGRAPHFILE='graph.g',
+ YACC_HEADER_FILE='header.h',
+ YACC_GRAPH_FILE='graph.g',
)
""" % locals())
test.write(['sub2', 'aaa.y'], "aaa.y\nYACCFLAGS\n")