1 /*
2 * Copyright (c) 2008 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 * */
12 /*
13 * ======== Utils.xdc ========
14 */
15 package xdc.bld
16
17 /*!
18 * ======== Utils ========
19 * Utility functions to simplify creation of targets and platforms
20 */
21 metaonlymodule Utils
22 {
23 /*!
24 * ======== expandString ========
25 * Expand references within a string to specified values
26 *
27 * All references of the form "`$(<name>)`" within the command string,
28 * `cmd` are replaced with the string value having key `<name>` in the
29 * hashtable `values`.
30 *
31 * If `<name>` appears in values and its value is `null` or `undefined`,
32 * then `$(<name>)` is replaced with the empty string. If `<name>` does
33 * not appear in `values`, then `$(<name>)` is not replaced.
34 *
35 * @param(cmd) a string with embeded references to values defined in
36 * the values hashtable parameter
37 * @param(values) an arbitrary hash of name-value pairs; these values
38 * are used to substitute for references of the form
39 * `$(name)` that appear within `cmd`.
40 *
41 * @a(returns) string with references replaced as specified by the
42 * `values` hash.
43 *
44 * @a(throws) `Error` exceptions are thrown for fatal errors
45 */
46 String expandString(String cmd, Any values);
47
48 /*!
49 * ======== expandDbgName ========
50 * Generate name of a debug support output file
51 *
52 * @param(cfgName) the name of the generated configuration script
53 * without the ".cfg" extension
54 * @param(exeName) the name of the output executable
55 * @param(pattern) file name pattern
56 *
57 * Both cfgName and exeName are relative to the directory containing
58 * package.bld.
59 *
60 * @_nodoc this function is an internal method shared between xdc.bld
61 * and xdc.cfg and has little value outside this context.
62 */
63 function expandDbgName(cfgName, exeName, pattern);
64
65 /*!
66 * ======== parsePlatName ========
67 * Parse platform instance name into platform package name and short
68 * instance name
69 *
70 * @param(platInstName) the name of a platform instance
71 *
72 * @a(returns) 73 * returns object with the following fields:
74 * @p(dlist) 75 * - `platPkgName`
76 * name of the platform package name
77 * - `instName`
78 * name of the platform instance
79 * - `instMod`
80 * module object specifying platform instances (if it exists)
81 * @p 82 *
83 * @a(throws) `Error` exceptions are thrown for fatal errors
84 85 * @_nodoc this function is an internal method shared between xdc.bld
86 * and xdc.cfg and has little value outside this context.
87 */
88 function parsePlatName(platInstName);
89
90 /*!
91 * ======== display ========
92 * Recursively print arbitrary object
93 *
94 * @param(msg) a string to print before printing the object
95 * @param(obj) an arbitrary object to display
96 */
97 Void display(String msg, Any obj);
98 }
99 /*
100 * @(#) xdc.bld; 1, 0, 2,340; 6-14-2011 11:49:19; /db/ztree/library/trees/xdc/xdc-x14x/src/packages/
101 */
102