Last change
on this file since 167 was 164, checked in by coas-nagasima, 8 years ago |
TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Id
-
Property svn:mime-type
set to
text/javascript
|
File size:
767 bytes
|
Rev | Line | |
---|
[164] | 1 | var fs = WScript.CreateObject("Scripting.FileSystemObject");
|
---|
| 2 |
|
---|
| 3 | args = WScript.Arguments;
|
---|
| 4 |
|
---|
| 5 | if(args.length >= 2)
|
---|
| 6 | {
|
---|
| 7 | var istrm = fs.OpenTextFile(args(0)); // offset.h
|
---|
| 8 | var ostrm = fs.CreateTextFile(args(1)); // offset.inc
|
---|
| 9 |
|
---|
| 10 | ostrm.WriteLine("; offset.inc");
|
---|
| 11 | ostrm.WriteLine("");
|
---|
| 12 |
|
---|
| 13 | var line;
|
---|
| 14 | var newline;
|
---|
| 15 |
|
---|
| 16 | while(!istrm.AtEndOfStream){
|
---|
| 17 | line = istrm.ReadLine();
|
---|
| 18 |
|
---|
| 19 | re=/\s+$/;
|
---|
| 20 | newline = line.replace(re, "");
|
---|
| 21 | re=/^#define\s+([0-9|a-z|A-Z|_]+)\s+(.+)$/;
|
---|
| 22 | if(newline.search(re) == -1)
|
---|
| 23 | continue;
|
---|
| 24 |
|
---|
| 25 | var value = newline.replace(re, "$2");
|
---|
| 26 | re2=/^0x([0-9A-Fa-f]+)$/;
|
---|
| 27 | if(value.search(re2) != -1)
|
---|
| 28 | value = "0" + value.replace(re2, "$1") + "H";
|
---|
| 29 |
|
---|
| 30 | newline = newline.replace(re, " $1 .equ " + value);
|
---|
| 31 |
|
---|
| 32 | ostrm.WriteLine(newline);
|
---|
| 33 | }
|
---|
| 34 | istrm.Close();
|
---|
| 35 | ostrm.Close();
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.