nsgenjsbind: branch master updated. 3db9b84cd1a23f4718260a6b2487dcedbb7fc526
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/3db9b84cd1a23f471...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/3db9b84cd1a23f47182...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/3db9b84cd1a23f4718260...
The branch, master has been updated
via 3db9b84cd1a23f4718260a6b2487dcedbb7fc526 (commit)
via 24f1407f1f30993ee8dd35d2f52409bcba839a8f (commit)
from c1db25526a6990263e9703634401178975cf9d61 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/3db9b84cd1a23f4...
commit 3db9b84cd1a23f4718260a6b2487dcedbb7fc526
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
move towards having a binding stanza
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
index 8364247..af49db9 100644
--- a/src/genjsbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -33,6 +33,8 @@ multicomment \/\*(([^*])|(\*[^/]))*\*\/
quotedstring [^\"\\\n\r]
+identifier [A-Z_a-z][0-9A-Z_a-z]*
+
other [^\t\n\r 0-9A-Z_a-z]
cblockopen \[\[\[
@@ -45,16 +47,34 @@ cblockclose \]\]\]
{whitespace} /* nothing */
+ /* terminals */
+
webidlfile return TOK_IDLFILE;
hdrcomment return TOK_HDR_COMMENT;
+preamble return TOK_PREAMBLE;
+
+binding return TOK_BINDING;
+
interface return TOK_INTERFACE;
-preamble return TOK_PREAMBLE;
+type return TOK_TYPE;
+
+extra return TOK_EXTRA;
+
+%token <text> TOK_IDENTIFIER
{cblockopen} BEGIN(cblock);
+{identifier} {
+ /* A leading "_" is used to escape an identifier from
+ * looking like a reserved word terminal.
+ */
+ yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
+ return TOK_IDENTIFIER;
+ }
+
\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
{multicomment} /* nothing */
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 8436034..ce8a1fd 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -37,12 +37,19 @@ int genjsbind_wrap()
%token TOK_IDLFILE
%token TOK_HDR_COMMENT
-%token TOK_INTERFACE
%token TOK_PREAMBLE
+%token TOK_BINDING
+%token TOK_INTERFACE
+%token TOK_TYPE
+%token TOK_EXTRA
+
+%token <text> TOK_IDENTIFIER
+
%token <text> TOK_STRING_LITERAL
%token <text> TOK_CCODE_LITERAL
+
%%
/* [1] start with Statements */
@@ -59,7 +66,7 @@ Statement
|
Preamble
|
- Interface
+ Binding
;
/* [3] load a web IDL file */
@@ -73,33 +80,25 @@ IdlFile
;
HdrComment
- : TOK_HDR_COMMENT Strings ';'
+ : TOK_HDR_COMMENT HdrStrings ';'
{
}
;
-Strings
+HdrStrings
:
TOK_STRING_LITERAL
{
genjsbind_header_comment($1);
}
|
- Strings TOK_STRING_LITERAL
+ HdrStrings TOK_STRING_LITERAL
{
genjsbind_header_comment($2);
}
;
-Interface
- :
- TOK_INTERFACE TOK_STRING_LITERAL ';'
- {
- genjsbind_interface($2);
- }
- ;
-
Preamble
:
TOK_PREAMBLE CBlock
@@ -118,4 +117,21 @@ CBlock
}
;
+Binding
+ :
+ TOK_BINDING TOK_IDENTIFIER '{' BindingArgs '}' ';'
+ ;
+
+BindingArgs
+:
+;
+
+Interface
+ :
+ TOK_INTERFACE TOK_STRING_LITERAL ';'
+ {
+ genjsbind_interface($2);
+ }
+ ;
+
%%
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
index 20ee4c5..0a0a5df 100644
--- a/src/webidl-lexer.l
+++ b/src/webidl-lexer.l
@@ -87,7 +87,7 @@ escseq {characterescseq}|0|{hexescseq}|{unicodeescseq}
quotedstring ([^\"\\\n\r]|\\{escseq})
/* web idl identifier direct from spec */
-Identifier [A-Z_a-z][0-9A-Z_a-z]*
+identifier [A-Z_a-z][0-9A-Z_a-z]*
/* web idl other direct from spec */
other [^\t\n\r 0-9A-Z_a-z]
@@ -193,8 +193,9 @@ void return TOK_VOID;
readonly return TOK_READONLY;
-{Identifier} {
- // A leading "_" is used to escape an identifier from looking like a reserved word terminal.
+{identifier} {
+ /* A leading "_" is used to escape an identifier from
+ * looking like a reserved word terminal. */
yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
return TOK_IDENTIFIER;
}
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index 55a8ac7..24699c1 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -51,6 +51,18 @@ static JSBool JSAPI_NATIVE(write, JSContext *cx, uintN argc, jsval *vp)
return JS_TRUE;
}
-]]]
+]]];
-interface "Document";
+binding document {
+ type js_libdom {
+ node dom_document;
+
+ }; /* the binding type and any instance specific extra data */
+
+ extra "struct html_content *htmlc"; /* extra parameters to constructor
+ * value stored in private context
+ * structure.
+ */
+
+ interface Document; /* Web IDL interface to generate */
+};
\ No newline at end of file
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/24f1407f1f30993...
commit 24f1407f1f30993ee8dd35d2f52409bcba839a8f
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
add preamble blocks delinited by [[[ and ]]]
Improve separation of binding file handling
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
index ae458fe..8364247 100644
--- a/src/genjsbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -35,6 +35,12 @@ quotedstring [^\"\\\n\r]
other [^\t\n\r 0-9A-Z_a-z]
+cblockopen \[\[\[
+
+cblockclose \]\]\]
+
+%x cblock
+
%%
{whitespace} /* nothing */
@@ -45,6 +51,10 @@ hdrcomment return TOK_HDR_COMMENT;
interface return TOK_INTERFACE;
+preamble return TOK_PREAMBLE;
+
+{cblockopen} BEGIN(cblock);
+
\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
{multicomment} /* nothing */
@@ -53,4 +63,8 @@ interface return TOK_INTERFACE;
. /* nothing */
+<cblock>[^\]]* yylval->text = strdup(yytext); return TOK_CCODE_LITERAL;
+<cblock>{cblockclose} BEGIN(INITIAL);
+<cblock>\]+ yylval->text = strdup(yytext); return TOK_CCODE_LITERAL;
+
%%
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 48ea1d2..8436034 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -38,10 +38,10 @@ int genjsbind_wrap()
%token TOK_IDLFILE
%token TOK_HDR_COMMENT
%token TOK_INTERFACE
+%token TOK_PREAMBLE
%token <text> TOK_STRING_LITERAL
-
-%type <text> Strings
+%token <text> TOK_CCODE_LITERAL
%%
@@ -52,9 +52,14 @@ Statements
;
Statement
- : IdlFile
- | HdrComment
- | Interface
+ :
+ IdlFile
+ |
+ HdrComment
+ |
+ Preamble
+ |
+ Interface
;
/* [3] load a web IDL file */
@@ -70,32 +75,46 @@ IdlFile
HdrComment
: TOK_HDR_COMMENT Strings ';'
{
- genjsbind_header_comment($2);
+
}
;
Strings
- : TOK_STRING_LITERAL
+ :
+ TOK_STRING_LITERAL
{
- $$ = $1;
+ genjsbind_header_comment($1);
}
- | Strings TOK_STRING_LITERAL
+ |
+ Strings TOK_STRING_LITERAL
{
- char *fullstr;
- int fulllen;
- fulllen = strlen($1) + strlen($2) + 2;
- fullstr = malloc(fulllen);
- snprintf(fullstr, fulllen, "%s\n%s", $1, $2);
- free($1);
- free($2);
- $$ = fullstr;
+ genjsbind_header_comment($2);
}
;
Interface
- : TOK_INTERFACE TOK_STRING_LITERAL ';'
+ :
+ TOK_INTERFACE TOK_STRING_LITERAL ';'
+ {
+ genjsbind_interface($2);
+ }
+ ;
+
+Preamble
+ :
+ TOK_PREAMBLE CBlock
+ ;
+
+CBlock
+ :
+ TOK_CCODE_LITERAL
+ {
+ genjsbind_preamble($1);
+ }
+ |
+ CBlock TOK_CCODE_LITERAL
{
- genjsbind_output_interface($2);
+ genjsbind_preamble($2);
}
;
diff --git a/src/genjsbind.c b/src/genjsbind.c
index fcdc944..6bc84b3 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -6,16 +6,8 @@
#include <getopt.h>
#include <errno.h>
-#include "webidl-ast.h"
-#include "webidl-parser.h"
-#include "genjsbind-parser.h"
#include "jsapi-binding.h"
-#include "genjsbind.h"
-
-extern int genjsbind_debug;
-extern int genjsbind__flex_debug;
-extern void genjsbind_restart(FILE*);
-extern int genjsbind_parse(void);
+#include "options.h"
struct options *options;
@@ -71,7 +63,6 @@ static struct options* process_cmdline(int argc, char **argv)
int main(int argc, char **argv)
{
- FILE *infile;
int res;
options = process_cmdline(argc, argv);
@@ -79,58 +70,25 @@ int main(int argc, char **argv)
return 1; /* bad commandline */
}
- if (options->verbose && (options->outfilename == NULL)) {
- fprintf(stderr, "Error: outputting to stdout with verbose logging would fail\n");
+ if (options->verbose &&
+ (options->outfilename == NULL)) {
+ fprintf(stderr,
+ "Error: output to stdout with verbose logging would fail\n");
return 2;
}
- res = genjsbind_outputopen(options->outfilename);
+ res = genjsbind_parsefile(options->infilename);
if (res != 0) {
+ fprintf(stderr, "Error: parse failed with code %d\n", res);
return res;
}
- /* open input file */
- if ((options->infilename[0] == '-') &&
- (options->infilename[1] == 0)) {
- if (options->verbose) {
- printf("Using stdin for input\n");
- }
- infile = stdin;
- } else {
- if (options->verbose) {
- printf("Opening binding file %s\n", options->infilename);
- }
- infile = fopen(options->infilename, "r");
- }
-
- if (!infile) {
- fprintf(stderr, "Error opening %s: %s\n",
- options->infilename,
- strerror(errno));
- return 3;
- }
-
- if (options->debug) {
- genjsbind_debug = 1;
- genjsbind__flex_debug = 1;
- }
-
- /* set flex to read from file */
- genjsbind_restart(infile);
-
- /* initialise root node */
- webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
-
- /* process binding */
- res = genjsbind_parse();
-
- genjsbind_outputclose();
-
+ res = genjsbind_output(options->outfilename);
if (res != 0) {
- fprintf(stderr, "Error parse failed with code %d\n", res);
+ fprintf(stderr, "Error: output failed with code %d\n", res);
+ unlink(options->outfilename);
return res;
}
-
return 0;
}
diff --git a/src/genjsbind.h b/src/genjsbind.h
deleted file mode 100644
index 47f3c11..0000000
--- a/src/genjsbind.h
+++ /dev/null
@@ -1,10 +0,0 @@
-struct options {
- char *outfilename;
- char *infilename;
- char *idlpath;
- bool verbose;
- bool debug;
-};
-
-extern struct options *options;
-
diff --git a/src/jsapi-binding.c b/src/jsapi-binding.c
index 51a0df7..9f1bc7e 100644
--- a/src/jsapi-binding.c
+++ b/src/jsapi-binding.c
@@ -5,15 +5,114 @@
#include <string.h>
#include "jsapi-binding.h"
+#include "webidl-ast.h"
+#include "options.h"
-#define HDR_COMMENT_PREABLE "/* Generated by nsgenjsapi\n"
+/* parser and lexer interface */
+extern int genjsbind_debug;
+extern int genjsbind__flex_debug;
+extern void genjsbind_restart(FILE*);
+extern int genjsbind_parse(void);
-static FILE *outfile = NULL;
+
+#define HDR_COMMENT_SEP "\n * "
+#define HDR_COMMENT_SEP_LEN 4
+#define HDR_COMMENT_PREABLE "Generated by nsgenjsapi"HDR_COMMENT_SEP
+
+/* current state */
static char *hdr_comments = NULL;
-static bool hdr_comments_output = false;
+static char *preamble = NULL;
+static char *ifname;
+
+int genjsbind_header_comment(char *comment)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(hdr_comments) + strlen(comment) + HDR_COMMENT_SEP_LEN + 1;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s"HDR_COMMENT_SEP"%s", hdr_comments , comment);
+ free(hdr_comments);
+ free(comment);
+ hdr_comments = fullstr;
+
+ return 0;
+}
+
+int genjsbind_preamble(char *ccode)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(preamble) + strlen(ccode) + 1;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s%s", preamble , ccode);
+ free(preamble);
+ free(ccode);
+ preamble = fullstr;
+
+ return 0;
+}
+
+int genjsbind_interface(char *interface)
+{
+ ifname = interface;
+ return 0;
+}
+
+static void init_state(void)
+{
+ /* initialise root node */
+ webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
+
+ /* set default comment header text */
+ hdr_comments = strdup(HDR_COMMENT_PREABLE);
+
+ preamble = strdup("");
+}
+
+int genjsbind_parsefile(char *infilename)
+{
+ FILE *infile;
-int genjsbind_outputopen(char *outfilename)
+ /* open input file */
+ if ((infilename[0] == '-') &&
+ (infilename[1] == 0)) {
+ if (options->verbose) {
+ printf("Using stdin for input\n");
+ }
+ infile = stdin;
+ } else {
+ if (options->verbose) {
+ printf("Opening binding file %s\n", options->infilename);
+ }
+ infile = fopen(infilename, "r");
+ }
+
+ if (!infile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ infilename,
+ strerror(errno));
+ return 3;
+ }
+
+ /* initialise internal state */
+ init_state();
+
+ if (options->debug) {
+ genjsbind_debug = 1;
+ genjsbind__flex_debug = 1;
+ }
+
+ /* set flex to read from file */
+ genjsbind_restart(infile);
+
+ /* process binding */
+ return genjsbind_parse();
+
+}
+
+int genjsbind_output(char *outfilename)
{
+ FILE *outfile = NULL;
/* open output file */
if (outfilename == NULL) {
outfile = stdout;
@@ -28,39 +127,14 @@ int genjsbind_outputopen(char *outfilename)
return 4;
}
- hdr_comments = strdup(HDR_COMMENT_PREABLE);
- return 0;
-}
+ fprintf(outfile, "/* %s\n */\n\n", hdr_comments);
-int genjsbind_outputclose()
-{
- fclose(outfile);
- return 0;
-}
+ fprintf(outfile, "%s", preamble);
-int genjsbind_header_comment(char *comment)
-{
- char *fullstr;
- int fulllen;
- fulllen = strlen(hdr_comments) + strlen(comment) + 2;
- fullstr = malloc(fulllen);
- snprintf(fullstr, fulllen, "%s\n%s", hdr_comments , comment);
- free(hdr_comments);
- free(comment);
- hdr_comments = fullstr;
+ fprintf(outfile, "/* interface %s */\n\n", ifname);
- if (hdr_comments_output) {
- fprintf(stderr, "Warning: adding header comments after output already started\n");
- }
- return 0;
-}
+ fclose(outfile);
-int genjsbind_output_interface(const char *interface)
-{
- if (!hdr_comments_output) {
- fprintf(outfile, "%s\n*/\n\n", hdr_comments);
- hdr_comments_output = true;
- }
- fprintf(outfile, "/* interface %s */\n\n", interface);
return 0;
}
+
diff --git a/src/jsapi-binding.h b/src/jsapi-binding.h
index ac7929c..33f9776 100644
--- a/src/jsapi-binding.h
+++ b/src/jsapi-binding.h
@@ -1,4 +1,5 @@
-int genjsbind_outputopen(char *outfilename);
-int genjsbind_outputclose(void);
+int genjsbind_parsefile(char *infilename);
+int genjsbind_output(char *outfilename);
int genjsbind_header_comment(char *);
-int genjsbind_output_interface(const char *);
+int genjsbind_interface(char *);
+int genjsbind_preamble(char *ccode);
diff --git a/src/options.h b/src/options.h
new file mode 100644
index 0000000..47f3c11
--- /dev/null
+++ b/src/options.h
@@ -0,0 +1,10 @@
+struct options {
+ char *outfilename;
+ char *infilename;
+ char *idlpath;
+ bool verbose;
+ bool debug;
+};
+
+extern struct options *options;
+
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index b300383..95b271d 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -5,7 +5,7 @@
#include <errno.h>
#include "webidl-ast.h"
-#include "genjsbind.h"
+#include "options.h"
extern int webidl_debug;
extern int webidl__flex_debug;
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index d370be0..55a8ac7 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -10,4 +10,47 @@ hdrcomment "multi"
"line"
"comment";
+hdrcomment "IDL http://www.whatwg.org/specs/web-apps/current-work/#the-document-object";
+
+preamble [[[
+
+#include <dom/dom.h>
+
+#include "utils/config.h"
+#include "utils/log.h"
+
+#include "javascript/jsapi.h"
+
+static JSBool JSAPI_NATIVE(write, JSContext *cx, uintN argc, jsval *vp)
+{
+ JSString* u16_txt;
+ char *txt;
+ unsigned long length;
+ struct jsclass_document_priv *document;
+
+ document = JS_GetInstancePrivate(cx, JS_THIS_OBJECT(cx,vp), &JSCLASS_OBJECT, NULL);
+ if (document == NULL) {
+ return JS_FALSE;
+ }
+
+ if (!JS_ConvertArguments(cx, argc, JSAPI_ARGV(cx, vp), "S", &u16_txt)) {
+ return JS_FALSE;
+ }
+
+ JSString_to_char(u16_txt, txt, length);
+
+ LOG(("content %p parser %p writing %s",
+ document->htmlc, document->htmlc->parser, txt));
+ if (document->htmlc->parser != NULL) {
+ dom_hubbub_parser_insert_chunk(document->htmlc->parser, (uint8_t *)txt, length);
+ }
+ JSAPI_SET_RVAL(cx, vp, JSVAL_VOID);
+
+ foo[23] = bar[n +[x]];
+
+ return JS_TRUE;
+}
+
+]]]
+
interface "Document";
-----------------------------------------------------------------------
Summary of changes:
src/genjsbind-lexer.l | 34 ++++++++
src/genjsbind-parser.y | 73 +++++++++++++-----
src/genjsbind.c | 62 +++-------------
src/jsapi-binding.c | 142 ++++++++++++++++++++++++++--------
src/jsapi-binding.h | 7 +-
src/{genjsbind.h => options.h} | 0
src/webidl-ast.c | 2 +-
src/webidl-lexer.l | 7 +-
test/data/bindings/htmldocument.bnd | 57 ++++++++++++++-
9 files changed, 271 insertions(+), 113 deletions(-)
rename src/{genjsbind.h => options.h} (100%)
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
index ae458fe..af49db9 100644
--- a/src/genjsbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -33,18 +33,48 @@ multicomment \/\*(([^*])|(\*[^/]))*\*\/
quotedstring [^\"\\\n\r]
+identifier [A-Z_a-z][0-9A-Z_a-z]*
+
other [^\t\n\r 0-9A-Z_a-z]
+cblockopen \[\[\[
+
+cblockclose \]\]\]
+
+%x cblock
+
%%
{whitespace} /* nothing */
+ /* terminals */
+
webidlfile return TOK_IDLFILE;
hdrcomment return TOK_HDR_COMMENT;
+preamble return TOK_PREAMBLE;
+
+binding return TOK_BINDING;
+
interface return TOK_INTERFACE;
+type return TOK_TYPE;
+
+extra return TOK_EXTRA;
+
+%token <text> TOK_IDENTIFIER
+
+{cblockopen} BEGIN(cblock);
+
+{identifier} {
+ /* A leading "_" is used to escape an identifier from
+ * looking like a reserved word terminal.
+ */
+ yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
+ return TOK_IDENTIFIER;
+ }
+
\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
{multicomment} /* nothing */
@@ -53,4 +83,8 @@ interface return TOK_INTERFACE;
. /* nothing */
+<cblock>[^\]]* yylval->text = strdup(yytext); return TOK_CCODE_LITERAL;
+<cblock>{cblockclose} BEGIN(INITIAL);
+<cblock>\]+ yylval->text = strdup(yytext); return TOK_CCODE_LITERAL;
+
%%
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 48ea1d2..ce8a1fd 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -37,11 +37,18 @@ int genjsbind_wrap()
%token TOK_IDLFILE
%token TOK_HDR_COMMENT
+%token TOK_PREAMBLE
+
+%token TOK_BINDING
%token TOK_INTERFACE
+%token TOK_TYPE
+%token TOK_EXTRA
+
+%token <text> TOK_IDENTIFIER
%token <text> TOK_STRING_LITERAL
+%token <text> TOK_CCODE_LITERAL
-%type <text> Strings
%%
@@ -52,9 +59,14 @@ Statements
;
Statement
- : IdlFile
- | HdrComment
- | Interface
+ :
+ IdlFile
+ |
+ HdrComment
+ |
+ Preamble
+ |
+ Binding
;
/* [3] load a web IDL file */
@@ -68,34 +80,57 @@ IdlFile
;
HdrComment
- : TOK_HDR_COMMENT Strings ';'
+ : TOK_HDR_COMMENT HdrStrings ';'
+ {
+
+ }
+ ;
+
+HdrStrings
+ :
+ TOK_STRING_LITERAL
+ {
+ genjsbind_header_comment($1);
+ }
+ |
+ HdrStrings TOK_STRING_LITERAL
{
genjsbind_header_comment($2);
}
;
-Strings
- : TOK_STRING_LITERAL
+Preamble
+ :
+ TOK_PREAMBLE CBlock
+ ;
+
+CBlock
+ :
+ TOK_CCODE_LITERAL
{
- $$ = $1;
+ genjsbind_preamble($1);
}
- | Strings TOK_STRING_LITERAL
+ |
+ CBlock TOK_CCODE_LITERAL
{
- char *fullstr;
- int fulllen;
- fulllen = strlen($1) + strlen($2) + 2;
- fullstr = malloc(fulllen);
- snprintf(fullstr, fulllen, "%s\n%s", $1, $2);
- free($1);
- free($2);
- $$ = fullstr;
+ genjsbind_preamble($2);
}
;
+Binding
+ :
+ TOK_BINDING TOK_IDENTIFIER '{' BindingArgs '}' ';'
+ ;
+
+BindingArgs
+:
+;
+
Interface
- : TOK_INTERFACE TOK_STRING_LITERAL ';'
+ :
+ TOK_INTERFACE TOK_STRING_LITERAL ';'
{
- genjsbind_output_interface($2);
+ genjsbind_interface($2);
}
;
diff --git a/src/genjsbind.c b/src/genjsbind.c
index fcdc944..6bc84b3 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -6,16 +6,8 @@
#include <getopt.h>
#include <errno.h>
-#include "webidl-ast.h"
-#include "webidl-parser.h"
-#include "genjsbind-parser.h"
#include "jsapi-binding.h"
-#include "genjsbind.h"
-
-extern int genjsbind_debug;
-extern int genjsbind__flex_debug;
-extern void genjsbind_restart(FILE*);
-extern int genjsbind_parse(void);
+#include "options.h"
struct options *options;
@@ -71,7 +63,6 @@ static struct options* process_cmdline(int argc, char **argv)
int main(int argc, char **argv)
{
- FILE *infile;
int res;
options = process_cmdline(argc, argv);
@@ -79,58 +70,25 @@ int main(int argc, char **argv)
return 1; /* bad commandline */
}
- if (options->verbose && (options->outfilename == NULL)) {
- fprintf(stderr, "Error: outputting to stdout with verbose logging would fail\n");
+ if (options->verbose &&
+ (options->outfilename == NULL)) {
+ fprintf(stderr,
+ "Error: output to stdout with verbose logging would fail\n");
return 2;
}
- res = genjsbind_outputopen(options->outfilename);
+ res = genjsbind_parsefile(options->infilename);
if (res != 0) {
+ fprintf(stderr, "Error: parse failed with code %d\n", res);
return res;
}
- /* open input file */
- if ((options->infilename[0] == '-') &&
- (options->infilename[1] == 0)) {
- if (options->verbose) {
- printf("Using stdin for input\n");
- }
- infile = stdin;
- } else {
- if (options->verbose) {
- printf("Opening binding file %s\n", options->infilename);
- }
- infile = fopen(options->infilename, "r");
- }
-
- if (!infile) {
- fprintf(stderr, "Error opening %s: %s\n",
- options->infilename,
- strerror(errno));
- return 3;
- }
-
- if (options->debug) {
- genjsbind_debug = 1;
- genjsbind__flex_debug = 1;
- }
-
- /* set flex to read from file */
- genjsbind_restart(infile);
-
- /* initialise root node */
- webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
-
- /* process binding */
- res = genjsbind_parse();
-
- genjsbind_outputclose();
-
+ res = genjsbind_output(options->outfilename);
if (res != 0) {
- fprintf(stderr, "Error parse failed with code %d\n", res);
+ fprintf(stderr, "Error: output failed with code %d\n", res);
+ unlink(options->outfilename);
return res;
}
-
return 0;
}
diff --git a/src/jsapi-binding.c b/src/jsapi-binding.c
index 51a0df7..9f1bc7e 100644
--- a/src/jsapi-binding.c
+++ b/src/jsapi-binding.c
@@ -5,15 +5,114 @@
#include <string.h>
#include "jsapi-binding.h"
+#include "webidl-ast.h"
+#include "options.h"
-#define HDR_COMMENT_PREABLE "/* Generated by nsgenjsapi\n"
+/* parser and lexer interface */
+extern int genjsbind_debug;
+extern int genjsbind__flex_debug;
+extern void genjsbind_restart(FILE*);
+extern int genjsbind_parse(void);
-static FILE *outfile = NULL;
+
+#define HDR_COMMENT_SEP "\n * "
+#define HDR_COMMENT_SEP_LEN 4
+#define HDR_COMMENT_PREABLE "Generated by nsgenjsapi"HDR_COMMENT_SEP
+
+/* current state */
static char *hdr_comments = NULL;
-static bool hdr_comments_output = false;
+static char *preamble = NULL;
+static char *ifname;
+
+int genjsbind_header_comment(char *comment)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(hdr_comments) + strlen(comment) + HDR_COMMENT_SEP_LEN + 1;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s"HDR_COMMENT_SEP"%s", hdr_comments , comment);
+ free(hdr_comments);
+ free(comment);
+ hdr_comments = fullstr;
+
+ return 0;
+}
+
+int genjsbind_preamble(char *ccode)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(preamble) + strlen(ccode) + 1;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s%s", preamble , ccode);
+ free(preamble);
+ free(ccode);
+ preamble = fullstr;
+
+ return 0;
+}
+
+int genjsbind_interface(char *interface)
+{
+ ifname = interface;
+ return 0;
+}
+
+static void init_state(void)
+{
+ /* initialise root node */
+ webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
+
+ /* set default comment header text */
+ hdr_comments = strdup(HDR_COMMENT_PREABLE);
+
+ preamble = strdup("");
+}
+
+int genjsbind_parsefile(char *infilename)
+{
+ FILE *infile;
-int genjsbind_outputopen(char *outfilename)
+ /* open input file */
+ if ((infilename[0] == '-') &&
+ (infilename[1] == 0)) {
+ if (options->verbose) {
+ printf("Using stdin for input\n");
+ }
+ infile = stdin;
+ } else {
+ if (options->verbose) {
+ printf("Opening binding file %s\n", options->infilename);
+ }
+ infile = fopen(infilename, "r");
+ }
+
+ if (!infile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ infilename,
+ strerror(errno));
+ return 3;
+ }
+
+ /* initialise internal state */
+ init_state();
+
+ if (options->debug) {
+ genjsbind_debug = 1;
+ genjsbind__flex_debug = 1;
+ }
+
+ /* set flex to read from file */
+ genjsbind_restart(infile);
+
+ /* process binding */
+ return genjsbind_parse();
+
+}
+
+int genjsbind_output(char *outfilename)
{
+ FILE *outfile = NULL;
/* open output file */
if (outfilename == NULL) {
outfile = stdout;
@@ -28,39 +127,14 @@ int genjsbind_outputopen(char *outfilename)
return 4;
}
- hdr_comments = strdup(HDR_COMMENT_PREABLE);
- return 0;
-}
+ fprintf(outfile, "/* %s\n */\n\n", hdr_comments);
-int genjsbind_outputclose()
-{
- fclose(outfile);
- return 0;
-}
+ fprintf(outfile, "%s", preamble);
-int genjsbind_header_comment(char *comment)
-{
- char *fullstr;
- int fulllen;
- fulllen = strlen(hdr_comments) + strlen(comment) + 2;
- fullstr = malloc(fulllen);
- snprintf(fullstr, fulllen, "%s\n%s", hdr_comments , comment);
- free(hdr_comments);
- free(comment);
- hdr_comments = fullstr;
+ fprintf(outfile, "/* interface %s */\n\n", ifname);
- if (hdr_comments_output) {
- fprintf(stderr, "Warning: adding header comments after output already started\n");
- }
- return 0;
-}
+ fclose(outfile);
-int genjsbind_output_interface(const char *interface)
-{
- if (!hdr_comments_output) {
- fprintf(outfile, "%s\n*/\n\n", hdr_comments);
- hdr_comments_output = true;
- }
- fprintf(outfile, "/* interface %s */\n\n", interface);
return 0;
}
+
diff --git a/src/jsapi-binding.h b/src/jsapi-binding.h
index ac7929c..33f9776 100644
--- a/src/jsapi-binding.h
+++ b/src/jsapi-binding.h
@@ -1,4 +1,5 @@
-int genjsbind_outputopen(char *outfilename);
-int genjsbind_outputclose(void);
+int genjsbind_parsefile(char *infilename);
+int genjsbind_output(char *outfilename);
int genjsbind_header_comment(char *);
-int genjsbind_output_interface(const char *);
+int genjsbind_interface(char *);
+int genjsbind_preamble(char *ccode);
diff --git a/src/genjsbind.h b/src/options.h
similarity index 100%
rename from src/genjsbind.h
rename to src/options.h
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
index b300383..95b271d 100644
--- a/src/webidl-ast.c
+++ b/src/webidl-ast.c
@@ -5,7 +5,7 @@
#include <errno.h>
#include "webidl-ast.h"
-#include "genjsbind.h"
+#include "options.h"
extern int webidl_debug;
extern int webidl__flex_debug;
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
index 20ee4c5..0a0a5df 100644
--- a/src/webidl-lexer.l
+++ b/src/webidl-lexer.l
@@ -87,7 +87,7 @@ escseq {characterescseq}|0|{hexescseq}|{unicodeescseq}
quotedstring ([^\"\\\n\r]|\\{escseq})
/* web idl identifier direct from spec */
-Identifier [A-Z_a-z][0-9A-Z_a-z]*
+identifier [A-Z_a-z][0-9A-Z_a-z]*
/* web idl other direct from spec */
other [^\t\n\r 0-9A-Z_a-z]
@@ -193,8 +193,9 @@ void return TOK_VOID;
readonly return TOK_READONLY;
-{Identifier} {
- // A leading "_" is used to escape an identifier from looking like a reserved word terminal.
+{identifier} {
+ /* A leading "_" is used to escape an identifier from
+ * looking like a reserved word terminal. */
yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
return TOK_IDENTIFIER;
}
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index d370be0..24699c1 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -10,4 +10,59 @@ hdrcomment "multi"
"line"
"comment";
-interface "Document";
+hdrcomment "IDL http://www.whatwg.org/specs/web-apps/current-work/#the-document-object";
+
+preamble [[[
+
+#include <dom/dom.h>
+
+#include "utils/config.h"
+#include "utils/log.h"
+
+#include "javascript/jsapi.h"
+
+static JSBool JSAPI_NATIVE(write, JSContext *cx, uintN argc, jsval *vp)
+{
+ JSString* u16_txt;
+ char *txt;
+ unsigned long length;
+ struct jsclass_document_priv *document;
+
+ document = JS_GetInstancePrivate(cx, JS_THIS_OBJECT(cx,vp), &JSCLASS_OBJECT, NULL);
+ if (document == NULL) {
+ return JS_FALSE;
+ }
+
+ if (!JS_ConvertArguments(cx, argc, JSAPI_ARGV(cx, vp), "S", &u16_txt)) {
+ return JS_FALSE;
+ }
+
+ JSString_to_char(u16_txt, txt, length);
+
+ LOG(("content %p parser %p writing %s",
+ document->htmlc, document->htmlc->parser, txt));
+ if (document->htmlc->parser != NULL) {
+ dom_hubbub_parser_insert_chunk(document->htmlc->parser, (uint8_t *)txt, length);
+ }
+ JSAPI_SET_RVAL(cx, vp, JSVAL_VOID);
+
+ foo[23] = bar[n +[x]];
+
+ return JS_TRUE;
+}
+
+]]];
+
+binding document {
+ type js_libdom {
+ node dom_document;
+
+ }; /* the binding type and any instance specific extra data */
+
+ extra "struct html_content *htmlc"; /* extra parameters to constructor
+ * value stored in private context
+ * structure.
+ */
+
+ interface Document; /* Web IDL interface to generate */
+};
\ No newline at end of file
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
nsgenjsbind: branch master updated. c1db25526a6990263e9703634401178975cf9d61
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/c1db25526a6990263...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/c1db25526a6990263e9...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/c1db25526a6990263e970...
The branch, master has been updated
via c1db25526a6990263e9703634401178975cf9d61 (commit)
from da234bc3e4e44693a6464140d2dee91a948a6145 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/c1db25526a69902...
commit c1db25526a6990263e9703634401178975cf9d61
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
initial output generation
diff --git a/src/Makefile b/src/Makefile
index e2eb873..62fb23b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g
# Sources in this directory
-DIR_SOURCES := genjsbind.c
+DIR_SOURCES := genjsbind.c webidl-ast.c jsapi-binding.c
SOURCES := $(SOURCES) $(BUILDDIR)/genjsbind-parser.c $(BUILDDIR)/genjsbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
index e976a8f..ae458fe 100644
--- a/src/genjsbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -41,6 +41,10 @@ other [^\t\n\r 0-9A-Z_a-z]
webidlfile return TOK_IDLFILE;
+hdrcomment return TOK_HDR_COMMENT;
+
+interface return TOK_INTERFACE;
+
\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
{multicomment} /* nothing */
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 5c5bed5..48ea1d2 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -10,7 +10,8 @@
#include "genjsbind-parser.h"
#include "genjsbind-lexer.h"
-#include "genjsbind.h"
+#include "webidl-ast.h"
+#include "jsapi-binding.h"
static void genjsbind_error(const char *str)
{
@@ -35,29 +36,67 @@ int genjsbind_wrap()
}
%token TOK_IDLFILE
+%token TOK_HDR_COMMENT
+%token TOK_INTERFACE
-%token <text> TOK_STRING_LITERAL
+%token <text> TOK_STRING_LITERAL
+
+%type <text> Strings
%%
/* [1] start with Statements */
Statements
: Statement
- | Statement Statements
+ | Statements Statement
;
Statement
: IdlFile
+ | HdrComment
+ | Interface
;
/* [3] load a web IDL file */
IdlFile
: TOK_IDLFILE TOK_STRING_LITERAL ';'
{
- if (loadwebidl($2) != 0) {
+ if (webidl_parsefile($2) != 0) {
YYABORT;
}
}
;
+HdrComment
+ : TOK_HDR_COMMENT Strings ';'
+ {
+ genjsbind_header_comment($2);
+ }
+ ;
+
+Strings
+ : TOK_STRING_LITERAL
+ {
+ $$ = $1;
+ }
+ | Strings TOK_STRING_LITERAL
+ {
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen($1) + strlen($2) + 2;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s\n%s", $1, $2);
+ free($1);
+ free($2);
+ $$ = fullstr;
+ }
+ ;
+
+Interface
+ : TOK_INTERFACE TOK_STRING_LITERAL ';'
+ {
+ genjsbind_output_interface($2);
+ }
+ ;
+
%%
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 89d2fb0..fcdc944 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -9,75 +9,16 @@
#include "webidl-ast.h"
#include "webidl-parser.h"
#include "genjsbind-parser.h"
+#include "jsapi-binding.h"
#include "genjsbind.h"
-extern int webidl_debug;
-extern int webidl__flex_debug;
-extern void webidl_restart(FILE*);
-extern int webidl_parse(void);
-
extern int genjsbind_debug;
extern int genjsbind__flex_debug;
extern void genjsbind_restart(FILE*);
extern int genjsbind_parse(void);
-struct options {
- char *outfilename;
- char *infilename;
- char *idlpath;
- bool verbose;
- bool debug;
-};
-
struct options *options;
-static FILE *idlopen(const char *filename)
-{
- FILE *idlfile;
-
- if (options->idlpath == NULL) {
- if (options->verbose) {
- printf("Opening IDL file %s\n", filename);
- }
- idlfile = fopen(filename, "r");
- } else {
- char *fullname;
- int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
- fullname = malloc(fulllen);
- snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
- if (options->verbose) {
- printf("Opening IDL file %s\n", fullname);
- }
- idlfile = fopen(fullname, "r");
- free(fullname);
- }
- return idlfile;
-}
-
-int loadwebidl(char *filename)
-{
- /* set flex to read from file */
- FILE *idlfile;
- idlfile = idlopen(filename);
- if (!idlfile) {
- fprintf(stderr, "Error opening %s: %s\n",
- filename,
- strerror(errno));
- return 2;
- }
-
- if (options->debug) {
- webidl_debug = 1;
- webidl__flex_debug = 1;
- }
-
- webidl_restart(idlfile);
-
- /* parse the file */
- return webidl_parse();
-}
-
-
static struct options* process_cmdline(int argc, char **argv)
{
int opt;
@@ -131,7 +72,7 @@ static struct options* process_cmdline(int argc, char **argv)
int main(int argc, char **argv)
{
FILE *infile;
- int parse_res;
+ int res;
options = process_cmdline(argc, argv);
if (options == NULL) {
@@ -143,6 +84,12 @@ int main(int argc, char **argv)
return 2;
}
+ res = genjsbind_outputopen(options->outfilename);
+ if (res != 0) {
+ return res;
+ }
+
+ /* open input file */
if ((options->infilename[0] == '-') &&
(options->infilename[1] == 0)) {
if (options->verbose) {
@@ -170,11 +117,20 @@ int main(int argc, char **argv)
/* set flex to read from file */
genjsbind_restart(infile);
-
- parse_res = genjsbind_parse();
- if (parse_res) {
- fprintf(stderr, "parse result was %d\n", parse_res);
- return parse_res;
+
+ /* initialise root node */
+ webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
+
+ /* process binding */
+ res = genjsbind_parse();
+
+ genjsbind_outputclose();
+
+ if (res != 0) {
+ fprintf(stderr, "Error parse failed with code %d\n", res);
+ return res;
}
+
+
return 0;
}
diff --git a/src/genjsbind.h b/src/genjsbind.h
index 69d2f59..47f3c11 100644
--- a/src/genjsbind.h
+++ b/src/genjsbind.h
@@ -1 +1,10 @@
-extern int loadwebidl(char *filename);
+struct options {
+ char *outfilename;
+ char *infilename;
+ char *idlpath;
+ bool verbose;
+ bool debug;
+};
+
+extern struct options *options;
+
diff --git a/src/jsapi-binding.c b/src/jsapi-binding.c
new file mode 100644
index 0000000..51a0df7
--- /dev/null
+++ b/src/jsapi-binding.c
@@ -0,0 +1,66 @@
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include "jsapi-binding.h"
+
+#define HDR_COMMENT_PREABLE "/* Generated by nsgenjsapi\n"
+
+static FILE *outfile = NULL;
+static char *hdr_comments = NULL;
+static bool hdr_comments_output = false;
+
+int genjsbind_outputopen(char *outfilename)
+{
+ /* open output file */
+ if (outfilename == NULL) {
+ outfile = stdout;
+ } else {
+ outfile = fopen(outfilename, "w");
+ }
+
+ if (!outfile) {
+ fprintf(stderr, "Error opening output %s: %s\n",
+ outfilename,
+ strerror(errno));
+ return 4;
+ }
+
+ hdr_comments = strdup(HDR_COMMENT_PREABLE);
+ return 0;
+}
+
+int genjsbind_outputclose()
+{
+ fclose(outfile);
+ return 0;
+}
+
+int genjsbind_header_comment(char *comment)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(hdr_comments) + strlen(comment) + 2;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s\n%s", hdr_comments , comment);
+ free(hdr_comments);
+ free(comment);
+ hdr_comments = fullstr;
+
+ if (hdr_comments_output) {
+ fprintf(stderr, "Warning: adding header comments after output already started\n");
+ }
+ return 0;
+}
+
+int genjsbind_output_interface(const char *interface)
+{
+ if (!hdr_comments_output) {
+ fprintf(outfile, "%s\n*/\n\n", hdr_comments);
+ hdr_comments_output = true;
+ }
+ fprintf(outfile, "/* interface %s */\n\n", interface);
+ return 0;
+}
diff --git a/src/jsapi-binding.h b/src/jsapi-binding.h
new file mode 100644
index 0000000..ac7929c
--- /dev/null
+++ b/src/jsapi-binding.h
@@ -0,0 +1,4 @@
+int genjsbind_outputopen(char *outfilename);
+int genjsbind_outputclose(void);
+int genjsbind_header_comment(char *);
+int genjsbind_output_interface(const char *);
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
new file mode 100644
index 0000000..b300383
--- /dev/null
+++ b/src/webidl-ast.c
@@ -0,0 +1,71 @@
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "webidl-ast.h"
+#include "genjsbind.h"
+
+extern int webidl_debug;
+extern int webidl__flex_debug;
+extern void webidl_restart(FILE*);
+extern int webidl_parse(void);
+
+struct webidl_node *webidl_root;
+
+struct webidl_node *webidl_new_node(enum webidl_node_type type)
+{
+ struct webidl_node *nnode;
+ nnode = calloc(1, sizeof(struct webidl_node));
+ if (nnode != NULL) {
+ nnode->type = type;
+ }
+ return nnode;
+}
+
+static FILE *idlopen(const char *filename)
+{
+ FILE *idlfile;
+
+ if (options->idlpath == NULL) {
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", filename);
+ }
+ idlfile = fopen(filename, "r");
+ } else {
+ char *fullname;
+ int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
+ fullname = malloc(fulllen);
+ snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", fullname);
+ }
+ idlfile = fopen(fullname, "r");
+ free(fullname);
+ }
+ return idlfile;
+}
+
+int webidl_parsefile(char *filename)
+{
+ /* set flex to read from file */
+ FILE *idlfile;
+ idlfile = idlopen(filename);
+ if (!idlfile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ filename,
+ strerror(errno));
+ return 2;
+ }
+
+ if (options->debug) {
+ webidl_debug = 1;
+ webidl__flex_debug = 1;
+ }
+
+ webidl_restart(idlfile);
+
+ /* parse the file */
+ return webidl_parse();
+}
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index f56c5d9..f49268a 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -1,4 +1,30 @@
+enum webidl_node_type {
+ WEBIDL_NODE_TYPE_ROOT,
+ WEBIDL_NODE_TYPE_INTERFACE,
+};
+
+struct webidl_ifmember {
+ char *name;
+};
-struct ifmembers_s {
+struct webidl_if {
char *name;
+ struct webidl_ifmember* members;
};
+
+
+struct webidl_node {
+ enum webidl_node_type type;
+ union {
+ struct webidl_node *nodes;
+ struct webidl_if interface;
+ } data;
+};
+
+
+extern struct webidl_node *webidl_root;
+
+/** parse web idl file */
+int webidl_parsefile(char *filename);
+
+struct webidl_node *webidl_new_node(enum webidl_node_type type);
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index e531d05..d370be0 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -5,3 +5,9 @@ webidlfile "node.idl";
webidlfile "document.idl";
webidlfile "htmldocument.idl";
+hdrcomment "Part of NetSurf Project";
+hdrcomment "multi"
+ "line"
+ "comment";
+
+interface "Document";
-----------------------------------------------------------------------
Summary of changes:
src/Makefile | 2 +-
src/genjsbind-lexer.l | 4 ++
src/genjsbind-parser.y | 47 +++++++++++++++++--
src/genjsbind.c | 88 +++++++++--------------------------
src/genjsbind.h | 11 ++++-
src/jsapi-binding.c | 66 ++++++++++++++++++++++++++
src/jsapi-binding.h | 4 ++
src/webidl-ast.c | 71 ++++++++++++++++++++++++++++
src/webidl-ast.h | 28 +++++++++++-
test/data/bindings/htmldocument.bnd | 6 ++
10 files changed, 254 insertions(+), 73 deletions(-)
create mode 100644 src/jsapi-binding.c
create mode 100644 src/jsapi-binding.h
create mode 100644 src/webidl-ast.c
diff --git a/src/Makefile b/src/Makefile
index e2eb873..62fb23b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g
# Sources in this directory
-DIR_SOURCES := genjsbind.c
+DIR_SOURCES := genjsbind.c webidl-ast.c jsapi-binding.c
SOURCES := $(SOURCES) $(BUILDDIR)/genjsbind-parser.c $(BUILDDIR)/genjsbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
index e976a8f..ae458fe 100644
--- a/src/genjsbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -41,6 +41,10 @@ other [^\t\n\r 0-9A-Z_a-z]
webidlfile return TOK_IDLFILE;
+hdrcomment return TOK_HDR_COMMENT;
+
+interface return TOK_INTERFACE;
+
\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
{multicomment} /* nothing */
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 5c5bed5..48ea1d2 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -10,7 +10,8 @@
#include "genjsbind-parser.h"
#include "genjsbind-lexer.h"
-#include "genjsbind.h"
+#include "webidl-ast.h"
+#include "jsapi-binding.h"
static void genjsbind_error(const char *str)
{
@@ -35,29 +36,67 @@ int genjsbind_wrap()
}
%token TOK_IDLFILE
+%token TOK_HDR_COMMENT
+%token TOK_INTERFACE
-%token <text> TOK_STRING_LITERAL
+%token <text> TOK_STRING_LITERAL
+
+%type <text> Strings
%%
/* [1] start with Statements */
Statements
: Statement
- | Statement Statements
+ | Statements Statement
;
Statement
: IdlFile
+ | HdrComment
+ | Interface
;
/* [3] load a web IDL file */
IdlFile
: TOK_IDLFILE TOK_STRING_LITERAL ';'
{
- if (loadwebidl($2) != 0) {
+ if (webidl_parsefile($2) != 0) {
YYABORT;
}
}
;
+HdrComment
+ : TOK_HDR_COMMENT Strings ';'
+ {
+ genjsbind_header_comment($2);
+ }
+ ;
+
+Strings
+ : TOK_STRING_LITERAL
+ {
+ $$ = $1;
+ }
+ | Strings TOK_STRING_LITERAL
+ {
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen($1) + strlen($2) + 2;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s\n%s", $1, $2);
+ free($1);
+ free($2);
+ $$ = fullstr;
+ }
+ ;
+
+Interface
+ : TOK_INTERFACE TOK_STRING_LITERAL ';'
+ {
+ genjsbind_output_interface($2);
+ }
+ ;
+
%%
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 89d2fb0..fcdc944 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -9,75 +9,16 @@
#include "webidl-ast.h"
#include "webidl-parser.h"
#include "genjsbind-parser.h"
+#include "jsapi-binding.h"
#include "genjsbind.h"
-extern int webidl_debug;
-extern int webidl__flex_debug;
-extern void webidl_restart(FILE*);
-extern int webidl_parse(void);
-
extern int genjsbind_debug;
extern int genjsbind__flex_debug;
extern void genjsbind_restart(FILE*);
extern int genjsbind_parse(void);
-struct options {
- char *outfilename;
- char *infilename;
- char *idlpath;
- bool verbose;
- bool debug;
-};
-
struct options *options;
-static FILE *idlopen(const char *filename)
-{
- FILE *idlfile;
-
- if (options->idlpath == NULL) {
- if (options->verbose) {
- printf("Opening IDL file %s\n", filename);
- }
- idlfile = fopen(filename, "r");
- } else {
- char *fullname;
- int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
- fullname = malloc(fulllen);
- snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
- if (options->verbose) {
- printf("Opening IDL file %s\n", fullname);
- }
- idlfile = fopen(fullname, "r");
- free(fullname);
- }
- return idlfile;
-}
-
-int loadwebidl(char *filename)
-{
- /* set flex to read from file */
- FILE *idlfile;
- idlfile = idlopen(filename);
- if (!idlfile) {
- fprintf(stderr, "Error opening %s: %s\n",
- filename,
- strerror(errno));
- return 2;
- }
-
- if (options->debug) {
- webidl_debug = 1;
- webidl__flex_debug = 1;
- }
-
- webidl_restart(idlfile);
-
- /* parse the file */
- return webidl_parse();
-}
-
-
static struct options* process_cmdline(int argc, char **argv)
{
int opt;
@@ -131,7 +72,7 @@ static struct options* process_cmdline(int argc, char **argv)
int main(int argc, char **argv)
{
FILE *infile;
- int parse_res;
+ int res;
options = process_cmdline(argc, argv);
if (options == NULL) {
@@ -143,6 +84,12 @@ int main(int argc, char **argv)
return 2;
}
+ res = genjsbind_outputopen(options->outfilename);
+ if (res != 0) {
+ return res;
+ }
+
+ /* open input file */
if ((options->infilename[0] == '-') &&
(options->infilename[1] == 0)) {
if (options->verbose) {
@@ -170,11 +117,20 @@ int main(int argc, char **argv)
/* set flex to read from file */
genjsbind_restart(infile);
-
- parse_res = genjsbind_parse();
- if (parse_res) {
- fprintf(stderr, "parse result was %d\n", parse_res);
- return parse_res;
+
+ /* initialise root node */
+ webidl_root = webidl_new_node(WEBIDL_NODE_TYPE_ROOT);
+
+ /* process binding */
+ res = genjsbind_parse();
+
+ genjsbind_outputclose();
+
+ if (res != 0) {
+ fprintf(stderr, "Error parse failed with code %d\n", res);
+ return res;
}
+
+
return 0;
}
diff --git a/src/genjsbind.h b/src/genjsbind.h
index 69d2f59..47f3c11 100644
--- a/src/genjsbind.h
+++ b/src/genjsbind.h
@@ -1 +1,10 @@
-extern int loadwebidl(char *filename);
+struct options {
+ char *outfilename;
+ char *infilename;
+ char *idlpath;
+ bool verbose;
+ bool debug;
+};
+
+extern struct options *options;
+
diff --git a/src/jsapi-binding.c b/src/jsapi-binding.c
new file mode 100644
index 0000000..51a0df7
--- /dev/null
+++ b/src/jsapi-binding.c
@@ -0,0 +1,66 @@
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include "jsapi-binding.h"
+
+#define HDR_COMMENT_PREABLE "/* Generated by nsgenjsapi\n"
+
+static FILE *outfile = NULL;
+static char *hdr_comments = NULL;
+static bool hdr_comments_output = false;
+
+int genjsbind_outputopen(char *outfilename)
+{
+ /* open output file */
+ if (outfilename == NULL) {
+ outfile = stdout;
+ } else {
+ outfile = fopen(outfilename, "w");
+ }
+
+ if (!outfile) {
+ fprintf(stderr, "Error opening output %s: %s\n",
+ outfilename,
+ strerror(errno));
+ return 4;
+ }
+
+ hdr_comments = strdup(HDR_COMMENT_PREABLE);
+ return 0;
+}
+
+int genjsbind_outputclose()
+{
+ fclose(outfile);
+ return 0;
+}
+
+int genjsbind_header_comment(char *comment)
+{
+ char *fullstr;
+ int fulllen;
+ fulllen = strlen(hdr_comments) + strlen(comment) + 2;
+ fullstr = malloc(fulllen);
+ snprintf(fullstr, fulllen, "%s\n%s", hdr_comments , comment);
+ free(hdr_comments);
+ free(comment);
+ hdr_comments = fullstr;
+
+ if (hdr_comments_output) {
+ fprintf(stderr, "Warning: adding header comments after output already started\n");
+ }
+ return 0;
+}
+
+int genjsbind_output_interface(const char *interface)
+{
+ if (!hdr_comments_output) {
+ fprintf(outfile, "%s\n*/\n\n", hdr_comments);
+ hdr_comments_output = true;
+ }
+ fprintf(outfile, "/* interface %s */\n\n", interface);
+ return 0;
+}
diff --git a/src/jsapi-binding.h b/src/jsapi-binding.h
new file mode 100644
index 0000000..ac7929c
--- /dev/null
+++ b/src/jsapi-binding.h
@@ -0,0 +1,4 @@
+int genjsbind_outputopen(char *outfilename);
+int genjsbind_outputclose(void);
+int genjsbind_header_comment(char *);
+int genjsbind_output_interface(const char *);
diff --git a/src/webidl-ast.c b/src/webidl-ast.c
new file mode 100644
index 0000000..b300383
--- /dev/null
+++ b/src/webidl-ast.c
@@ -0,0 +1,71 @@
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "webidl-ast.h"
+#include "genjsbind.h"
+
+extern int webidl_debug;
+extern int webidl__flex_debug;
+extern void webidl_restart(FILE*);
+extern int webidl_parse(void);
+
+struct webidl_node *webidl_root;
+
+struct webidl_node *webidl_new_node(enum webidl_node_type type)
+{
+ struct webidl_node *nnode;
+ nnode = calloc(1, sizeof(struct webidl_node));
+ if (nnode != NULL) {
+ nnode->type = type;
+ }
+ return nnode;
+}
+
+static FILE *idlopen(const char *filename)
+{
+ FILE *idlfile;
+
+ if (options->idlpath == NULL) {
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", filename);
+ }
+ idlfile = fopen(filename, "r");
+ } else {
+ char *fullname;
+ int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
+ fullname = malloc(fulllen);
+ snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", fullname);
+ }
+ idlfile = fopen(fullname, "r");
+ free(fullname);
+ }
+ return idlfile;
+}
+
+int webidl_parsefile(char *filename)
+{
+ /* set flex to read from file */
+ FILE *idlfile;
+ idlfile = idlopen(filename);
+ if (!idlfile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ filename,
+ strerror(errno));
+ return 2;
+ }
+
+ if (options->debug) {
+ webidl_debug = 1;
+ webidl__flex_debug = 1;
+ }
+
+ webidl_restart(idlfile);
+
+ /* parse the file */
+ return webidl_parse();
+}
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index f56c5d9..f49268a 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -1,4 +1,30 @@
+enum webidl_node_type {
+ WEBIDL_NODE_TYPE_ROOT,
+ WEBIDL_NODE_TYPE_INTERFACE,
+};
+
+struct webidl_ifmember {
+ char *name;
+};
-struct ifmembers_s {
+struct webidl_if {
char *name;
+ struct webidl_ifmember* members;
};
+
+
+struct webidl_node {
+ enum webidl_node_type type;
+ union {
+ struct webidl_node *nodes;
+ struct webidl_if interface;
+ } data;
+};
+
+
+extern struct webidl_node *webidl_root;
+
+/** parse web idl file */
+int webidl_parsefile(char *filename);
+
+struct webidl_node *webidl_new_node(enum webidl_node_type type);
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index e531d05..d370be0 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -5,3 +5,9 @@ webidlfile "node.idl";
webidlfile "document.idl";
webidlfile "htmldocument.idl";
+hdrcomment "Part of NetSurf Project";
+hdrcomment "multi"
+ "line"
+ "comment";
+
+interface "Document";
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
nsgenjsbind: branch master updated. da234bc3e4e44693a6464140d2dee91a948a6145
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/da234bc3e4e44693a...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/da234bc3e4e44693a64...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/da234bc3e4e44693a6464...
The branch, master has been updated
via da234bc3e4e44693a6464140d2dee91a948a6145 (commit)
from 26dc8906aeb0783cf36bde31e9051b29a193eb23 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/da234bc3e4e4469...
commit da234bc3e4e44693a6464140d2dee91a948a6145
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
set lexers input properly
add node idl file
diff --git a/src/Makefile b/src/Makefile
index 6740140..e2eb873 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
+CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g
# Sources in this directory
DIR_SOURCES := genjsbind.c
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 08b8926..5c5bed5 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -41,15 +41,18 @@ int genjsbind_wrap()
%%
/* [1] start with Statements */
-Statements:
- /* empty */
- |
- IdlFile
+Statements
+ : Statement
+ | Statement Statements
;
- /* [2] load a web IDL file */
-IdlFile:
- TOK_IDLFILE TOK_STRING_LITERAL ';'
+Statement
+ : IdlFile
+ ;
+
+ /* [3] load a web IDL file */
+IdlFile
+ : TOK_IDLFILE TOK_STRING_LITERAL ';'
{
if (loadwebidl($2) != 0) {
YYABORT;
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 145c16e..89d2fb0 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -13,12 +13,12 @@
extern int webidl_debug;
extern int webidl__flex_debug;
-extern FILE* webidl_in;
+extern void webidl_restart(FILE*);
extern int webidl_parse(void);
extern int genjsbind_debug;
extern int genjsbind__flex_debug;
-extern FILE* genjsbind_in;
+extern void genjsbind_restart(FILE*);
extern int genjsbind_parse(void);
struct options {
@@ -57,8 +57,9 @@ static FILE *idlopen(const char *filename)
int loadwebidl(char *filename)
{
/* set flex to read from file */
- webidl_in = idlopen(filename);
- if (!webidl_in) {
+ FILE *idlfile;
+ idlfile = idlopen(filename);
+ if (!idlfile) {
fprintf(stderr, "Error opening %s: %s\n",
filename,
strerror(errno));
@@ -69,6 +70,8 @@ int loadwebidl(char *filename)
webidl_debug = 1;
webidl__flex_debug = 1;
}
+
+ webidl_restart(idlfile);
/* parse the file */
return webidl_parse();
@@ -160,13 +163,13 @@ int main(int argc, char **argv)
return 3;
}
- /* set flex to read from file */
- genjsbind_in = infile;
-
if (options->debug) {
genjsbind_debug = 1;
genjsbind__flex_debug = 1;
}
+
+ /* set flex to read from file */
+ genjsbind_restart(infile);
parse_res = genjsbind_parse();
if (parse_res) {
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index 4f3095f..e531d05 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -1,4 +1,7 @@
-/* test binding docuemnt */
+/* test binding to generate htmldocument */
+webidlfile "eventtarget.idl";
+webidlfile "node.idl";
+webidlfile "document.idl";
webidlfile "htmldocument.idl";
diff --git a/test/data/idl/node.idl b/test/data/idl/node.idl
new file mode 100644
index 0000000..674d08d
--- /dev/null
+++ b/test/data/idl/node.idl
@@ -0,0 +1,53 @@
+interface Node : EventTarget {
+ const unsigned short ELEMENT_NODE = 1;
+ const unsigned short ATTRIBUTE_NODE = 2; // historical
+ const unsigned short TEXT_NODE = 3;
+ const unsigned short CDATA_SECTION_NODE = 4; // historical
+ const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
+ const unsigned short ENTITY_NODE = 6; // historical
+ const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
+ const unsigned short COMMENT_NODE = 8;
+ const unsigned short DOCUMENT_NODE = 9;
+ const unsigned short DOCUMENT_TYPE_NODE = 10;
+ const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
+ const unsigned short NOTATION_NODE = 12; // historical
+ readonly attribute unsigned short nodeType;
+ readonly attribute DOMString nodeName;
+
+ readonly attribute DOMString? baseURI;
+
+ readonly attribute Document? ownerDocument;
+ readonly attribute Node? parentNode;
+ readonly attribute Element? parentElement;
+ boolean hasChildNodes();
+ readonly attribute NodeList childNodes;
+ readonly attribute Node? firstChild;
+ readonly attribute Node? lastChild;
+ readonly attribute Node? previousSibling;
+ readonly attribute Node? nextSibling;
+
+ const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
+ const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
+ const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
+ const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
+ const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+ const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
+ unsigned short compareDocumentPosition(Node other);
+ boolean contains(Node? other);
+
+ attribute DOMString? nodeValue;
+ attribute DOMString? textContent;
+ Node insertBefore(Node node, Node? child);
+ Node appendChild(Node node);
+ Node replaceChild(Node node, Node child);
+ Node removeChild(Node child);
+ void normalize();
+
+
+ Node cloneNode(optional boolean deep = true);
+ boolean isEqualNode(Node? node);
+
+ DOMString lookupPrefix(DOMString? namespace);
+ DOMString lookupNamespaceURI(DOMString? prefix);
+ boolean isDefaultNamespace(DOMString? namespace);
+};
-----------------------------------------------------------------------
Summary of changes:
src/Makefile | 2 +-
src/genjsbind-parser.y | 17 ++++++----
src/genjsbind.c | 17 ++++++----
test/data/bindings/htmldocument.bnd | 5 ++-
test/data/idl/node.idl | 53 +++++++++++++++++++++++++++++++++++
5 files changed, 78 insertions(+), 16 deletions(-)
create mode 100644 test/data/idl/node.idl
diff --git a/src/Makefile b/src/Makefile
index 6740140..e2eb873 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
+CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/ -g
# Sources in this directory
DIR_SOURCES := genjsbind.c
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
index 08b8926..5c5bed5 100644
--- a/src/genjsbind-parser.y
+++ b/src/genjsbind-parser.y
@@ -41,15 +41,18 @@ int genjsbind_wrap()
%%
/* [1] start with Statements */
-Statements:
- /* empty */
- |
- IdlFile
+Statements
+ : Statement
+ | Statement Statements
;
- /* [2] load a web IDL file */
-IdlFile:
- TOK_IDLFILE TOK_STRING_LITERAL ';'
+Statement
+ : IdlFile
+ ;
+
+ /* [3] load a web IDL file */
+IdlFile
+ : TOK_IDLFILE TOK_STRING_LITERAL ';'
{
if (loadwebidl($2) != 0) {
YYABORT;
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 145c16e..89d2fb0 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -13,12 +13,12 @@
extern int webidl_debug;
extern int webidl__flex_debug;
-extern FILE* webidl_in;
+extern void webidl_restart(FILE*);
extern int webidl_parse(void);
extern int genjsbind_debug;
extern int genjsbind__flex_debug;
-extern FILE* genjsbind_in;
+extern void genjsbind_restart(FILE*);
extern int genjsbind_parse(void);
struct options {
@@ -57,8 +57,9 @@ static FILE *idlopen(const char *filename)
int loadwebidl(char *filename)
{
/* set flex to read from file */
- webidl_in = idlopen(filename);
- if (!webidl_in) {
+ FILE *idlfile;
+ idlfile = idlopen(filename);
+ if (!idlfile) {
fprintf(stderr, "Error opening %s: %s\n",
filename,
strerror(errno));
@@ -69,6 +70,8 @@ int loadwebidl(char *filename)
webidl_debug = 1;
webidl__flex_debug = 1;
}
+
+ webidl_restart(idlfile);
/* parse the file */
return webidl_parse();
@@ -160,13 +163,13 @@ int main(int argc, char **argv)
return 3;
}
- /* set flex to read from file */
- genjsbind_in = infile;
-
if (options->debug) {
genjsbind_debug = 1;
genjsbind__flex_debug = 1;
}
+
+ /* set flex to read from file */
+ genjsbind_restart(infile);
parse_res = genjsbind_parse();
if (parse_res) {
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
index 4f3095f..e531d05 100644
--- a/test/data/bindings/htmldocument.bnd
+++ b/test/data/bindings/htmldocument.bnd
@@ -1,4 +1,7 @@
-/* test binding docuemnt */
+/* test binding to generate htmldocument */
+webidlfile "eventtarget.idl";
+webidlfile "node.idl";
+webidlfile "document.idl";
webidlfile "htmldocument.idl";
diff --git a/test/data/idl/node.idl b/test/data/idl/node.idl
new file mode 100644
index 0000000..674d08d
--- /dev/null
+++ b/test/data/idl/node.idl
@@ -0,0 +1,53 @@
+interface Node : EventTarget {
+ const unsigned short ELEMENT_NODE = 1;
+ const unsigned short ATTRIBUTE_NODE = 2; // historical
+ const unsigned short TEXT_NODE = 3;
+ const unsigned short CDATA_SECTION_NODE = 4; // historical
+ const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
+ const unsigned short ENTITY_NODE = 6; // historical
+ const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
+ const unsigned short COMMENT_NODE = 8;
+ const unsigned short DOCUMENT_NODE = 9;
+ const unsigned short DOCUMENT_TYPE_NODE = 10;
+ const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
+ const unsigned short NOTATION_NODE = 12; // historical
+ readonly attribute unsigned short nodeType;
+ readonly attribute DOMString nodeName;
+
+ readonly attribute DOMString? baseURI;
+
+ readonly attribute Document? ownerDocument;
+ readonly attribute Node? parentNode;
+ readonly attribute Element? parentElement;
+ boolean hasChildNodes();
+ readonly attribute NodeList childNodes;
+ readonly attribute Node? firstChild;
+ readonly attribute Node? lastChild;
+ readonly attribute Node? previousSibling;
+ readonly attribute Node? nextSibling;
+
+ const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
+ const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
+ const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
+ const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
+ const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+ const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
+ unsigned short compareDocumentPosition(Node other);
+ boolean contains(Node? other);
+
+ attribute DOMString? nodeValue;
+ attribute DOMString? textContent;
+ Node insertBefore(Node node, Node? child);
+ Node appendChild(Node node);
+ Node replaceChild(Node node, Node child);
+ Node removeChild(Node child);
+ void normalize();
+
+
+ Node cloneNode(optional boolean deep = true);
+ boolean isEqualNode(Node? node);
+
+ DOMString lookupPrefix(DOMString? namespace);
+ DOMString lookupNamespaceURI(DOMString? prefix);
+ boolean isDefaultNamespace(DOMString? namespace);
+};
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
nsgenjsbind: branch master updated. 26dc8906aeb0783cf36bde31e9051b29a193eb23
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/26dc8906aeb0783cf...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/26dc8906aeb0783cf36...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/26dc8906aeb0783cf36bd...
The branch, master has been updated
via 26dc8906aeb0783cf36bde31e9051b29a193eb23 (commit)
from 1c7bc7e17ace1e457c4c0336353f142aef36d254 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/26dc8906aeb0783...
commit 26dc8906aeb0783cf36bde31e9051b29a193eb23
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
make tests work
add basic commandlien handling
diff --git a/Makefile b/Makefile
index eab056a..decc5ce 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,29 @@ PREFIX ?= /opt/netsurf
NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
include $(NSSHARED)/makefiles/Makefile.tools
+TESTRUNNER := test/testrunner.sh
+
+# Toolchain flags
+WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -pedantic
+# BeOS/Haiku/AmigaOS have standard library errors that issue warnings.
+ifneq ($(TARGET),beos)
+ ifneq ($(TARGET),amiga)
+# WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+endif
+CFLAGS := -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -I$(CURDIR)/include/ \
+ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+else
+ # __inline__ is a GCCism
+ CFLAGS := $(CFLAGS) -Dinline="__inline__"
+endif
+
# Grab the core makefile
include $(NSBUILD)/Makefile.top
# Add extra install rules for our pkg-config control file and the library itself
-#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /bin:$(BUILDDIR)/$(COMPONENT)$(EXEEXT)
diff --git a/README b/README
new file mode 100644
index 0000000..70d224f
--- /dev/null
+++ b/README
@@ -0,0 +1,10 @@
+genjsbind
+=========
+
+This is a tool to generate javascript to dom bindings from w3c webidl
+files and a binding configuration file.
+
+building
+--------
+
+The tool requires bison and flex as pre-requisites
\ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
index 232a7dd..6740140 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,7 @@ CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
# Sources in this directory
DIR_SOURCES := genjsbind.c
-SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
+SOURCES := $(SOURCES) $(BUILDDIR)/genjsbind-parser.c $(BUILDDIR)/genjsbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
@@ -31,7 +31,7 @@ endif
$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
$(VQ)$(ECHO) " BISON: $<"
- $(Q)bison -d -t $(BISON_DEFINES) --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
+ $(Q)bison -d -t $(BISON_DEFINES) --report=all --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
# Grab the core makefile
include $(NSBUILD)/Makefile.subdir
diff --git a/src/genbind-lexer.l b/src/genbind-lexer.l
deleted file mode 100644
index 6150f09..0000000
--- a/src/genbind-lexer.l
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * binding generator lexer
- */
-
-/* lexer options */
-%option never-interactive
-%option bison-bridge
-%option nodefault
-%option warn
-%option debug
-%option prefix="genbind_"
-%option nounput
-
-/* header block */
-%{
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "genbind-parser.h"
-
-%}
-
- /* other Unicode “space separator” */
-USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
-
-/* non breaking space \u00A0 */
-NBSP (\xc2\xa0)
-
-whitespace ([ \t\v\f\n]|{NBSP}|{USP})
-
-multicomment \/\*(([^*])|(\*[^/]))*\*\/
-
-quotedstring [^\"\\\n\r]
-
-other [^\t\n\r 0-9A-Z_a-z]
-
-%%
-
-{whitespace} /* nothing */
-
-webidlfile return TOK_IDLFILE;
-
-\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
-
-{multicomment} /* nothing */
-
-{other} return (int) yytext[0];
-
-. /* nothing */
-
-%%
\ No newline at end of file
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
deleted file mode 100644
index cad20b4..0000000
--- a/src/genbind-parser.y
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This is a bison parser for genbind
- *
- */
-
-%{
-
-#include <stdio.h>
-#include <string.h>
-
-#include "genbind-parser.h"
-#include "genbind-lexer.h"
-
- extern int loadwebidl(char *filename);
-
-void genbind_error(const char *str)
-{
- fprintf(stderr,"error: %s\n",str);
-}
-
-
-int genbind_wrap()
-{
- return 1;
-}
-
-
-
-%}
-
-%define api.pure
-
-%union
-{
- char* text;
-}
-
-%token TOK_IDLFILE
-
-%token <text> TOK_STRING_LITERAL
-
-%%
-
- /* [1] start with instructions */
-Instructions:
- /* empty */
- |
- IdlFile
- ;
-
-IdlFile:
- TOK_IDLFILE TOK_STRING_LITERAL
- {
- loadwebidl($2);
- }
- ;
-
-%%
diff --git a/src/genjsbind-lexer.l b/src/genjsbind-lexer.l
new file mode 100644
index 0000000..e976a8f
--- /dev/null
+++ b/src/genjsbind-lexer.l
@@ -0,0 +1,52 @@
+/*
+ * binding generator lexer
+ */
+
+/* lexer options */
+%option never-interactive
+%option bison-bridge
+%option nodefault
+%option warn
+%option prefix="genjsbind_"
+%option nounput
+
+/* header block */
+%{
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "genjsbind-parser.h"
+
+%}
+
+ /* other Unicode “space separator” */
+USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
+
+/* non breaking space \u00A0 */
+NBSP (\xc2\xa0)
+
+whitespace ([ \t\v\f\n]|{NBSP}|{USP})
+
+multicomment \/\*(([^*])|(\*[^/]))*\*\/
+
+quotedstring [^\"\\\n\r]
+
+other [^\t\n\r 0-9A-Z_a-z]
+
+%%
+
+{whitespace} /* nothing */
+
+webidlfile return TOK_IDLFILE;
+
+\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
+
+{multicomment} /* nothing */
+
+{other} return (int) yytext[0];
+
+. /* nothing */
+
+%%
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
new file mode 100644
index 0000000..08b8926
--- /dev/null
+++ b/src/genjsbind-parser.y
@@ -0,0 +1,60 @@
+/*
+ * This is a bison parser for genbind
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "genjsbind-parser.h"
+#include "genjsbind-lexer.h"
+#include "genjsbind.h"
+
+static void genjsbind_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+
+int genjsbind_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%define api.pure
+
+%union
+{
+ char* text;
+}
+
+%token TOK_IDLFILE
+
+%token <text> TOK_STRING_LITERAL
+
+%%
+
+ /* [1] start with Statements */
+Statements:
+ /* empty */
+ |
+ IdlFile
+ ;
+
+ /* [2] load a web IDL file */
+IdlFile:
+ TOK_IDLFILE TOK_STRING_LITERAL ';'
+ {
+ if (loadwebidl($2) != 0) {
+ YYABORT;
+ }
+ }
+ ;
+
+%%
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 150c780..145c16e 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -1,52 +1,177 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <errno.h>
#include "webidl-ast.h"
-
#include "webidl-parser.h"
-#include "genbind-parser.h"
+#include "genjsbind-parser.h"
+#include "genjsbind.h"
extern int webidl_debug;
+extern int webidl__flex_debug;
extern FILE* webidl_in;
-extern int webidl_parse();
+extern int webidl_parse(void);
+
+extern int genjsbind_debug;
+extern int genjsbind__flex_debug;
+extern FILE* genjsbind_in;
+extern int genjsbind_parse(void);
+
+struct options {
+ char *outfilename;
+ char *infilename;
+ char *idlpath;
+ bool verbose;
+ bool debug;
+};
+
+struct options *options;
+
+static FILE *idlopen(const char *filename)
+{
+ FILE *idlfile;
-extern int genbind_debug;
-extern FILE* genbind_in;
-extern int genbind_parse();
+ if (options->idlpath == NULL) {
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", filename);
+ }
+ idlfile = fopen(filename, "r");
+ } else {
+ char *fullname;
+ int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
+ fullname = malloc(fulllen);
+ snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", fullname);
+ }
+ idlfile = fopen(fullname, "r");
+ free(fullname);
+ }
+ return idlfile;
+}
int loadwebidl(char *filename)
{
- FILE *myfile = fopen(filename, "r");
- if (!myfile) {
- perror(filename);
+ /* set flex to read from file */
+ webidl_in = idlopen(filename);
+ if (!webidl_in) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ filename,
+ strerror(errno));
return 2;
}
- /* set flex to read from file */
- webidl_in = myfile;
- webidl_debug = 1;
+ if (options->debug) {
+ webidl_debug = 1;
+ webidl__flex_debug = 1;
+ }
- /* parse through the input until there is no more: */
- while (!feof(webidl_in)) {
- webidl_parse();
+ /* parse the file */
+ return webidl_parse();
+}
+
+
+static struct options* process_cmdline(int argc, char **argv)
+{
+ int opt;
+
+ options = calloc(1,sizeof(struct options));
+ if (options == NULL) {
+ fprintf(stderr, "Allocation error\n");
+ return NULL;
}
- return 0;
+
+ while ((opt = getopt(argc, argv, "vdI:o:")) != -1) {
+ switch (opt) {
+ case 'I':
+ options->idlpath = strdup(optarg);
+ break;
+
+ case 'o':
+ options->outfilename = strdup(optarg);
+ break;
+
+ case 'v':
+ options->verbose = true;
+ break;
+
+ case 'd':
+ options->debug = true;
+ break;
+
+ default: /* '?' */
+ fprintf(stderr,
+ "Usage: %s [-I idlpath] [-o filename] inputfile\n",
+ argv[0]);
+ free(options);
+ return NULL;
+
+ }
+ }
+
+ if (optind >= argc) {
+ fprintf(stderr, "Error: expected input filename\n");
+ free(options);
+ return NULL;
+ }
+
+ options->infilename = strdup(argv[optind]);
+
+ return options;
+
}
int main(int argc, char **argv)
{
- FILE *myfile = fopen("htmldocument.bnd", "r");
- if (!myfile) {
- perror(NULL);
+ FILE *infile;
+ int parse_res;
+
+ options = process_cmdline(argc, argv);
+ if (options == NULL) {
+ return 1; /* bad commandline */
+ }
+
+ if (options->verbose && (options->outfilename == NULL)) {
+ fprintf(stderr, "Error: outputting to stdout with verbose logging would fail\n");
return 2;
}
+
+ if ((options->infilename[0] == '-') &&
+ (options->infilename[1] == 0)) {
+ if (options->verbose) {
+ printf("Using stdin for input\n");
+ }
+ infile = stdin;
+ } else {
+ if (options->verbose) {
+ printf("Opening binding file %s\n", options->infilename);
+ }
+ infile = fopen(options->infilename, "r");
+ }
+
+ if (!infile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ options->infilename,
+ strerror(errno));
+ return 3;
+ }
+
/* set flex to read from file */
- genbind_in = myfile;
+ genjsbind_in = infile;
- genbind_debug = 1;
+ if (options->debug) {
+ genjsbind_debug = 1;
+ genjsbind__flex_debug = 1;
+ }
- /* parse through the input until there is no more: */
- while (!feof(genbind_in)) {
- genbind_parse();
+ parse_res = genjsbind_parse();
+ if (parse_res) {
+ fprintf(stderr, "parse result was %d\n", parse_res);
+ return parse_res;
}
return 0;
}
diff --git a/src/genjsbind.h b/src/genjsbind.h
new file mode 100644
index 0000000..69d2f59
--- /dev/null
+++ b/src/genjsbind.h
@@ -0,0 +1 @@
+extern int loadwebidl(char *filename);
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index 96d7c2a..f56c5d9 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -1,2 +1,4 @@
- struct ifmembers_s {
- };
+
+struct ifmembers_s {
+ char *name;
+};
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
index 1d2db67..20ee4c5 100644
--- a/src/webidl-lexer.l
+++ b/src/webidl-lexer.l
@@ -16,7 +16,6 @@
%option bison-locations
%option nodefault
%option warn
-%option debug
%option prefix="webidl_"
%option nounput
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index 73ed2c6..c4e25f1 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -16,9 +16,9 @@
-void webidl_error(const char *str)
+static void webidl_error(const char *str)
{
- fprintf(stderr,"error: %s\n",str);
+ fprintf(stderr,"error: %s\n",str);
}
int webidl_wrap()
@@ -33,6 +33,12 @@ int webidl_wrap()
%locations
%define api.pure
+ /* the w3c grammar results in 10 shift/reduce, 2 reduce/reduce conflicts
+ * The reduce/reduce error are both the result of empty sequences
+ */
+ /* %expect 10 */
+ /* %expect-rr 2 */
+
%union
{
int attr;
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..0e5236e
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,7 @@
+
+TEST_TARGETS := $(TEST_TARGETS) test_bindings
+
+test_bindings:
+ $(Q)$(SHAREDLDPATH) $(TESTRUNNER) $(BUILDDIR) $(CURDIR)/test
+
+include $(NSBUILD)/Makefile.subdir
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
new file mode 100644
index 0000000..4f3095f
--- /dev/null
+++ b/test/data/bindings/htmldocument.bnd
@@ -0,0 +1,4 @@
+/* test binding docuemnt */
+
+webidlfile "htmldocument.idl";
+
diff --git a/test/data/idl/document.idl b/test/data/idl/document.idl
new file mode 100644
index 0000000..afab566
--- /dev/null
+++ b/test/data/idl/document.idl
@@ -0,0 +1,37 @@
+interface Document : Node {
+ readonly attribute DOMImplementation implementation;
+ readonly attribute DOMString URL;
+ readonly attribute DOMString documentURI;
+ readonly attribute DOMString compatMode;
+ readonly attribute DOMString characterSet;
+ readonly attribute DOMString contentType;
+
+ readonly attribute DocumentType? doctype;
+ readonly attribute Element? documentElement;
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+ Element? getElementById(DOMString elementId);
+
+ Element createElement(DOMString localName);
+ Element createElementNS(DOMString? namespace, DOMString qualifiedName);
+ DocumentFragment createDocumentFragment();
+ Text createTextNode(DOMString data);
+ Comment createComment(DOMString data);
+ ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
+
+ Node importNode(Node node, optional boolean deep = true);
+ Node adoptNode(Node node);
+
+ Event createEvent(DOMString interface);
+
+ Range createRange();
+
+ // NodeFilter.SHOW_ALL = 0xFFFFFFFF
+ NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+ TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+
+ // NEW
+ void prepend((Node or DOMString)... nodes);
+ void append((Node or DOMString)... nodes);
+};
diff --git a/test/data/idl/eventtarget.idl b/test/data/idl/eventtarget.idl
new file mode 100644
index 0000000..2cfd15e
--- /dev/null
+++ b/test/data/idl/eventtarget.idl
@@ -0,0 +1,5 @@
+interface EventTarget {
+ void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ boolean dispatchEvent(Event event);
+};
diff --git a/test/data/idl/htmldocument.idl b/test/data/idl/htmldocument.idl
new file mode 100644
index 0000000..923aa08
--- /dev/null
+++ b/test/data/idl/htmldocument.idl
@@ -0,0 +1,108 @@
+[OverrideBuiltins]
+partial interface Document {
+ // resource metadata management
+ [PutForwards=href] readonly attribute Location? location;
+ attribute DOMString domain;
+ readonly attribute DOMString referrer;
+ attribute DOMString cookie;
+ readonly attribute DOMString lastModified;
+ readonly attribute DOMString readyState;
+
+ // DOM tree accessors
+ getter object (DOMString name);
+ attribute DOMString title;
+ attribute DOMString dir;
+ attribute HTMLElement? body;
+ readonly attribute HTMLHeadElement? head;
+ readonly attribute HTMLCollection images;
+ readonly attribute HTMLCollection embeds;
+ readonly attribute HTMLCollection plugins;
+ readonly attribute HTMLCollection links;
+ readonly attribute HTMLCollection forms;
+ readonly attribute HTMLCollection scripts;
+ NodeList getElementsByName(DOMString elementName);
+ NodeList getItems(optional DOMString typeNames); // microdata
+ readonly attribute DOMElementMap cssElementMap;
+
+ // dynamic markup insertion
+ Document open(optional DOMString type, optional DOMString replace);
+ WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace);
+ void close();
+ void write(DOMString... text);
+ void writeln(DOMString... text);
+
+ // user interaction
+ readonly attribute WindowProxy? defaultView;
+ readonly attribute Element? activeElement;
+ boolean hasFocus();
+ attribute DOMString designMode;
+ boolean execCommand(DOMString commandId);
+ boolean execCommand(DOMString commandId, boolean showUI);
+ boolean execCommand(DOMString commandId, boolean showUI, DOMString value);
+ boolean queryCommandEnabled(DOMString commandId);
+ boolean queryCommandIndeterm(DOMString commandId);
+ boolean queryCommandState(DOMString commandId);
+ boolean queryCommandSupported(DOMString commandId);
+ DOMString queryCommandValue(DOMString commandId);
+ readonly attribute HTMLCollection commands;
+
+ // event handler IDL attributes
+ attribute EventHandler onabort;
+ attribute EventHandler onblur;
+ attribute EventHandler oncancel;
+ attribute EventHandler oncanplay;
+ attribute EventHandler oncanplaythrough;
+ attribute EventHandler onchange;
+ attribute EventHandler onclick;
+ attribute EventHandler onclose;
+ attribute EventHandler oncontextmenu;
+ attribute EventHandler oncuechange;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
+ attribute EventHandler ondurationchange;
+ attribute EventHandler onemptied;
+ attribute EventHandler onended;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
+ attribute EventHandler oninput;
+ attribute EventHandler oninvalid;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
+ attribute EventHandler onload;
+ attribute EventHandler onloadeddata;
+ attribute EventHandler onloadedmetadata;
+ attribute EventHandler onloadstart;
+ attribute EventHandler onmousedown;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
+ attribute EventHandler onpause;
+ attribute EventHandler onplay;
+ attribute EventHandler onplaying;
+ attribute EventHandler onprogress;
+ attribute EventHandler onratechange;
+ attribute EventHandler onreset;
+ attribute EventHandler onscroll;
+ attribute EventHandler onseeked;
+ attribute EventHandler onseeking;
+ attribute EventHandler onselect;
+ attribute EventHandler onshow;
+ attribute EventHandler onstalled;
+ attribute EventHandler onsubmit;
+ attribute EventHandler onsuspend;
+ attribute EventHandler ontimeupdate;
+ attribute EventHandler onvolumechange;
+ attribute EventHandler onwaiting;
+
+ // special event handler IDL attributes that only apply to Document objects
+ [LenientThis] attribute EventHandler onreadystatechange;
+};
diff --git a/test/data/idl/window.idl b/test/data/idl/window.idl
new file mode 100644
index 0000000..7114709
--- /dev/null
+++ b/test/data/idl/window.idl
@@ -0,0 +1,119 @@
+#include "eventtarget.idl"
+
+[NamedPropertiesObject]
+interface Window : EventTarget {
+ // the current browsing context
+ [Unforgeable] readonly attribute WindowProxy window;
+ [Replaceable] readonly attribute WindowProxy self;
+ [Unforgeable] readonly attribute Document document;
+ attribute DOMString name;
+ [PutForwards=href, Unforgeable] readonly attribute Location location;
+ readonly attribute History history;
+ [Replaceable] readonly attribute BarProp locationbar;
+ [Replaceable] readonly attribute BarProp menubar;
+ [Replaceable] readonly attribute BarProp personalbar;
+ [Replaceable] readonly attribute BarProp scrollbars;
+ [Replaceable] readonly attribute BarProp statusbar;
+ [Replaceable] readonly attribute BarProp toolbar;
+ attribute DOMString status;
+ void close();
+ void stop();
+ void focus();
+ void blur();
+
+ // other browsing contexts
+ [Replaceable] readonly attribute WindowProxy frames;
+ [Replaceable] readonly attribute unsigned long length;
+ [Unforgeable] readonly attribute WindowProxy top;
+ attribute WindowProxy? opener;
+ readonly attribute WindowProxy parent;
+ readonly attribute Element? frameElement;
+ WindowProxy open(optional DOMString url, optional DOMString target, optional DOMString features, optional boolean replace);
+ getter WindowProxy (unsigned long index);
+ getter object (DOMString name);
+
+ // the user agent
+ readonly attribute Navigator navigator;
+ readonly attribute External external;
+ readonly attribute ApplicationCache applicationCache;
+
+ // user prompts
+ void alert(DOMString message);
+ boolean confirm(DOMString message);
+ DOMString? prompt(DOMString message, optional DOMString default);
+ void print();
+ any showModalDialog(DOMString url, optional any argument);
+
+ // cross-document messaging
+ void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
+
+ // event handler IDL attributes
+ attribute EventHandler onabort;
+ attribute EventHandler onafterprint;
+ attribute EventHandler onbeforeprint;
+ attribute EventHandler onbeforeunload;
+ attribute EventHandler onblur;
+ attribute EventHandler oncancel;
+ attribute EventHandler oncanplay;
+ attribute EventHandler oncanplaythrough;
+ attribute EventHandler onchange;
+ attribute EventHandler onclick;
+ attribute EventHandler onclose;
+ attribute EventHandler oncontextmenu;
+ attribute EventHandler oncuechange;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
+ attribute EventHandler ondurationchange;
+ attribute EventHandler onemptied;
+ attribute EventHandler onended;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
+ attribute EventHandler onhashchange;
+ attribute EventHandler oninput;
+ attribute EventHandler oninvalid;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
+ attribute EventHandler onload;
+ attribute EventHandler onloadeddata;
+ attribute EventHandler onloadedmetadata;
+ attribute EventHandler onloadstart;
+ attribute EventHandler onmessage;
+ attribute EventHandler onmousedown;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
+ attribute EventHandler onoffline;
+ attribute EventHandler ononline;
+ attribute EventHandler onpause;
+ attribute EventHandler onplay;
+ attribute EventHandler onplaying;
+ attribute EventHandler onpagehide;
+ attribute EventHandler onpageshow;
+ attribute EventHandler onpopstate;
+ attribute EventHandler onprogress;
+ attribute EventHandler onratechange;
+ attribute EventHandler onreset;
+ attribute EventHandler onresize;
+ attribute EventHandler onscroll;
+ attribute EventHandler onseeked;
+ attribute EventHandler onseeking;
+ attribute EventHandler onselect;
+ attribute EventHandler onshow;
+ attribute EventHandler onstalled;
+ attribute EventHandler onstorage;
+ attribute EventHandler onsubmit;
+ attribute EventHandler onsuspend;
+ attribute EventHandler ontimeupdate;
+ attribute EventHandler onunload;
+ attribute EventHandler onvolumechange;
+ attribute EventHandler onwaiting;
+};
diff --git a/test/document.idl b/test/document.idl
deleted file mode 100644
index afab566..0000000
--- a/test/document.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-interface Document : Node {
- readonly attribute DOMImplementation implementation;
- readonly attribute DOMString URL;
- readonly attribute DOMString documentURI;
- readonly attribute DOMString compatMode;
- readonly attribute DOMString characterSet;
- readonly attribute DOMString contentType;
-
- readonly attribute DocumentType? doctype;
- readonly attribute Element? documentElement;
- HTMLCollection getElementsByTagName(DOMString localName);
- HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
- HTMLCollection getElementsByClassName(DOMString classNames);
- Element? getElementById(DOMString elementId);
-
- Element createElement(DOMString localName);
- Element createElementNS(DOMString? namespace, DOMString qualifiedName);
- DocumentFragment createDocumentFragment();
- Text createTextNode(DOMString data);
- Comment createComment(DOMString data);
- ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
-
- Node importNode(Node node, optional boolean deep = true);
- Node adoptNode(Node node);
-
- Event createEvent(DOMString interface);
-
- Range createRange();
-
- // NodeFilter.SHOW_ALL = 0xFFFFFFFF
- NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
- TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
-
- // NEW
- void prepend((Node or DOMString)... nodes);
- void append((Node or DOMString)... nodes);
-};
diff --git a/test/eventtarget.idl b/test/eventtarget.idl
deleted file mode 100644
index 2cfd15e..0000000
--- a/test/eventtarget.idl
+++ /dev/null
@@ -1,5 +0,0 @@
-interface EventTarget {
- void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
- void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
- boolean dispatchEvent(Event event);
-};
diff --git a/test/htmldocument.bnd b/test/htmldocument.bnd
deleted file mode 100644
index 6f02c75..0000000
--- a/test/htmldocument.bnd
+++ /dev/null
@@ -1,3 +0,0 @@
-/* test binding docuemnt */
-
-webidlfile "htmldocument.idl"
diff --git a/test/htmldocument.idl b/test/htmldocument.idl
deleted file mode 100644
index 923aa08..0000000
--- a/test/htmldocument.idl
+++ /dev/null
@@ -1,108 +0,0 @@
-[OverrideBuiltins]
-partial interface Document {
- // resource metadata management
- [PutForwards=href] readonly attribute Location? location;
- attribute DOMString domain;
- readonly attribute DOMString referrer;
- attribute DOMString cookie;
- readonly attribute DOMString lastModified;
- readonly attribute DOMString readyState;
-
- // DOM tree accessors
- getter object (DOMString name);
- attribute DOMString title;
- attribute DOMString dir;
- attribute HTMLElement? body;
- readonly attribute HTMLHeadElement? head;
- readonly attribute HTMLCollection images;
- readonly attribute HTMLCollection embeds;
- readonly attribute HTMLCollection plugins;
- readonly attribute HTMLCollection links;
- readonly attribute HTMLCollection forms;
- readonly attribute HTMLCollection scripts;
- NodeList getElementsByName(DOMString elementName);
- NodeList getItems(optional DOMString typeNames); // microdata
- readonly attribute DOMElementMap cssElementMap;
-
- // dynamic markup insertion
- Document open(optional DOMString type, optional DOMString replace);
- WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace);
- void close();
- void write(DOMString... text);
- void writeln(DOMString... text);
-
- // user interaction
- readonly attribute WindowProxy? defaultView;
- readonly attribute Element? activeElement;
- boolean hasFocus();
- attribute DOMString designMode;
- boolean execCommand(DOMString commandId);
- boolean execCommand(DOMString commandId, boolean showUI);
- boolean execCommand(DOMString commandId, boolean showUI, DOMString value);
- boolean queryCommandEnabled(DOMString commandId);
- boolean queryCommandIndeterm(DOMString commandId);
- boolean queryCommandState(DOMString commandId);
- boolean queryCommandSupported(DOMString commandId);
- DOMString queryCommandValue(DOMString commandId);
- readonly attribute HTMLCollection commands;
-
- // event handler IDL attributes
- attribute EventHandler onabort;
- attribute EventHandler onblur;
- attribute EventHandler oncancel;
- attribute EventHandler oncanplay;
- attribute EventHandler oncanplaythrough;
- attribute EventHandler onchange;
- attribute EventHandler onclick;
- attribute EventHandler onclose;
- attribute EventHandler oncontextmenu;
- attribute EventHandler oncuechange;
- attribute EventHandler ondblclick;
- attribute EventHandler ondrag;
- attribute EventHandler ondragend;
- attribute EventHandler ondragenter;
- attribute EventHandler ondragleave;
- attribute EventHandler ondragover;
- attribute EventHandler ondragstart;
- attribute EventHandler ondrop;
- attribute EventHandler ondurationchange;
- attribute EventHandler onemptied;
- attribute EventHandler onended;
- attribute OnErrorEventHandler onerror;
- attribute EventHandler onfocus;
- attribute EventHandler oninput;
- attribute EventHandler oninvalid;
- attribute EventHandler onkeydown;
- attribute EventHandler onkeypress;
- attribute EventHandler onkeyup;
- attribute EventHandler onload;
- attribute EventHandler onloadeddata;
- attribute EventHandler onloadedmetadata;
- attribute EventHandler onloadstart;
- attribute EventHandler onmousedown;
- attribute EventHandler onmousemove;
- attribute EventHandler onmouseout;
- attribute EventHandler onmouseover;
- attribute EventHandler onmouseup;
- attribute EventHandler onmousewheel;
- attribute EventHandler onpause;
- attribute EventHandler onplay;
- attribute EventHandler onplaying;
- attribute EventHandler onprogress;
- attribute EventHandler onratechange;
- attribute EventHandler onreset;
- attribute EventHandler onscroll;
- attribute EventHandler onseeked;
- attribute EventHandler onseeking;
- attribute EventHandler onselect;
- attribute EventHandler onshow;
- attribute EventHandler onstalled;
- attribute EventHandler onsubmit;
- attribute EventHandler onsuspend;
- attribute EventHandler ontimeupdate;
- attribute EventHandler onvolumechange;
- attribute EventHandler onwaiting;
-
- // special event handler IDL attributes that only apply to Document objects
- [LenientThis] attribute EventHandler onreadystatechange;
-};
diff --git a/test/testrunner.sh b/test/testrunner.sh
new file mode 100755
index 0000000..b717e34
--- /dev/null
+++ b/test/testrunner.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+outline() {
+echo >>${LOGFILE}
+echo "-----------------------------------------------------------" >>${LOGFILE}
+echo >>${LOGFILE}
+}
+
+BUILDDIR=$1
+TESTDIR=$2
+
+# locations
+LOGFILE=${BUILDDIR}/testlog
+
+GENJSBIND=${BUILDDIR}/genjsbind
+
+BINDINGDIR=${TESTDIR}/data/bindings
+BINDINGTESTS=$(ls ${BINDINGDIR}/*.bnd)
+
+IDLDIR=${TESTDIR}/data/idl
+
+echo "$*" >${LOGFILE}
+
+for TEST in ${BINDINGTESTS};do
+
+ TESTNAME=$(basename ${TEST} .bnd)
+
+ echo -n " TEST: ${TESTNAME}......"
+ outline
+
+ echo ${GENJSBIND} -d -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+
+ ${GENJSBIND} -d -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+
+ if [ $? -eq 0 ]; then
+ echo "PASS"
+ else
+ echo "FAIL"
+ fi
+
+
+done
+
diff --git a/test/window.idl b/test/window.idl
deleted file mode 100644
index 7114709..0000000
--- a/test/window.idl
+++ /dev/null
@@ -1,119 +0,0 @@
-#include "eventtarget.idl"
-
-[NamedPropertiesObject]
-interface Window : EventTarget {
- // the current browsing context
- [Unforgeable] readonly attribute WindowProxy window;
- [Replaceable] readonly attribute WindowProxy self;
- [Unforgeable] readonly attribute Document document;
- attribute DOMString name;
- [PutForwards=href, Unforgeable] readonly attribute Location location;
- readonly attribute History history;
- [Replaceable] readonly attribute BarProp locationbar;
- [Replaceable] readonly attribute BarProp menubar;
- [Replaceable] readonly attribute BarProp personalbar;
- [Replaceable] readonly attribute BarProp scrollbars;
- [Replaceable] readonly attribute BarProp statusbar;
- [Replaceable] readonly attribute BarProp toolbar;
- attribute DOMString status;
- void close();
- void stop();
- void focus();
- void blur();
-
- // other browsing contexts
- [Replaceable] readonly attribute WindowProxy frames;
- [Replaceable] readonly attribute unsigned long length;
- [Unforgeable] readonly attribute WindowProxy top;
- attribute WindowProxy? opener;
- readonly attribute WindowProxy parent;
- readonly attribute Element? frameElement;
- WindowProxy open(optional DOMString url, optional DOMString target, optional DOMString features, optional boolean replace);
- getter WindowProxy (unsigned long index);
- getter object (DOMString name);
-
- // the user agent
- readonly attribute Navigator navigator;
- readonly attribute External external;
- readonly attribute ApplicationCache applicationCache;
-
- // user prompts
- void alert(DOMString message);
- boolean confirm(DOMString message);
- DOMString? prompt(DOMString message, optional DOMString default);
- void print();
- any showModalDialog(DOMString url, optional any argument);
-
- // cross-document messaging
- void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
-
- // event handler IDL attributes
- attribute EventHandler onabort;
- attribute EventHandler onafterprint;
- attribute EventHandler onbeforeprint;
- attribute EventHandler onbeforeunload;
- attribute EventHandler onblur;
- attribute EventHandler oncancel;
- attribute EventHandler oncanplay;
- attribute EventHandler oncanplaythrough;
- attribute EventHandler onchange;
- attribute EventHandler onclick;
- attribute EventHandler onclose;
- attribute EventHandler oncontextmenu;
- attribute EventHandler oncuechange;
- attribute EventHandler ondblclick;
- attribute EventHandler ondrag;
- attribute EventHandler ondragend;
- attribute EventHandler ondragenter;
- attribute EventHandler ondragleave;
- attribute EventHandler ondragover;
- attribute EventHandler ondragstart;
- attribute EventHandler ondrop;
- attribute EventHandler ondurationchange;
- attribute EventHandler onemptied;
- attribute EventHandler onended;
- attribute OnErrorEventHandler onerror;
- attribute EventHandler onfocus;
- attribute EventHandler onhashchange;
- attribute EventHandler oninput;
- attribute EventHandler oninvalid;
- attribute EventHandler onkeydown;
- attribute EventHandler onkeypress;
- attribute EventHandler onkeyup;
- attribute EventHandler onload;
- attribute EventHandler onloadeddata;
- attribute EventHandler onloadedmetadata;
- attribute EventHandler onloadstart;
- attribute EventHandler onmessage;
- attribute EventHandler onmousedown;
- attribute EventHandler onmousemove;
- attribute EventHandler onmouseout;
- attribute EventHandler onmouseover;
- attribute EventHandler onmouseup;
- attribute EventHandler onmousewheel;
- attribute EventHandler onoffline;
- attribute EventHandler ononline;
- attribute EventHandler onpause;
- attribute EventHandler onplay;
- attribute EventHandler onplaying;
- attribute EventHandler onpagehide;
- attribute EventHandler onpageshow;
- attribute EventHandler onpopstate;
- attribute EventHandler onprogress;
- attribute EventHandler onratechange;
- attribute EventHandler onreset;
- attribute EventHandler onresize;
- attribute EventHandler onscroll;
- attribute EventHandler onseeked;
- attribute EventHandler onseeking;
- attribute EventHandler onselect;
- attribute EventHandler onshow;
- attribute EventHandler onstalled;
- attribute EventHandler onstorage;
- attribute EventHandler onsubmit;
- attribute EventHandler onsuspend;
- attribute EventHandler ontimeupdate;
- attribute EventHandler onunload;
- attribute EventHandler onvolumechange;
- attribute EventHandler onwaiting;
-};
-----------------------------------------------------------------------
Summary of changes:
Makefile | 22 ++++-
README | 10 ++
src/Makefile | 4 +-
src/genbind-parser.y | 58 ---------
src/{genbind-lexer.l => genjsbind-lexer.l} | 7 +-
src/genjsbind-parser.y | 60 ++++++++++
src/genjsbind.c | 173 ++++++++++++++++++++++++----
src/genjsbind.h | 1 +
src/webidl-ast.h | 6 +-
src/webidl-lexer.l | 1 -
src/webidl-parser.y | 10 ++-
test/Makefile | 7 +
test/data/bindings/htmldocument.bnd | 4 +
test/{ => data/idl}/document.idl | 0
test/{ => data/idl}/eventtarget.idl | 0
test/{ => data/idl}/htmldocument.idl | 0
test/{ => data/idl}/window.idl | 0
test/htmldocument.bnd | 3 -
test/testrunner.sh | 43 +++++++
19 files changed, 312 insertions(+), 97 deletions(-)
create mode 100644 README
delete mode 100644 src/genbind-parser.y
rename src/{genbind-lexer.l => genjsbind-lexer.l} (93%)
create mode 100644 src/genjsbind-parser.y
create mode 100644 src/genjsbind.h
create mode 100644 test/Makefile
create mode 100644 test/data/bindings/htmldocument.bnd
rename test/{ => data/idl}/document.idl (100%)
rename test/{ => data/idl}/eventtarget.idl (100%)
rename test/{ => data/idl}/htmldocument.idl (100%)
rename test/{ => data/idl}/window.idl (100%)
delete mode 100644 test/htmldocument.bnd
create mode 100755 test/testrunner.sh
diff --git a/Makefile b/Makefile
index eab056a..decc5ce 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,29 @@ PREFIX ?= /opt/netsurf
NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
include $(NSSHARED)/makefiles/Makefile.tools
+TESTRUNNER := test/testrunner.sh
+
+# Toolchain flags
+WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -pedantic
+# BeOS/Haiku/AmigaOS have standard library errors that issue warnings.
+ifneq ($(TARGET),beos)
+ ifneq ($(TARGET),amiga)
+# WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+endif
+CFLAGS := -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -I$(CURDIR)/include/ \
+ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+else
+ # __inline__ is a GCCism
+ CFLAGS := $(CFLAGS) -Dinline="__inline__"
+endif
+
# Grab the core makefile
include $(NSBUILD)/Makefile.top
# Add extra install rules for our pkg-config control file and the library itself
-#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /bin:$(BUILDDIR)/$(COMPONENT)$(EXEEXT)
diff --git a/README b/README
new file mode 100644
index 0000000..70d224f
--- /dev/null
+++ b/README
@@ -0,0 +1,10 @@
+genjsbind
+=========
+
+This is a tool to generate javascript to dom bindings from w3c webidl
+files and a binding configuration file.
+
+building
+--------
+
+The tool requires bison and flex as pre-requisites
\ No newline at end of file
diff --git a/src/Makefile b/src/Makefile
index 232a7dd..6740140 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,7 @@ CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
# Sources in this directory
DIR_SOURCES := genjsbind.c
-SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
+SOURCES := $(SOURCES) $(BUILDDIR)/genjsbind-parser.c $(BUILDDIR)/genjsbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
@@ -31,7 +31,7 @@ endif
$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
$(VQ)$(ECHO) " BISON: $<"
- $(Q)bison -d -t $(BISON_DEFINES) --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
+ $(Q)bison -d -t $(BISON_DEFINES) --report=all --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
# Grab the core makefile
include $(NSBUILD)/Makefile.subdir
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
deleted file mode 100644
index cad20b4..0000000
--- a/src/genbind-parser.y
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This is a bison parser for genbind
- *
- */
-
-%{
-
-#include <stdio.h>
-#include <string.h>
-
-#include "genbind-parser.h"
-#include "genbind-lexer.h"
-
- extern int loadwebidl(char *filename);
-
-void genbind_error(const char *str)
-{
- fprintf(stderr,"error: %s\n",str);
-}
-
-
-int genbind_wrap()
-{
- return 1;
-}
-
-
-
-%}
-
-%define api.pure
-
-%union
-{
- char* text;
-}
-
-%token TOK_IDLFILE
-
-%token <text> TOK_STRING_LITERAL
-
-%%
-
- /* [1] start with instructions */
-Instructions:
- /* empty */
- |
- IdlFile
- ;
-
-IdlFile:
- TOK_IDLFILE TOK_STRING_LITERAL
- {
- loadwebidl($2);
- }
- ;
-
-%%
diff --git a/src/genbind-lexer.l b/src/genjsbind-lexer.l
similarity index 93%
rename from src/genbind-lexer.l
rename to src/genjsbind-lexer.l
index 6150f09..e976a8f 100644
--- a/src/genbind-lexer.l
+++ b/src/genjsbind-lexer.l
@@ -7,8 +7,7 @@
%option bison-bridge
%option nodefault
%option warn
-%option debug
-%option prefix="genbind_"
+%option prefix="genjsbind_"
%option nounput
/* header block */
@@ -18,7 +17,7 @@
#include <stdio.h>
#include <string.h>
-#include "genbind-parser.h"
+#include "genjsbind-parser.h"
%}
@@ -50,4 +49,4 @@ webidlfile return TOK_IDLFILE;
. /* nothing */
-%%
\ No newline at end of file
+%%
diff --git a/src/genjsbind-parser.y b/src/genjsbind-parser.y
new file mode 100644
index 0000000..08b8926
--- /dev/null
+++ b/src/genjsbind-parser.y
@@ -0,0 +1,60 @@
+/*
+ * This is a bison parser for genbind
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "genjsbind-parser.h"
+#include "genjsbind-lexer.h"
+#include "genjsbind.h"
+
+static void genjsbind_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+
+int genjsbind_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%define api.pure
+
+%union
+{
+ char* text;
+}
+
+%token TOK_IDLFILE
+
+%token <text> TOK_STRING_LITERAL
+
+%%
+
+ /* [1] start with Statements */
+Statements:
+ /* empty */
+ |
+ IdlFile
+ ;
+
+ /* [2] load a web IDL file */
+IdlFile:
+ TOK_IDLFILE TOK_STRING_LITERAL ';'
+ {
+ if (loadwebidl($2) != 0) {
+ YYABORT;
+ }
+ }
+ ;
+
+%%
diff --git a/src/genjsbind.c b/src/genjsbind.c
index 150c780..145c16e 100644
--- a/src/genjsbind.c
+++ b/src/genjsbind.c
@@ -1,52 +1,177 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <errno.h>
#include "webidl-ast.h"
-
#include "webidl-parser.h"
-#include "genbind-parser.h"
+#include "genjsbind-parser.h"
+#include "genjsbind.h"
extern int webidl_debug;
+extern int webidl__flex_debug;
extern FILE* webidl_in;
-extern int webidl_parse();
+extern int webidl_parse(void);
+
+extern int genjsbind_debug;
+extern int genjsbind__flex_debug;
+extern FILE* genjsbind_in;
+extern int genjsbind_parse(void);
+
+struct options {
+ char *outfilename;
+ char *infilename;
+ char *idlpath;
+ bool verbose;
+ bool debug;
+};
+
+struct options *options;
+
+static FILE *idlopen(const char *filename)
+{
+ FILE *idlfile;
-extern int genbind_debug;
-extern FILE* genbind_in;
-extern int genbind_parse();
+ if (options->idlpath == NULL) {
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", filename);
+ }
+ idlfile = fopen(filename, "r");
+ } else {
+ char *fullname;
+ int fulllen = strlen(options->idlpath) + strlen(filename) + 2;
+ fullname = malloc(fulllen);
+ snprintf(fullname, fulllen, "%s/%s", options->idlpath, filename);
+ if (options->verbose) {
+ printf("Opening IDL file %s\n", fullname);
+ }
+ idlfile = fopen(fullname, "r");
+ free(fullname);
+ }
+ return idlfile;
+}
int loadwebidl(char *filename)
{
- FILE *myfile = fopen(filename, "r");
- if (!myfile) {
- perror(filename);
+ /* set flex to read from file */
+ webidl_in = idlopen(filename);
+ if (!webidl_in) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ filename,
+ strerror(errno));
return 2;
}
- /* set flex to read from file */
- webidl_in = myfile;
- webidl_debug = 1;
+ if (options->debug) {
+ webidl_debug = 1;
+ webidl__flex_debug = 1;
+ }
- /* parse through the input until there is no more: */
- while (!feof(webidl_in)) {
- webidl_parse();
+ /* parse the file */
+ return webidl_parse();
+}
+
+
+static struct options* process_cmdline(int argc, char **argv)
+{
+ int opt;
+
+ options = calloc(1,sizeof(struct options));
+ if (options == NULL) {
+ fprintf(stderr, "Allocation error\n");
+ return NULL;
}
- return 0;
+
+ while ((opt = getopt(argc, argv, "vdI:o:")) != -1) {
+ switch (opt) {
+ case 'I':
+ options->idlpath = strdup(optarg);
+ break;
+
+ case 'o':
+ options->outfilename = strdup(optarg);
+ break;
+
+ case 'v':
+ options->verbose = true;
+ break;
+
+ case 'd':
+ options->debug = true;
+ break;
+
+ default: /* '?' */
+ fprintf(stderr,
+ "Usage: %s [-I idlpath] [-o filename] inputfile\n",
+ argv[0]);
+ free(options);
+ return NULL;
+
+ }
+ }
+
+ if (optind >= argc) {
+ fprintf(stderr, "Error: expected input filename\n");
+ free(options);
+ return NULL;
+ }
+
+ options->infilename = strdup(argv[optind]);
+
+ return options;
+
}
int main(int argc, char **argv)
{
- FILE *myfile = fopen("htmldocument.bnd", "r");
- if (!myfile) {
- perror(NULL);
+ FILE *infile;
+ int parse_res;
+
+ options = process_cmdline(argc, argv);
+ if (options == NULL) {
+ return 1; /* bad commandline */
+ }
+
+ if (options->verbose && (options->outfilename == NULL)) {
+ fprintf(stderr, "Error: outputting to stdout with verbose logging would fail\n");
return 2;
}
+
+ if ((options->infilename[0] == '-') &&
+ (options->infilename[1] == 0)) {
+ if (options->verbose) {
+ printf("Using stdin for input\n");
+ }
+ infile = stdin;
+ } else {
+ if (options->verbose) {
+ printf("Opening binding file %s\n", options->infilename);
+ }
+ infile = fopen(options->infilename, "r");
+ }
+
+ if (!infile) {
+ fprintf(stderr, "Error opening %s: %s\n",
+ options->infilename,
+ strerror(errno));
+ return 3;
+ }
+
/* set flex to read from file */
- genbind_in = myfile;
+ genjsbind_in = infile;
- genbind_debug = 1;
+ if (options->debug) {
+ genjsbind_debug = 1;
+ genjsbind__flex_debug = 1;
+ }
- /* parse through the input until there is no more: */
- while (!feof(genbind_in)) {
- genbind_parse();
+ parse_res = genjsbind_parse();
+ if (parse_res) {
+ fprintf(stderr, "parse result was %d\n", parse_res);
+ return parse_res;
}
return 0;
}
diff --git a/src/genjsbind.h b/src/genjsbind.h
new file mode 100644
index 0000000..69d2f59
--- /dev/null
+++ b/src/genjsbind.h
@@ -0,0 +1 @@
+extern int loadwebidl(char *filename);
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
index 96d7c2a..f56c5d9 100644
--- a/src/webidl-ast.h
+++ b/src/webidl-ast.h
@@ -1,2 +1,4 @@
- struct ifmembers_s {
- };
+
+struct ifmembers_s {
+ char *name;
+};
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
index 1d2db67..20ee4c5 100644
--- a/src/webidl-lexer.l
+++ b/src/webidl-lexer.l
@@ -16,7 +16,6 @@
%option bison-locations
%option nodefault
%option warn
-%option debug
%option prefix="webidl_"
%option nounput
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index 73ed2c6..c4e25f1 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -16,9 +16,9 @@
-void webidl_error(const char *str)
+static void webidl_error(const char *str)
{
- fprintf(stderr,"error: %s\n",str);
+ fprintf(stderr,"error: %s\n",str);
}
int webidl_wrap()
@@ -33,6 +33,12 @@ int webidl_wrap()
%locations
%define api.pure
+ /* the w3c grammar results in 10 shift/reduce, 2 reduce/reduce conflicts
+ * The reduce/reduce error are both the result of empty sequences
+ */
+ /* %expect 10 */
+ /* %expect-rr 2 */
+
%union
{
int attr;
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..0e5236e
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,7 @@
+
+TEST_TARGETS := $(TEST_TARGETS) test_bindings
+
+test_bindings:
+ $(Q)$(SHAREDLDPATH) $(TESTRUNNER) $(BUILDDIR) $(CURDIR)/test
+
+include $(NSBUILD)/Makefile.subdir
diff --git a/test/data/bindings/htmldocument.bnd b/test/data/bindings/htmldocument.bnd
new file mode 100644
index 0000000..4f3095f
--- /dev/null
+++ b/test/data/bindings/htmldocument.bnd
@@ -0,0 +1,4 @@
+/* test binding docuemnt */
+
+webidlfile "htmldocument.idl";
+
diff --git a/test/document.idl b/test/data/idl/document.idl
similarity index 100%
rename from test/document.idl
rename to test/data/idl/document.idl
diff --git a/test/eventtarget.idl b/test/data/idl/eventtarget.idl
similarity index 100%
rename from test/eventtarget.idl
rename to test/data/idl/eventtarget.idl
diff --git a/test/htmldocument.idl b/test/data/idl/htmldocument.idl
similarity index 100%
rename from test/htmldocument.idl
rename to test/data/idl/htmldocument.idl
diff --git a/test/window.idl b/test/data/idl/window.idl
similarity index 100%
rename from test/window.idl
rename to test/data/idl/window.idl
diff --git a/test/htmldocument.bnd b/test/htmldocument.bnd
deleted file mode 100644
index 6f02c75..0000000
--- a/test/htmldocument.bnd
+++ /dev/null
@@ -1,3 +0,0 @@
-/* test binding docuemnt */
-
-webidlfile "htmldocument.idl"
diff --git a/test/testrunner.sh b/test/testrunner.sh
new file mode 100755
index 0000000..b717e34
--- /dev/null
+++ b/test/testrunner.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+outline() {
+echo >>${LOGFILE}
+echo "-----------------------------------------------------------" >>${LOGFILE}
+echo >>${LOGFILE}
+}
+
+BUILDDIR=$1
+TESTDIR=$2
+
+# locations
+LOGFILE=${BUILDDIR}/testlog
+
+GENJSBIND=${BUILDDIR}/genjsbind
+
+BINDINGDIR=${TESTDIR}/data/bindings
+BINDINGTESTS=$(ls ${BINDINGDIR}/*.bnd)
+
+IDLDIR=${TESTDIR}/data/idl
+
+echo "$*" >${LOGFILE}
+
+for TEST in ${BINDINGTESTS};do
+
+ TESTNAME=$(basename ${TEST} .bnd)
+
+ echo -n " TEST: ${TESTNAME}......"
+ outline
+
+ echo ${GENJSBIND} -d -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+
+ ${GENJSBIND} -d -v -I ${IDLDIR} -o ${BUILDDIR}/test_${TESTNAME}.c ${TEST} >>${LOGFILE} 2>&1
+
+ if [ $? -eq 0 ]; then
+ echo "PASS"
+ else
+ echo "FAIL"
+ fi
+
+
+done
+
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
nsgenjsbind: branch master updated. 1c7bc7e17ace1e457c4c0336353f142aef36d254
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/1c7bc7e17ace1e457...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/1c7bc7e17ace1e457c4...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/1c7bc7e17ace1e457c4c0...
The branch, master has been updated
via 1c7bc7e17ace1e457c4c0336353f142aef36d254 (commit)
from d908eab7b9976c2b402cb92fa5ac77a89a112de4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/1c7bc7e17ace1e4...
commit 1c7bc7e17ace1e457c4c0336353f142aef36d254
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Fix up bison usage
diff --git a/src/Makefile b/src/Makefile
index 6b328ae..232a7dd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,42 +1,9 @@
-#
+CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
-#CFLAGS+=-Wall
-
-#.PHONY: all clean
-
-#all: genjsbind
-
-#genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
-# $(CC) -o $@ $^
-
-#webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
-
-#webidl-parser.h webidl-parser.c: webidl-parser.y
-# bison -t $<
-
-#webidl-lexer.h: webidl-lexer.c
-
-#webidl-lexer.c: webidl-lexer.l
-# flex $<
-
-
-#genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
-
-#genbind-parser.h genbind-parser.c: genbind-parser.y
-# bison -t $<
-
-#genbind-lexer.h: genbind-lexer.c
-
-#genbind-lexer.c: genbind-lexer.l
-# flex $<
-
-
-#genjsbind.o: webidl-parser.h genbind-parser.h
-
-#clean:
-# $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
+# Sources in this directory
+DIR_SOURCES := genjsbind.c
-CFLAGS+=-I$(BUILDDIR) -Isrc/
+SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
@@ -44,15 +11,27 @@ $(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-parser.h
+# Bison 2.6 and later require api.prefix, but this breaks Bison 2.5 and earlier.
+bisonvsn := $(word 4,$(shell bison --version))
+bisonmaj := $(word 1,$(subst ., ,$(bisonvsn)))
+bisonmin := $(word 2,$(subst ., ,$(bisonvsn)))
+ifeq ($(bisonmaj),1)
+ BISON_DEFINES = --name-prefix=$(*F)_
+else
+ ifeq ($(bisonmaj),2)
+ ifneq ($(findstring $(bisonmin),"0 1 2 3 4 5"),)
+ BISON_DEFINES = --name-prefix=$(*F)_
+ else
+ BISON_DEFINES = --define=api.prefix=$(*F)_
+ endif
+ else
+ BISON_DEFINES = --define=api.prefix=$(*F)_
+ endif
+endif
+
$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
$(VQ)$(ECHO) " BISON: $<"
- $(Q)bison -d -t --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
-
-
-# Sources in this directory
-DIR_SOURCES := genjsbind.c
-
-SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
+ $(Q)bison -d -t $(BISON_DEFINES) --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
# Grab the core makefile
include $(NSBUILD)/Makefile.subdir
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
index 42330f7..cad20b4 100644
--- a/src/genbind-parser.y
+++ b/src/genbind-parser.y
@@ -29,8 +29,6 @@ int genbind_wrap()
%}
%define api.pure
-%define api.prefix "genbind_"
-%name-prefix "genbind_"
%union
{
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index bcc93ba..73ed2c6 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -32,8 +32,6 @@ int webidl_wrap()
%locations
%define api.pure
-%define api.prefix "webidl_"
-%name-prefix "webidl_"
%union
{
-----------------------------------------------------------------------
Summary of changes:
src/Makefile | 67 +++++++++++++++++--------------------------------
src/genbind-parser.y | 2 -
src/webidl-parser.y | 2 -
3 files changed, 23 insertions(+), 48 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 6b328ae..232a7dd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,42 +1,9 @@
-#
+CFLAGS := $(CFLAGS) -I$(BUILDDIR) -Isrc/
-#CFLAGS+=-Wall
-
-#.PHONY: all clean
-
-#all: genjsbind
-
-#genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
-# $(CC) -o $@ $^
-
-#webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
-
-#webidl-parser.h webidl-parser.c: webidl-parser.y
-# bison -t $<
-
-#webidl-lexer.h: webidl-lexer.c
-
-#webidl-lexer.c: webidl-lexer.l
-# flex $<
-
-
-#genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
-
-#genbind-parser.h genbind-parser.c: genbind-parser.y
-# bison -t $<
-
-#genbind-lexer.h: genbind-lexer.c
-
-#genbind-lexer.c: genbind-lexer.l
-# flex $<
-
-
-#genjsbind.o: webidl-parser.h genbind-parser.h
-
-#clean:
-# $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
+# Sources in this directory
+DIR_SOURCES := genjsbind.c
-CFLAGS+=-I$(BUILDDIR) -Isrc/
+SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
@@ -44,15 +11,27 @@ $(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-parser.h
+# Bison 2.6 and later require api.prefix, but this breaks Bison 2.5 and earlier.
+bisonvsn := $(word 4,$(shell bison --version))
+bisonmaj := $(word 1,$(subst ., ,$(bisonvsn)))
+bisonmin := $(word 2,$(subst ., ,$(bisonvsn)))
+ifeq ($(bisonmaj),1)
+ BISON_DEFINES = --name-prefix=$(*F)_
+else
+ ifeq ($(bisonmaj),2)
+ ifneq ($(findstring $(bisonmin),"0 1 2 3 4 5"),)
+ BISON_DEFINES = --name-prefix=$(*F)_
+ else
+ BISON_DEFINES = --define=api.prefix=$(*F)_
+ endif
+ else
+ BISON_DEFINES = --define=api.prefix=$(*F)_
+ endif
+endif
+
$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
$(VQ)$(ECHO) " BISON: $<"
- $(Q)bison -d -t --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
-
-
-# Sources in this directory
-DIR_SOURCES := genjsbind.c
-
-SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
+ $(Q)bison -d -t $(BISON_DEFINES) --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
# Grab the core makefile
include $(NSBUILD)/Makefile.subdir
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
index 42330f7..cad20b4 100644
--- a/src/genbind-parser.y
+++ b/src/genbind-parser.y
@@ -29,8 +29,6 @@ int genbind_wrap()
%}
%define api.pure
-%define api.prefix "genbind_"
-%name-prefix "genbind_"
%union
{
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index bcc93ba..73ed2c6 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -32,8 +32,6 @@ int webidl_wrap()
%locations
%define api.pure
-%define api.prefix "webidl_"
-%name-prefix "webidl_"
%union
{
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
nsgenjsbind: branch master created. d908eab7b9976c2b402cb92fa5ac77a89a112de4
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/d908eab7b9976c2b4...
...commit http://git.netsurf-browser.org/nsgenjsbind.git/commit/d908eab7b9976c2b402...
...tree http://git.netsurf-browser.org/nsgenjsbind.git/tree/d908eab7b9976c2b402cb...
The branch, master has been created
at d908eab7b9976c2b402cb92fa5ac77a89a112de4 (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/d908eab7b9976c2...
commit d908eab7b9976c2b402cb92fa5ac77a89a112de4
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
cause objects to link
diff --git a/Makefile b/Makefile
index 27703b9..eab056a 100644
--- a/Makefile
+++ b/Makefile
@@ -15,4 +15,4 @@ include $(NSBUILD)/Makefile.top
# Add extra install rules for our pkg-config control file and the library itself
#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
-#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
+INSTALL_ITEMS := $(INSTALL_ITEMS) /bin:$(BUILDDIR)/$(COMPONENT)$(EXEEXT)
diff --git a/src/Makefile b/src/Makefile
index 04e677a..6b328ae 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -36,7 +36,7 @@
#clean:
# $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
-CFLAGS+=-I$(BUILDDIR)
+CFLAGS+=-I$(BUILDDIR) -Isrc/
$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
$(VQ)$(ECHO) " FLEX: $<"
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/d07389640527793...
commit d07389640527793522ef553ce974fdd46f15c8f0
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
start using core buildsystem
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..27703b9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+# Define the component name
+COMPONENT := genjsbind
+# And the component type
+COMPONENT_TYPE := binary
+# Component version
+COMPONENT_VERSION := 0.0.1
+
+# Tooling
+PREFIX ?= /opt/netsurf
+NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem
+include $(NSSHARED)/makefiles/Makefile.tools
+
+# Grab the core makefile
+include $(NSBUILD)/Makefile.top
+
+# Add extra install rules for our pkg-config control file and the library itself
+#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
+#INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
diff --git a/src/Makefile b/src/Makefile
index c0feb20..04e677a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,37 +1,58 @@
#
-CFLAGS+=-Wall
+#CFLAGS+=-Wall
-.PHONY: all clean
+#.PHONY: all clean
-all: genjsbind
+#all: genjsbind
-genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
- $(CC) -o $@ $^
+#genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
+# $(CC) -o $@ $^
-webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
+#webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
-webidl-parser.h webidl-parser.c: webidl-parser.y
- bison -t $<
+#webidl-parser.h webidl-parser.c: webidl-parser.y
+# bison -t $<
-webidl-lexer.h: webidl-lexer.c
+#webidl-lexer.h: webidl-lexer.c
-webidl-lexer.c: webidl-lexer.l
- flex $<
+#webidl-lexer.c: webidl-lexer.l
+# flex $<
-genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
+#genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
-genbind-parser.h genbind-parser.c: genbind-parser.y
- bison -t $<
+#genbind-parser.h genbind-parser.c: genbind-parser.y
+# bison -t $<
-genbind-lexer.h: genbind-lexer.c
+#genbind-lexer.h: genbind-lexer.c
-genbind-lexer.c: genbind-lexer.l
- flex $<
+#genbind-lexer.c: genbind-lexer.l
+# flex $<
-genjsbind.o: webidl-parser.h genbind-parser.h
+#genjsbind.o: webidl-parser.h genbind-parser.h
-clean:
- $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
+#clean:
+# $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
+
+CFLAGS+=-I$(BUILDDIR)
+
+$(BUILDDIR)/%-lexer.c $(BUILDDIR)/%-lexer.h: src/%-lexer.l
+ $(VQ)$(ECHO) " FLEX: $<"
+ $(Q)flex --outfile=$(BUILDDIR)/$(*F)-lexer.c --header-file=$(BUILDDIR)/$(*F)-lexer.h $<
+
+$(BUILDDIR)/%-lexer.c: $(BUILDDIR)/%-parser.h
+
+$(BUILDDIR)/%-parser.c $(BUILDDIR)/%-parser.h: src/%-parser.y
+ $(VQ)$(ECHO) " BISON: $<"
+ $(Q)bison -d -t --output=$(BUILDDIR)/$(*F)-parser.c --defines=$(BUILDDIR)/$(*F)-parser.h $<
+
+
+# Sources in this directory
+DIR_SOURCES := genjsbind.c
+
+SOURCES := $(SOURCES) $(BUILDDIR)/genbind-parser.c $(BUILDDIR)/genbind-lexer.c $(BUILDDIR)/webidl-parser.c $(BUILDDIR)/webidl-lexer.c
+
+# Grab the core makefile
+include $(NSBUILD)/Makefile.subdir
diff --git a/src/genbind-lexer.l b/src/genbind-lexer.l
index 010a384..6150f09 100644
--- a/src/genbind-lexer.l
+++ b/src/genbind-lexer.l
@@ -3,8 +3,6 @@
*/
/* lexer options */
-%option outfile="genbind-lexer.c"
-%option header-file="genbind-lexer.h"
%option never-interactive
%option bison-bridge
%option nodefault
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
index 309f01e..42330f7 100644
--- a/src/genbind-parser.y
+++ b/src/genbind-parser.y
@@ -28,10 +28,8 @@ int genbind_wrap()
%}
-%output "genbind-parser.c"
-%defines "genbind-parser.h"
-
%define api.pure
+%define api.prefix "genbind_"
%name-prefix "genbind_"
%union
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
index f605575..1d2db67 100644
--- a/src/webidl-lexer.l
+++ b/src/webidl-lexer.l
@@ -10,8 +10,6 @@
*/
/* lexer options */
-%option outfile="webidl-lexer.c"
-%option header-file="webidl-lexer.h"
%option never-interactive
%option yylineno
%option bison-bridge
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
index d5859ff..bcc93ba 100644
--- a/src/webidl-parser.y
+++ b/src/webidl-parser.y
@@ -30,11 +30,9 @@ int webidl_wrap()
%}
-%output "webidl-parser.c"
-%defines "webidl-parser.h"
-
%locations
%define api.pure
+%define api.prefix "webidl_"
%name-prefix "webidl_"
%union
commitdiff http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/dc672aedbafa7bf...
commit dc672aedbafa7bf24cd24430abcae2d57528cf41
Author: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Commit: Vincent Sanders <vincent.sanders(a)collabora.co.uk>
Initial version of netsurf webidl javascript binding geenrator tool
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..dd7ead0
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,7 @@
+*.o
+genbind
+webidl-lexer.c
+webidl-lexer.h
+webidl-parser.c
+webidl-parser.h
+
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..c0feb20
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,37 @@
+#
+
+CFLAGS+=-Wall
+
+.PHONY: all clean
+
+all: genjsbind
+
+genjsbind: genjsbind.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
+ $(CC) -o $@ $^
+
+webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
+
+webidl-parser.h webidl-parser.c: webidl-parser.y
+ bison -t $<
+
+webidl-lexer.h: webidl-lexer.c
+
+webidl-lexer.c: webidl-lexer.l
+ flex $<
+
+
+genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
+
+genbind-parser.h genbind-parser.c: genbind-parser.y
+ bison -t $<
+
+genbind-lexer.h: genbind-lexer.c
+
+genbind-lexer.c: genbind-lexer.l
+ flex $<
+
+
+genjsbind.o: webidl-parser.h genbind-parser.h
+
+clean:
+ $(RM) genjsbind genjsbind.o webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
diff --git a/src/genbind-lexer.l b/src/genbind-lexer.l
new file mode 100644
index 0000000..010a384
--- /dev/null
+++ b/src/genbind-lexer.l
@@ -0,0 +1,55 @@
+/*
+ * binding generator lexer
+ */
+
+/* lexer options */
+%option outfile="genbind-lexer.c"
+%option header-file="genbind-lexer.h"
+%option never-interactive
+%option bison-bridge
+%option nodefault
+%option warn
+%option debug
+%option prefix="genbind_"
+%option nounput
+
+/* header block */
+%{
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+
+%}
+
+ /* other Unicode “space separator” */
+USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
+
+/* non breaking space \u00A0 */
+NBSP (\xc2\xa0)
+
+whitespace ([ \t\v\f\n]|{NBSP}|{USP})
+
+multicomment \/\*(([^*])|(\*[^/]))*\*\/
+
+quotedstring [^\"\\\n\r]
+
+other [^\t\n\r 0-9A-Z_a-z]
+
+%%
+
+{whitespace} /* nothing */
+
+webidlfile return TOK_IDLFILE;
+
+\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
+
+{multicomment} /* nothing */
+
+{other} return (int) yytext[0];
+
+. /* nothing */
+
+%%
\ No newline at end of file
diff --git a/src/genbind-parser.y b/src/genbind-parser.y
new file mode 100644
index 0000000..309f01e
--- /dev/null
+++ b/src/genbind-parser.y
@@ -0,0 +1,62 @@
+/*
+ * This is a bison parser for genbind
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+#include "genbind-lexer.h"
+
+ extern int loadwebidl(char *filename);
+
+void genbind_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+
+int genbind_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%output "genbind-parser.c"
+%defines "genbind-parser.h"
+
+%define api.pure
+%name-prefix "genbind_"
+
+%union
+{
+ char* text;
+}
+
+%token TOK_IDLFILE
+
+%token <text> TOK_STRING_LITERAL
+
+%%
+
+ /* [1] start with instructions */
+Instructions:
+ /* empty */
+ |
+ IdlFile
+ ;
+
+IdlFile:
+ TOK_IDLFILE TOK_STRING_LITERAL
+ {
+ loadwebidl($2);
+ }
+ ;
+
+%%
diff --git a/src/genjsbind.c b/src/genjsbind.c
new file mode 100644
index 0000000..150c780
--- /dev/null
+++ b/src/genjsbind.c
@@ -0,0 +1,52 @@
+#include <stdio.h>
+
+#include "webidl-ast.h"
+
+#include "webidl-parser.h"
+#include "genbind-parser.h"
+
+extern int webidl_debug;
+extern FILE* webidl_in;
+extern int webidl_parse();
+
+extern int genbind_debug;
+extern FILE* genbind_in;
+extern int genbind_parse();
+
+int loadwebidl(char *filename)
+{
+ FILE *myfile = fopen(filename, "r");
+ if (!myfile) {
+ perror(filename);
+ return 2;
+ }
+ /* set flex to read from file */
+ webidl_in = myfile;
+
+ webidl_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(webidl_in)) {
+ webidl_parse();
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ FILE *myfile = fopen("htmldocument.bnd", "r");
+ if (!myfile) {
+ perror(NULL);
+ return 2;
+ }
+ /* set flex to read from file */
+ genbind_in = myfile;
+
+ genbind_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(genbind_in)) {
+ genbind_parse();
+ }
+ return 0;
+}
diff --git a/src/webidl-ast.h b/src/webidl-ast.h
new file mode 100644
index 0000000..96d7c2a
--- /dev/null
+++ b/src/webidl-ast.h
@@ -0,0 +1,2 @@
+ struct ifmembers_s {
+ };
diff --git a/src/webidl-lexer.l b/src/webidl-lexer.l
new file mode 100644
index 0000000..f605575
--- /dev/null
+++ b/src/webidl-lexer.l
@@ -0,0 +1,284 @@
+/*
+ * This is a unicode capable lexer for web IDL mostly derived from:
+ *
+ * W3C WEB IDL - http://www.w3.org/TR/WebIDL/ (especially the grammar
+ * in apendix A)
+ *
+ * The ECMA script spec -
+ * http://ecma-international.org/ecma-262/5.1/#sec-7.2 (expecially
+ * section 7.2 for unicode value handling)
+ */
+
+/* lexer options */
+%option outfile="webidl-lexer.c"
+%option header-file="webidl-lexer.h"
+%option never-interactive
+%option yylineno
+%option bison-bridge
+%option bison-locations
+%option nodefault
+%option warn
+%option debug
+%option prefix="webidl_"
+%option nounput
+
+/* header block */
+%{
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "webidl-parser.h"
+
+#define YY_USER_ACTION yylloc->first_line = yylloc->last_line; \
+ yylloc->first_column = yylloc->last_column + 1; \
+ yylloc->last_column += yyleng;
+
+%}
+
+/* regular definitions */
+
+ /* ecmascript section 7.2 defines whitespace http://ecma-international.org/ecma-262/5.1/#sec-7.2
+ * Web IDL appendix A has the IDL grammar http://www.w3.org/TR/WebIDL/#idl-grammar
+ */
+
+ /* we do not define space, line feed, carriage return, tab, vertical
+ * tab or form feed here as they are the standard C escapes
+ */
+
+ /* other Unicode “space separator” */
+USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
+
+/* Line separator \u2028 */
+LS (\xe2\x80\xa8)
+
+/* paragraph separator \u2029 */
+PS (\xe2\x80\xa9)
+
+/* non breaking space \u00A0 */
+NBSP (\xc2\xa0)
+
+/* web idl grammar for whitespace matches single and multiline
+ * comments too. Here there are separate definitions for both single
+ * and multiline comments.
+ */
+whitespace ([ \t\v\f]|{NBSP}|{USP})
+multicomment \/\*(([^*])|(\*[^/]))*\*\/
+singlecomment \/\/
+lineend ([\n\r]|{LS}|{PS})
+
+/* integer numbers in hexidecimal, decimal and octal, slight extension
+ * to spec which only allows for decimal values
+ */
+hexdigit [0-9A-Fa-f]
+hexint 0(x|X){hexdigit}+
+
+decimalint 0|([1-9][0-9]*)
+
+octalint (0[0-8]+)
+
+/* decimal floating point number */
+decimalexponent (e|E)[\+\-]?[0-9]+
+decimalfloat ({decimalint}\.[0-9]*{decimalexponent}?)|(\.[0-9]+{decimalexponent}?)|({decimalint}{decimalexponent}?)
+
+/* quoted string. spec simply has "[^"]*" but here escapes are allowed for */
+hexescseq x{hexdigit}{2}
+unicodeescseq u{hexdigit}{4}
+characterescseq ['\"\\bfnrtv]|[^'\"\\bfnrtv\n\r]
+escseq {characterescseq}|0|{hexescseq}|{unicodeescseq}
+quotedstring ([^\"\\\n\r]|\\{escseq})
+
+/* web idl identifier direct from spec */
+Identifier [A-Z_a-z][0-9A-Z_a-z]*
+
+/* web idl other direct from spec */
+other [^\t\n\r 0-9A-Z_a-z]
+
+/* used for #include directive - not part of web idl spec */
+poundsign ^{whitespace}*#
+
+%x incl
+%%
+
+{whitespace} ++yylloc->last_column; /* skip whitespace */
+
+{lineend} if (yytext[0] == '\n') {
+ /* update position counts */
+ ++yylloc->last_line;
+ yylloc->last_column = 0;
+ }
+
+ /* Simple text terminals */
+
+boolean return TOK_BOOLEAN;
+
+byte return TOK_BYTE;
+
+octet return TOK_OCTET;
+
+attribute return TOK_ATTRIBUTE;
+
+callback return TOK_CALLBACK;
+
+const return TOK_CONST;
+
+creator return TOK_CREATOR;
+
+deleter return TOK_DELETER;
+
+dictionary return TOK_DICTIONARY;
+
+enum return TOK_ENUM;
+
+exception return TOK_EXCEPTION;
+
+getter return TOK_GETTER;
+
+implements return TOK_IMPLEMENTS;
+
+inherit return TOK_INHERIT;
+
+interface return TOK_INTERFACE;
+
+legacycaller return TOK_LEGACYCALLER;
+
+partial return TOK_PARTIAL;
+
+setter return TOK_SETTER;
+
+static return TOK_STATIC;
+
+stringifier return TOK_STRINGIFIER;
+
+typedef return TOK_TYPEDEF;
+
+unrestricted return TOK_UNRESTRICTED;
+
+"..." return TOK_ELLIPSIS;
+
+Date return TOK_DATE;
+
+DOMString return TOK_STRING; /* dom strings are just strings */
+
+Infinity return TOK_INFINITY;
+
+NaN return TOK_NAN;
+
+any return TOK_ANY;
+
+double return TOK_DOUBLE;
+
+false return TOK_FALSE;
+
+float return TOK_FLOAT;
+
+long return TOK_LONG;
+
+null return TOK_NULL_LITERAL;
+
+object yylval->text = strdup(yytext); return TOK_IDENTIFIER;
+
+or return TOK_OR;
+
+optional return TOK_OPTIONAL;
+
+sequence return TOK_SEQUENCE;
+
+short return TOK_SHORT;
+
+true return TOK_TRUE;
+
+unsigned return TOK_UNSIGNED;
+
+void return TOK_VOID;
+
+readonly return TOK_READONLY;
+
+
+{Identifier} {
+ // A leading "_" is used to escape an identifier from looking like a reserved word terminal.
+ yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
+ return TOK_IDENTIFIER;
+ }
+
+{decimalint} yylval->value = strtol(yytext, NULL, 10); return TOK_INT_LITERAL;
+
+{octalint} yylval->value = strtol(yytext, NULL, 8); return TOK_INT_LITERAL;
+
+{hexint} yylval->value = strtol(yytext, NULL, 16); return TOK_INT_LITERAL;
+
+{decimalfloat} yylval->text = strdup(yytext); return TOK_FLOAT_LITERAL;
+
+\"{quotedstring}*\" yylval->text = strdup(yytext); return TOK_STRING_LITERAL;
+
+{multicomment} {
+ /* multicomment */
+ char* s = yytext;
+ for (; *s; ++s)
+ {
+ if (*s == '\n')
+ {
+ ++yylloc->last_line;
+ yylloc->last_column = 0;
+ }
+ else
+ {
+ ++yylloc->last_column;
+ }
+ }
+ if (strncmp(yytext, "/**", 3) == 0)
+ {
+ /* Javadoc style comment */
+ yylval->text = strdup(yytext);
+ return TOK_JAVADOC;
+ }
+ }
+
+{singlecomment} {
+ /* singlecomment */
+ int c;
+
+ do {
+ c = input();
+ } while (c != '\n' && c != '\r' && c != EOF);
+ ++yylloc->last_line;
+ yylloc->last_column = 0;
+ }
+
+
+
+{poundsign}include BEGIN(incl);
+
+{other} return (int) yytext[0];
+
+<incl>[ \t]*\" /* eat the whitespace and open quotes */
+
+<incl>[^\t\n\"]+ {
+ /* got the include file name */
+ yyin = fopen( yytext, "r" );
+
+ if ( ! yyin ) {
+ fprintf(stderr, "Unable to open include %s\n", yytext);
+ exit(3);
+ }
+ yypush_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ));
+
+ BEGIN(INITIAL);
+ }
+
+<incl>\n BEGIN(INITIAL);
+
+<<EOF>> {
+ yypop_buffer_state();
+
+ if ( !YY_CURRENT_BUFFER ) {
+ yyterminate();
+ } else {
+ BEGIN(incl);
+ }
+
+ }
+
+
+%%
diff --git a/src/webidl-parser.y b/src/webidl-parser.y
new file mode 100644
index 0000000..d5859ff
--- /dev/null
+++ b/src/webidl-parser.y
@@ -0,0 +1,762 @@
+/*
+ * This is a bison parser for web IDL derived from the the grammar in
+ * apendix A of W3C WEB IDL - http://www.w3.org/TR/WebIDL/
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "webidl-ast.h"
+
+#include "webidl-parser.h"
+#include "webidl-lexer.h"
+
+
+
+void webidl_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+int webidl_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%output "webidl-parser.c"
+%defines "webidl-parser.h"
+
+%locations
+%define api.pure
+%name-prefix "webidl_"
+
+%union
+{
+ int attr;
+ char* text;
+ long value;
+ struct ifmember_s **ifmember;
+}
+
+
+%token TOK_ANY
+%token TOK_ATTRIBUTE
+%token TOK_BOOLEAN
+%token TOK_BYTE
+%token TOK_CALLBACK
+%token TOK_LEGACYCALLER
+%token TOK_CONST
+%token TOK_CREATOR
+%token TOK_DATE
+%token TOK_DELETER
+%token TOK_DICTIONARY
+%token TOK_DOUBLE
+%token TOK_ELLIPSIS
+%token TOK_ENUM
+%token TOK_EOL
+%token TOK_EXCEPTION
+%token TOK_FALSE
+%token TOK_FLOAT
+%token TOK_GETRAISES
+%token TOK_GETTER
+%token TOK_IMPLEMENTS
+%token TOK_IN
+%token TOK_INFINITY
+%token TOK_INHERIT
+%token TOK_INTERFACE
+%token TOK_LONG
+%token TOK_MODULE
+%token TOK_NAN
+%token TOK_NATIVE
+%token TOK_NULL_LITERAL
+%token TOK_OBJECT
+%token TOK_OCTET
+%token TOK_OMITTABLE
+%token TOK_OPTIONAL
+%token TOK_OR
+%token TOK_PARTIAL
+%token TOK_RAISES
+%token TOK_READONLY
+%token TOK_SETRAISES
+%token TOK_SETTER
+%token TOK_SEQUENCE
+%token TOK_SHORT
+%token TOK_STATIC
+%token TOK_STRING
+%token TOK_STRINGIFIER
+%token TOK_TRUE
+%token TOK_TYPEDEF
+%token TOK_UNRESTRICTED
+%token TOK_UNSIGNED
+%token TOK_VOID
+
+%token TOK_POUND_SIGN
+
+%token <text> TOK_IDENTIFIER
+%token <value> TOK_INT_LITERAL
+%token <text> TOK_FLOAT_LITERAL
+%token <text> TOK_STRING_LITERAL
+%token <text> TOK_OTHER_LITERAL
+%token <text> TOK_JAVADOC
+
+%type <text> Inheritance
+%type <ifmember> InterfaceMembers
+
+%%
+
+ /* [1] start with definitions */
+Definitions:
+ /* empty */
+ |
+ ExtendedAttributeList Definition Definitions
+ ;
+
+ /* [2] */
+Definition:
+ CallbackOrInterface
+ |
+ Partial
+ |
+ Dictionary
+ |
+ Exception
+ |
+ Enum
+ |
+ Typedef
+ |
+ ImplementsStatement
+ ;
+
+ /* [3] */
+CallbackOrInterface:
+ TOK_CALLBACK CallbackRestOrInterface
+ |
+ Interface
+ ;
+
+ /* [4] */
+CallbackRestOrInterface:
+ CallbackRest
+ |
+ Interface
+ ;
+
+ /* [5] */
+Interface:
+ TOK_INTERFACE TOK_IDENTIFIER Inheritance '{' InterfaceMembers '}' ';'
+ {
+ }
+ ;
+
+ /* [6] */
+Partial:
+ TOK_PARTIAL PartialDefinition
+ ;
+
+ /* [7] */
+PartialDefinition:
+ PartialInterface
+ |
+ PartialDictionary
+ ;
+
+ /* [8] */
+PartialInterface:
+ TOK_INTERFACE TOK_IDENTIFIER '{' InterfaceMembers '}' ';'
+ ;
+
+ /* [9] */
+InterfaceMembers:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ExtendedAttributeList InterfaceMember InterfaceMembers
+ {
+ $$ = NULL;
+ }
+ ;
+
+ /* [10] */
+InterfaceMember:
+ Const
+ |
+ AttributeOrOperation
+ ;
+
+ /* [11] */
+Dictionary:
+ TOK_DICTIONARY TOK_IDENTIFIER Inheritance '{' DictionaryMembers '}' ';'
+ ;
+
+ /* [12] */
+DictionaryMembers:
+ /* empty */
+ |
+ ExtendedAttributeList DictionaryMember DictionaryMembers
+ ;
+
+ /* [13] */
+DictionaryMember:
+ Type TOK_IDENTIFIER Default ";"
+ ;
+
+ /* [14] */
+PartialDictionary:
+ TOK_DICTIONARY TOK_IDENTIFIER '{' DictionaryMembers '}' ';'
+
+ /* [15] */
+Default:
+ /* empty */
+ |
+ '=' DefaultValue
+ ;
+
+
+ /* [16] */
+DefaultValue:
+ ConstValue
+ |
+ TOK_STRING_LITERAL
+ ;
+
+ /* [17] */
+Exception:
+ /* empty */
+ |
+ TOK_EXCEPTION TOK_IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
+ ;
+
+ /* [18] */
+ExceptionMembers:
+ /* empty */
+ |
+ ExtendedAttributeList ExceptionMember ExceptionMembers
+ ;
+
+ /* [19] returns a string */
+Inheritance:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ':' TOK_IDENTIFIER
+ {
+ $$ = $2;
+ }
+ ;
+
+/* [20] */
+Enum:
+ TOK_ENUM TOK_IDENTIFIER '{' EnumValueList '}' ';'
+ ;
+
+/* [21] */
+EnumValueList:
+ TOK_STRING_LITERAL EnumValues
+ ;
+
+/* [22] */
+EnumValues:
+ /* empty */
+ |
+ ',' TOK_STRING_LITERAL EnumValues
+ ;
+
+ /* [23] - bug in w3c grammar? it doesnt list the equals as a terminal */
+CallbackRest:
+ TOK_IDENTIFIER '=' ReturnType '(' ArgumentList ')' ';'
+
+ /* [24] */
+Typedef:
+ TOK_TYPEDEF ExtendedAttributeList Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [25] */
+ImplementsStatement:
+ TOK_IDENTIFIER TOK_IMPLEMENTS TOK_IDENTIFIER ';'
+ ;
+
+ /* [26] */
+Const:
+ TOK_CONST ConstType TOK_IDENTIFIER '=' ConstValue ';'
+ ;
+
+ /* [27] */
+ConstValue:
+ BooleanLiteral
+ |
+ FloatLiteral
+ |
+ TOK_INT_LITERAL
+ |
+ TOK_NULL_LITERAL
+ ;
+
+ /* [28] */
+BooleanLiteral:
+ TOK_TRUE
+ |
+ TOK_FALSE
+ ;
+
+ /* [29] */
+FloatLiteral:
+ TOK_FLOAT_LITERAL
+ |
+ '-' TOK_INFINITY
+ |
+ TOK_INFINITY
+ |
+ TOK_NAN
+ ;
+
+ /* [30] */
+AttributeOrOperation:
+ TOK_STRINGIFIER StringifierAttributeOrOperation
+ |
+ Attribute
+ |
+ Operation
+ ;
+
+ /* [31] */
+StringifierAttributeOrOperation:
+ Attribute
+ |
+ OperationRest
+ |
+ ';'
+ ;
+
+ /* [32] */
+Attribute:
+ Inherit ReadOnly TOK_ATTRIBUTE Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [33] */
+Inherit:
+ /* empty */
+ |
+ TOK_INHERIT
+ ;
+
+ /* [34] */
+ReadOnly:
+ /* empty */
+ |
+ TOK_READONLY
+ ;
+
+ /* [35] */
+Operation:
+ Qualifiers OperationRest
+ ;
+
+ /* [36] */
+Qualifiers:
+ TOK_STATIC
+ |
+ Specials
+ ;
+
+ /* [37] */
+Specials:
+ /* empty */
+ |
+ Special Specials
+ ;
+
+ /* [38] */
+Special:
+ TOK_GETTER
+ |
+ TOK_SETTER
+ |
+ TOK_CREATOR
+ |
+ TOK_DELETER
+ |
+ TOK_LEGACYCALLER
+ ;
+
+ /* [39] */
+OperationRest:
+ ReturnType OptionalIdentifier '(' ArgumentList ')' ';'
+ ;
+
+ /* [40] */
+OptionalIdentifier:
+ /* empty */
+ |
+ TOK_IDENTIFIER
+ ;
+
+
+ /* [41] */
+ArgumentList:
+ /* empty */
+ |
+ Argument Arguments
+ ;
+
+ /* [42] */
+Arguments:
+ /* empty */
+ |
+ ',' Argument Arguments
+ ;
+
+
+ /* [43] */
+Argument:
+ ExtendedAttributeList OptionalOrRequiredArgument
+ ;
+
+ /* [44] */
+OptionalOrRequiredArgument:
+ TOK_OPTIONAL Type ArgumentName Default
+ |
+ Type Ellipsis ArgumentName
+ ;
+
+ /* [45] */
+ArgumentName:
+ ArgumentNameKeyword
+ |
+ TOK_IDENTIFIER
+ ;
+
+ /* [46] */
+Ellipsis:
+ /* empty */
+ |
+ TOK_ELLIPSIS
+ ;
+
+ /* [47] */
+ExceptionMember:
+ Const
+ |
+ ExceptionField
+ ;
+
+ /* [48] */
+ExceptionField:
+ Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [49] extended attribute list inside square brackets */
+ExtendedAttributeList:
+ /* empty */
+ |
+ '[' ExtendedAttribute ExtendedAttributes ']'
+ ;
+
+ /* [50] extended attributes are separated with a comma */
+ExtendedAttributes:
+ /* empty */
+ |
+ ',' ExtendedAttribute ExtendedAttributes
+ ;
+
+ /* [51] extended attributes are nested with normal, square and curly braces */
+ExtendedAttribute:
+ '(' ExtendedAttributeInner ')' ExtendedAttributeRest
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeRest
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeRest
+ |
+ Other ExtendedAttributeRest
+ ;
+
+ /* [52] extended attributes can be space separated too */
+ExtendedAttributeRest:
+ /* empty */
+ |
+ ExtendedAttribute
+ ;
+
+ /* [53] extended attributes are nested with normal, square and curly braces */
+ExtendedAttributeInner:
+ /* empty */
+ |
+ '(' ExtendedAttributeInner ')' ExtendedAttributeInner
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeInner
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeInner
+ |
+ OtherOrComma ExtendedAttributeInner
+ ;
+
+ /* [54] */
+Other:
+ TOK_INT_LITERAL
+ |
+ TOK_FLOAT_LITERAL
+ |
+ TOK_IDENTIFIER
+ |
+ TOK_STRING_LITERAL
+ |
+ TOK_OTHER_LITERAL
+ |
+ '-'
+ |
+ '.'
+ |
+ TOK_ELLIPSIS
+ |
+ ':'
+ |
+ ';'
+ |
+ '<'
+ |
+ '='
+ |
+ '>'
+ |
+ '?'
+ |
+ TOK_DATE
+ |
+ TOK_STRING
+ |
+ TOK_INFINITY
+ |
+ TOK_NAN
+ |
+ TOK_ANY
+ |
+ TOK_BOOLEAN
+ |
+ TOK_BYTE
+ |
+ TOK_DOUBLE
+ |
+ TOK_FALSE
+ |
+ TOK_FLOAT
+ |
+ TOK_LONG
+ |
+ TOK_NULL_LITERAL
+ |
+ TOK_OBJECT
+ |
+ TOK_OCTET
+ |
+ TOK_OR
+ |
+ TOK_OPTIONAL
+ |
+ TOK_SEQUENCE
+ |
+ TOK_SHORT
+ |
+ TOK_TRUE
+ |
+ TOK_UNSIGNED
+ |
+ TOK_VOID
+ |
+ ArgumentNameKeyword
+ ;
+
+ /* [55] */
+ArgumentNameKeyword:
+ TOK_ATTRIBUTE
+ |
+ TOK_CALLBACK
+ |
+ TOK_CONST
+ |
+ TOK_CREATOR
+ |
+ TOK_DELETER
+ |
+ TOK_DICTIONARY
+ |
+ TOK_ENUM
+ |
+ TOK_EXCEPTION
+ |
+ TOK_GETTER
+ |
+ TOK_IMPLEMENTS
+ |
+ TOK_INHERIT
+ |
+ TOK_INTERFACE
+ |
+ TOK_LEGACYCALLER
+ |
+ TOK_PARTIAL
+ |
+ TOK_SETTER
+ |
+ TOK_STATIC
+ |
+ TOK_STRINGIFIER
+ |
+ TOK_TYPEDEF
+ |
+ TOK_UNRESTRICTED
+ ;
+
+ /* [56] as it says an other element or a comma */
+OtherOrComma:
+ Other
+ |
+ ','
+ ;
+
+ /* [57] */
+Type:
+ SingleType
+ |
+ UnionType TypeSuffix
+ ;
+
+ /* [58] */
+SingleType:
+ NonAnyType
+ |
+ TOK_ANY TypeSuffixStartingWithArray
+ ;
+
+ /* [59] */
+UnionType:
+ '(' UnionMemberType TOK_OR UnionMemberType UnionMemberTypes ')'
+ ;
+
+ /* [60] */
+UnionMemberType:
+ NonAnyType
+ |
+ UnionType TypeSuffix
+ |
+ TOK_ANY '[' ']' TypeSuffix
+ ;
+
+ /* [61] */
+UnionMemberTypes:
+ /* empty */
+ |
+ TOK_OR UnionMemberType UnionMemberTypes
+ ;
+
+ /* [62] */
+NonAnyType:
+ PrimitiveType TypeSuffix
+ |
+ TOK_STRING TypeSuffix
+ |
+ TOK_IDENTIFIER TypeSuffix
+ |
+ TOK_SEQUENCE '<' Type '>' Null
+ |
+ TOK_OBJECT TypeSuffix
+ |
+ TOK_DATE TypeSuffix
+ ;
+
+ /* [63] */
+ConstType:
+ PrimitiveType Null
+ |
+ TOK_IDENTIFIER Null
+ ;
+
+ /* [64] */
+PrimitiveType:
+ UnsignedIntegerType
+ |
+ UnrestrictedFloatType
+ |
+ TOK_BOOLEAN
+ |
+ TOK_BYTE
+ |
+ TOK_OCTET
+ ;
+
+ /* [65] */
+UnrestrictedFloatType:
+ TOK_UNRESTRICTED FloatType
+ |
+ FloatType
+ ;
+
+ /* [66] */
+FloatType:
+ TOK_FLOAT
+ |
+ TOK_DOUBLE
+ ;
+
+ /* [67] */
+UnsignedIntegerType:
+ TOK_UNSIGNED IntegerType
+ |
+ IntegerType
+ ;
+
+ /* [68] */
+IntegerType:
+ TOK_SHORT
+ |
+ TOK_LONG OptionalLong
+ ;
+
+ /* [69] */
+OptionalLong:
+ /* empty */
+ |
+ TOK_LONG
+ ;
+
+ /* [70] */
+TypeSuffix:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ |
+ '?' TypeSuffixStartingWithArray
+ ;
+
+ /* [71] */
+TypeSuffixStartingWithArray:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ ;
+
+ /* [72] */
+Null:
+ /* empty */
+ |
+ '?'
+ ;
+
+ /* [73] */
+ReturnType:
+ Type
+ |
+ TOK_VOID
+ ;
+
+%%
diff --git a/test/document.idl b/test/document.idl
new file mode 100644
index 0000000..afab566
--- /dev/null
+++ b/test/document.idl
@@ -0,0 +1,37 @@
+interface Document : Node {
+ readonly attribute DOMImplementation implementation;
+ readonly attribute DOMString URL;
+ readonly attribute DOMString documentURI;
+ readonly attribute DOMString compatMode;
+ readonly attribute DOMString characterSet;
+ readonly attribute DOMString contentType;
+
+ readonly attribute DocumentType? doctype;
+ readonly attribute Element? documentElement;
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+ Element? getElementById(DOMString elementId);
+
+ Element createElement(DOMString localName);
+ Element createElementNS(DOMString? namespace, DOMString qualifiedName);
+ DocumentFragment createDocumentFragment();
+ Text createTextNode(DOMString data);
+ Comment createComment(DOMString data);
+ ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
+
+ Node importNode(Node node, optional boolean deep = true);
+ Node adoptNode(Node node);
+
+ Event createEvent(DOMString interface);
+
+ Range createRange();
+
+ // NodeFilter.SHOW_ALL = 0xFFFFFFFF
+ NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+ TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
+
+ // NEW
+ void prepend((Node or DOMString)... nodes);
+ void append((Node or DOMString)... nodes);
+};
diff --git a/test/eventtarget.idl b/test/eventtarget.idl
new file mode 100644
index 0000000..2cfd15e
--- /dev/null
+++ b/test/eventtarget.idl
@@ -0,0 +1,5 @@
+interface EventTarget {
+ void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
+ boolean dispatchEvent(Event event);
+};
diff --git a/test/htmldocument.bnd b/test/htmldocument.bnd
new file mode 100644
index 0000000..6f02c75
--- /dev/null
+++ b/test/htmldocument.bnd
@@ -0,0 +1,3 @@
+/* test binding docuemnt */
+
+webidlfile "htmldocument.idl"
diff --git a/test/htmldocument.idl b/test/htmldocument.idl
new file mode 100644
index 0000000..923aa08
--- /dev/null
+++ b/test/htmldocument.idl
@@ -0,0 +1,108 @@
+[OverrideBuiltins]
+partial interface Document {
+ // resource metadata management
+ [PutForwards=href] readonly attribute Location? location;
+ attribute DOMString domain;
+ readonly attribute DOMString referrer;
+ attribute DOMString cookie;
+ readonly attribute DOMString lastModified;
+ readonly attribute DOMString readyState;
+
+ // DOM tree accessors
+ getter object (DOMString name);
+ attribute DOMString title;
+ attribute DOMString dir;
+ attribute HTMLElement? body;
+ readonly attribute HTMLHeadElement? head;
+ readonly attribute HTMLCollection images;
+ readonly attribute HTMLCollection embeds;
+ readonly attribute HTMLCollection plugins;
+ readonly attribute HTMLCollection links;
+ readonly attribute HTMLCollection forms;
+ readonly attribute HTMLCollection scripts;
+ NodeList getElementsByName(DOMString elementName);
+ NodeList getItems(optional DOMString typeNames); // microdata
+ readonly attribute DOMElementMap cssElementMap;
+
+ // dynamic markup insertion
+ Document open(optional DOMString type, optional DOMString replace);
+ WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace);
+ void close();
+ void write(DOMString... text);
+ void writeln(DOMString... text);
+
+ // user interaction
+ readonly attribute WindowProxy? defaultView;
+ readonly attribute Element? activeElement;
+ boolean hasFocus();
+ attribute DOMString designMode;
+ boolean execCommand(DOMString commandId);
+ boolean execCommand(DOMString commandId, boolean showUI);
+ boolean execCommand(DOMString commandId, boolean showUI, DOMString value);
+ boolean queryCommandEnabled(DOMString commandId);
+ boolean queryCommandIndeterm(DOMString commandId);
+ boolean queryCommandState(DOMString commandId);
+ boolean queryCommandSupported(DOMString commandId);
+ DOMString queryCommandValue(DOMString commandId);
+ readonly attribute HTMLCollection commands;
+
+ // event handler IDL attributes
+ attribute EventHandler onabort;
+ attribute EventHandler onblur;
+ attribute EventHandler oncancel;
+ attribute EventHandler oncanplay;
+ attribute EventHandler oncanplaythrough;
+ attribute EventHandler onchange;
+ attribute EventHandler onclick;
+ attribute EventHandler onclose;
+ attribute EventHandler oncontextmenu;
+ attribute EventHandler oncuechange;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
+ attribute EventHandler ondurationchange;
+ attribute EventHandler onemptied;
+ attribute EventHandler onended;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
+ attribute EventHandler oninput;
+ attribute EventHandler oninvalid;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
+ attribute EventHandler onload;
+ attribute EventHandler onloadeddata;
+ attribute EventHandler onloadedmetadata;
+ attribute EventHandler onloadstart;
+ attribute EventHandler onmousedown;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
+ attribute EventHandler onpause;
+ attribute EventHandler onplay;
+ attribute EventHandler onplaying;
+ attribute EventHandler onprogress;
+ attribute EventHandler onratechange;
+ attribute EventHandler onreset;
+ attribute EventHandler onscroll;
+ attribute EventHandler onseeked;
+ attribute EventHandler onseeking;
+ attribute EventHandler onselect;
+ attribute EventHandler onshow;
+ attribute EventHandler onstalled;
+ attribute EventHandler onsubmit;
+ attribute EventHandler onsuspend;
+ attribute EventHandler ontimeupdate;
+ attribute EventHandler onvolumechange;
+ attribute EventHandler onwaiting;
+
+ // special event handler IDL attributes that only apply to Document objects
+ [LenientThis] attribute EventHandler onreadystatechange;
+};
diff --git a/test/window.idl b/test/window.idl
new file mode 100644
index 0000000..7114709
--- /dev/null
+++ b/test/window.idl
@@ -0,0 +1,119 @@
+#include "eventtarget.idl"
+
+[NamedPropertiesObject]
+interface Window : EventTarget {
+ // the current browsing context
+ [Unforgeable] readonly attribute WindowProxy window;
+ [Replaceable] readonly attribute WindowProxy self;
+ [Unforgeable] readonly attribute Document document;
+ attribute DOMString name;
+ [PutForwards=href, Unforgeable] readonly attribute Location location;
+ readonly attribute History history;
+ [Replaceable] readonly attribute BarProp locationbar;
+ [Replaceable] readonly attribute BarProp menubar;
+ [Replaceable] readonly attribute BarProp personalbar;
+ [Replaceable] readonly attribute BarProp scrollbars;
+ [Replaceable] readonly attribute BarProp statusbar;
+ [Replaceable] readonly attribute BarProp toolbar;
+ attribute DOMString status;
+ void close();
+ void stop();
+ void focus();
+ void blur();
+
+ // other browsing contexts
+ [Replaceable] readonly attribute WindowProxy frames;
+ [Replaceable] readonly attribute unsigned long length;
+ [Unforgeable] readonly attribute WindowProxy top;
+ attribute WindowProxy? opener;
+ readonly attribute WindowProxy parent;
+ readonly attribute Element? frameElement;
+ WindowProxy open(optional DOMString url, optional DOMString target, optional DOMString features, optional boolean replace);
+ getter WindowProxy (unsigned long index);
+ getter object (DOMString name);
+
+ // the user agent
+ readonly attribute Navigator navigator;
+ readonly attribute External external;
+ readonly attribute ApplicationCache applicationCache;
+
+ // user prompts
+ void alert(DOMString message);
+ boolean confirm(DOMString message);
+ DOMString? prompt(DOMString message, optional DOMString default);
+ void print();
+ any showModalDialog(DOMString url, optional any argument);
+
+ // cross-document messaging
+ void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
+
+ // event handler IDL attributes
+ attribute EventHandler onabort;
+ attribute EventHandler onafterprint;
+ attribute EventHandler onbeforeprint;
+ attribute EventHandler onbeforeunload;
+ attribute EventHandler onblur;
+ attribute EventHandler oncancel;
+ attribute EventHandler oncanplay;
+ attribute EventHandler oncanplaythrough;
+ attribute EventHandler onchange;
+ attribute EventHandler onclick;
+ attribute EventHandler onclose;
+ attribute EventHandler oncontextmenu;
+ attribute EventHandler oncuechange;
+ attribute EventHandler ondblclick;
+ attribute EventHandler ondrag;
+ attribute EventHandler ondragend;
+ attribute EventHandler ondragenter;
+ attribute EventHandler ondragleave;
+ attribute EventHandler ondragover;
+ attribute EventHandler ondragstart;
+ attribute EventHandler ondrop;
+ attribute EventHandler ondurationchange;
+ attribute EventHandler onemptied;
+ attribute EventHandler onended;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
+ attribute EventHandler onhashchange;
+ attribute EventHandler oninput;
+ attribute EventHandler oninvalid;
+ attribute EventHandler onkeydown;
+ attribute EventHandler onkeypress;
+ attribute EventHandler onkeyup;
+ attribute EventHandler onload;
+ attribute EventHandler onloadeddata;
+ attribute EventHandler onloadedmetadata;
+ attribute EventHandler onloadstart;
+ attribute EventHandler onmessage;
+ attribute EventHandler onmousedown;
+ attribute EventHandler onmousemove;
+ attribute EventHandler onmouseout;
+ attribute EventHandler onmouseover;
+ attribute EventHandler onmouseup;
+ attribute EventHandler onmousewheel;
+ attribute EventHandler onoffline;
+ attribute EventHandler ononline;
+ attribute EventHandler onpause;
+ attribute EventHandler onplay;
+ attribute EventHandler onplaying;
+ attribute EventHandler onpagehide;
+ attribute EventHandler onpageshow;
+ attribute EventHandler onpopstate;
+ attribute EventHandler onprogress;
+ attribute EventHandler onratechange;
+ attribute EventHandler onreset;
+ attribute EventHandler onresize;
+ attribute EventHandler onscroll;
+ attribute EventHandler onseeked;
+ attribute EventHandler onseeking;
+ attribute EventHandler onselect;
+ attribute EventHandler onshow;
+ attribute EventHandler onstalled;
+ attribute EventHandler onstorage;
+ attribute EventHandler onsubmit;
+ attribute EventHandler onsuspend;
+ attribute EventHandler ontimeupdate;
+ attribute EventHandler onunload;
+ attribute EventHandler onvolumechange;
+ attribute EventHandler onwaiting;
+};
-----------------------------------------------------------------------
--
NetSurf Generator for JavaScript bindings
10 years, 6 months
netsurf: branch vince/genbind updated. 36b607b979f2c04e4fa2386be8cd0c5ad191a1ba
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/36b607b979f2c04e4fa23...
...commit http://git.netsurf-browser.org/netsurf.git/commit/36b607b979f2c04e4fa2386...
...tree http://git.netsurf-browser.org/netsurf.git/tree/36b607b979f2c04e4fa2386be...
The branch, vince/genbind has been updated
via 36b607b979f2c04e4fa2386be8cd0c5ad191a1ba (commit)
via 8eeb466fd92a6cec32232651266e136b1f9fede9 (commit)
via a6798ef1b89a2eee44c3e885d833075258b2330d (commit)
via edaf5027d9936651cfae9d0837f20910be690b0c (commit)
via 0035ab8cf5df82dd0b316d5b4f4bde3f52c6975c (commit)
via de1bcd1f34727206e46b1faa4d9dc6b7d1a0f1a6 (commit)
from eb8612ec758807ed3e53d7fb39ce5a93f5ddfd4e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/36b607b979f2c04e4fa...
commit 36b607b979f2c04e4fa2386be8cd0c5ad191a1ba
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add parser for binding generator
diff --git a/javascript/idl/Makefile b/javascript/idl/Makefile
index ab98658..b9a0643 100644
--- a/javascript/idl/Makefile
+++ b/javascript/idl/Makefile
@@ -6,22 +6,32 @@ CFLAGS+=-Wall
all: genbind
-genbind: genbind.o webidl-parser.o webidl-lexer.o
+genbind: binder.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
$(CC) -o $@ $^
-webidl-parser.o:webidl-parser.c webidl-lexer.h
-
-webidl-lexer.h: webidl-lexer.c
+webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
webidl-parser.h webidl-parser.c: webidl.y
bison --report=state -t $<
+webidl-lexer.h: webidl-lexer.c
+
webidl-lexer.c: webidl.l
flex $<
-webidl-parser.o: webidl-parser.h
-genbind.o: webidl-parser.h
+genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
+
+genbind-parser.h genbind-parser.c: genbind.y
+ bison --report=state -t $<
+
+genbind-lexer.h: genbind-lexer.c
+
+genbind-lexer.c: genbind.l
+ flex $<
+
+
+binder.o: webidl-parser.h genbind-parser.h
clean:
- $(RM) genbind webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h *.o
+ $(RM) genbind webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
diff --git a/javascript/idl/binder.c b/javascript/idl/binder.c
new file mode 100644
index 0000000..150c780
--- /dev/null
+++ b/javascript/idl/binder.c
@@ -0,0 +1,52 @@
+#include <stdio.h>
+
+#include "webidl-ast.h"
+
+#include "webidl-parser.h"
+#include "genbind-parser.h"
+
+extern int webidl_debug;
+extern FILE* webidl_in;
+extern int webidl_parse();
+
+extern int genbind_debug;
+extern FILE* genbind_in;
+extern int genbind_parse();
+
+int loadwebidl(char *filename)
+{
+ FILE *myfile = fopen(filename, "r");
+ if (!myfile) {
+ perror(filename);
+ return 2;
+ }
+ /* set flex to read from file */
+ webidl_in = myfile;
+
+ webidl_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(webidl_in)) {
+ webidl_parse();
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ FILE *myfile = fopen("htmldocument.bnd", "r");
+ if (!myfile) {
+ perror(NULL);
+ return 2;
+ }
+ /* set flex to read from file */
+ genbind_in = myfile;
+
+ genbind_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(genbind_in)) {
+ genbind_parse();
+ }
+ return 0;
+}
diff --git a/javascript/idl/genbind.c b/javascript/idl/genbind.c
deleted file mode 100644
index 12ec8ab..0000000
--- a/javascript/idl/genbind.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-
-#include "webidl-parser.h"
-
-extern int webidl_debug;
-extern FILE* webidl_in;
-extern int webidl_parse();
-
-int main(int argc, char **argv)
-{
- FILE *myfile = fopen("htmldocument.idl", "r");
- if (!myfile) {
- perror(NULL);
- return 2;
- }
- /* set flex to read from file */
- webidl_in = myfile;
-
- webidl_debug = 1;
-
- /* parse through the input until there is no more: */
- while (!feof(webidl_in)) {
- webidl_parse();
- }
- return 0;
-}
diff --git a/javascript/idl/genbind.l b/javascript/idl/genbind.l
new file mode 100644
index 0000000..c658ee8
--- /dev/null
+++ b/javascript/idl/genbind.l
@@ -0,0 +1,56 @@
+/*
+ * binding generator lexer
+ */
+
+/* lexer options */
+%option outfile="genbind-lexer.c"
+%option header-file="genbind-lexer.h"
+%option never-interactive
+ /* %option yylineno */
+%option bison-bridge
+%option bison-locations
+%option nodefault
+%option warn
+%option debug
+%option prefix="genbind_"
+%option nounput
+
+/* header block */
+%{
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+
+%}
+
+ /* other Unicode “space separator” */
+USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
+
+/* non breaking space \u00A0 */
+NBSP (\xc2\xa0)
+
+whitespace ([ \t\v\f\n]|{NBSP}|{USP})
+multicomment \/\*(([^*])|(\*[^/]))*\*\/
+
+quotedstring [^\"\\\n\r]
+
+other [^\t\n\r 0-9A-Z_a-z]
+
+%%
+
+{whitespace} /* nothing */
+
+webidlfile return TOK_IDLFILE;
+
+\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
+
+{multicomment} /* nothing */
+
+{other} return (int) yytext[0];
+
+. /* nothing */
+
+%%
\ No newline at end of file
diff --git a/javascript/idl/genbind.y b/javascript/idl/genbind.y
new file mode 100644
index 0000000..533ff2b
--- /dev/null
+++ b/javascript/idl/genbind.y
@@ -0,0 +1,63 @@
+/*
+ * This is a bison parser for genbind
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+#include "genbind-lexer.h"
+
+ extern int loadwebidl(char *filename);
+
+void genbind_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+
+int genbind_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%output "genbind-parser.c"
+%defines "genbind-parser.h"
+
+%locations
+%define api.pure
+%name-prefix "genbind_"
+
+%union
+{
+ char* text;
+}
+
+%token TOK_IDLFILE
+
+%token <text> TOK_STRING_LITERAL
+
+%%
+
+ /* [1] start with instructions */
+Instructions:
+ /* empty */
+ |
+ IdlFile
+ ;
+
+IdlFile:
+ TOK_IDLFILE TOK_STRING_LITERAL
+ {
+ loadwebidl($2);
+ }
+ ;
+
+%%
diff --git a/javascript/idl/htmldocument.bnd b/javascript/idl/htmldocument.bnd
new file mode 100644
index 0000000..6f02c75
--- /dev/null
+++ b/javascript/idl/htmldocument.bnd
@@ -0,0 +1,3 @@
+/* test binding docuemnt */
+
+webidlfile "htmldocument.idl"
diff --git a/javascript/idl/webidl-ast.h b/javascript/idl/webidl-ast.h
new file mode 100644
index 0000000..96d7c2a
--- /dev/null
+++ b/javascript/idl/webidl-ast.h
@@ -0,0 +1,2 @@
+ struct ifmembers_s {
+ };
diff --git a/javascript/idl/webidl.l b/javascript/idl/webidl.l
index 19ce618..7828f67 100644
--- a/javascript/idl/webidl.l
+++ b/javascript/idl/webidl.l
@@ -26,11 +26,6 @@
/* header block */
%{
-/*
- * webidl.l file
- * To generate the lexical analyzer run: "flex webidl.l"
- *
- */
#include <stdbool.h>
#include <stdio.h>
diff --git a/javascript/idl/webidl.y b/javascript/idl/webidl.y
index 72b72b4..d5859ff 100644
--- a/javascript/idl/webidl.y
+++ b/javascript/idl/webidl.y
@@ -6,22 +6,17 @@
%{
-/*
- * webidl.y file
- * To generate the parser run: "bison webidl.y"
- */
-
#include <stdio.h>
#include <string.h>
+#include "webidl-ast.h"
+
#include "webidl-parser.h"
#include "webidl-lexer.h"
- struct ifmembers_s {
- };
-void yyerror(const char *str)
+void webidl_error(const char *str)
{
fprintf(stderr,"error: %s\n",str);
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/8eeb466fd92a6cec322...
commit 8eeb466fd92a6cec32232651266e136b1f9fede9
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add token prefix
add prefix to parser
add genbind main routine
diff --git a/javascript/idl/Makefile b/javascript/idl/Makefile
index f493774..ab98658 100644
--- a/javascript/idl/Makefile
+++ b/javascript/idl/Makefile
@@ -6,18 +6,22 @@ CFLAGS+=-Wall
all: genbind
-genbind: webidl-parser.o webidl-lexer.o
+genbind: genbind.o webidl-parser.o webidl-lexer.o
$(CC) -o $@ $^
webidl-parser.o:webidl-parser.c webidl-lexer.h
webidl-lexer.h: webidl-lexer.c
-webidl-parser.c: webidl.y
+webidl-parser.h webidl-parser.c: webidl.y
bison --report=state -t $<
webidl-lexer.c: webidl.l
flex $<
+webidl-parser.o: webidl-parser.h
+
+genbind.o: webidl-parser.h
+
clean:
$(RM) genbind webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h *.o
diff --git a/javascript/idl/genbind.c b/javascript/idl/genbind.c
new file mode 100644
index 0000000..12ec8ab
--- /dev/null
+++ b/javascript/idl/genbind.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+
+#include "webidl-parser.h"
+
+extern int webidl_debug;
+extern FILE* webidl_in;
+extern int webidl_parse();
+
+int main(int argc, char **argv)
+{
+ FILE *myfile = fopen("htmldocument.idl", "r");
+ if (!myfile) {
+ perror(NULL);
+ return 2;
+ }
+ /* set flex to read from file */
+ webidl_in = myfile;
+
+ webidl_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(webidl_in)) {
+ webidl_parse();
+ }
+ return 0;
+}
diff --git a/javascript/idl/webidl.l b/javascript/idl/webidl.l
index acaedb6..19ce618 100644
--- a/javascript/idl/webidl.l
+++ b/javascript/idl/webidl.l
@@ -21,6 +21,8 @@
%option nodefault
%option warn
%option debug
+%option prefix="webidl_"
+%option nounput
/* header block */
%{
@@ -107,111 +109,111 @@ poundsign ^{whitespace}*#
}
/* PrimitiveType terminals */
-boolean return BOOLEAN;
+boolean return TOK_BOOLEAN;
-byte return BYTE;
+byte return TOK_BYTE;
-octet return OCTET;
+octet return TOK_OCTET;
/* terminals */
-attribute return ATTRIBUTE;
+attribute return TOK_ATTRIBUTE;
-callback return CALLBACK;
+callback return TOK_CALLBACK;
-const return CONST;
+const return TOK_CONST;
-creator return CREATOR;
+creator return TOK_CREATOR;
-deleter return DELETER;
+deleter return TOK_DELETER;
-dictionary return DICTIONARY;
+dictionary return TOK_DICTIONARY;
-enum return ENUM;
+enum return TOK_ENUM;
-exception return EXCEPTION;
+exception return TOK_EXCEPTION;
-getter return GETTER;
+getter return TOK_GETTER;
-implements return IMPLEMENTS;
+implements return TOK_IMPLEMENTS;
-inherit return INHERIT;
+inherit return TOK_INHERIT;
-interface return INTERFACE;
+interface return TOK_INTERFACE;
-legacycaller return LEGACYCALLER;
+legacycaller return TOK_LEGACYCALLER;
-partial return PARTIAL;
+partial return TOK_PARTIAL;
-setter return SETTER;
+setter return TOK_SETTER;
-static return STATIC;
+static return TOK_STATIC;
-stringifier return STRINGIFIER;
+stringifier return TOK_STRINGIFIER;
-typedef return TYPEDEF;
+typedef return TOK_TYPEDEF;
-unrestricted return UNRESTRICTED;
+unrestricted return TOK_UNRESTRICTED;
-"..." return ELLIPSIS;
+"..." return TOK_ELLIPSIS;
-Date return DATE;
+Date return TOK_DATE;
-DOMString return STRING; /* dom strings are just strings */
+DOMString return TOK_STRING; /* dom strings are just strings */
-Infinity return INFINITY;
+Infinity return TOK_INFINITY;
-NaN return NAN;
+NaN return TOK_NAN;
-any return ANY;
+any return TOK_ANY;
-double return DOUBLE;
+double return TOK_DOUBLE;
-false return FALSE;
+false return TOK_FALSE;
-float return FLOAT;
+float return TOK_FLOAT;
-long return LONG;
+long return TOK_LONG;
-null return NULL_LITERAL;
+null return TOK_NULL_LITERAL;
-object yylval->text = strdup(yytext); return IDENTIFIER;
+object yylval->text = strdup(yytext); return TOK_IDENTIFIER;
-or return OR;
+or return TOK_OR;
-optional return OPTIONAL;
+optional return TOK_OPTIONAL;
-sequence return SEQUENCE;
+sequence return TOK_SEQUENCE;
-short return SHORT;
+short return TOK_SHORT;
-true return TRUE;
+true return TOK_TRUE;
-unsigned return UNSIGNED;
+unsigned return TOK_UNSIGNED;
-void return VOID;
+void return TOK_VOID;
/* Terminals not in the Other and ArgumentNameKeyword terminal lists */
-readonly return READONLY;
+readonly return TOK_READONLY;
{Identifier} {
// A leading "_" is used to escape an identifier from looking like a reserved word terminal.
yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
- return IDENTIFIER;
+ return TOK_IDENTIFIER;
}
-{DecimalIntegerLiteral} yylval->value = strtol(yytext, NULL, 10); return INT_LITERAL;
+{DecimalIntegerLiteral} yylval->value = strtol(yytext, NULL, 10); return TOK_INT_LITERAL;
-{OctalIntegerLiteral} yylval->value = strtol(yytext, NULL, 8); return INT_LITERAL;
+{OctalIntegerLiteral} yylval->value = strtol(yytext, NULL, 8); return TOK_INT_LITERAL;
-{HexIntegerLiteral} yylval->value = strtol(yytext, NULL, 16); return INT_LITERAL;
+{HexIntegerLiteral} yylval->value = strtol(yytext, NULL, 16); return TOK_INT_LITERAL;
-{DecimalLiteral} yylval->text = strdup(yytext); return FLOAT_LITERAL;
+{DecimalLiteral} yylval->text = strdup(yytext); return TOK_FLOAT_LITERAL;
-\"{quotedstring}*\" yylval->text = strdup(yytext); return STRING_LITERAL;
+\"{quotedstring}*\" yylval->text = strdup(yytext); return TOK_STRING_LITERAL;
{multicomment} {
/* multicomment */
@@ -232,7 +234,7 @@ readonly return READONLY;
{
/* Javadoc style comment */
yylval->text = strdup(yytext);
- return JAVADOC;
+ return TOK_JAVADOC;
}
}
diff --git a/javascript/idl/webidl.y b/javascript/idl/webidl.y
index 4295a03..72b72b4 100644
--- a/javascript/idl/webidl.y
+++ b/javascript/idl/webidl.y
@@ -17,7 +17,6 @@
#include "webidl-parser.h"
#include "webidl-lexer.h"
-extern int yydebug;
struct ifmembers_s {
};
@@ -27,16 +26,11 @@ void yyerror(const char *str)
fprintf(stderr,"error: %s\n",str);
}
-int yywrap()
+int webidl_wrap()
{
return 1;
}
-main()
-{
- yydebug = 1;
- yyparse();
-}
%}
@@ -46,75 +40,76 @@ main()
%locations
%define api.pure
+%name-prefix "webidl_"
%union
{
- int attr;
- char* text;
+ int attr;
+ char* text;
long value;
struct ifmember_s **ifmember;
}
-%token ANY
-%token ATTRIBUTE
-%token BOOLEAN
-%token BYTE
-%token CALLBACK
-%token LEGACYCALLER
-%token CONST
-%token CREATOR
-%token DATE
-%token DELETER
-%token DICTIONARY
-%token DOUBLE
-%token ELLIPSIS
-%token ENUM
-%token EOL
-%token EXCEPTION
-%token FALSE
-%token FLOAT
-%token GETRAISES
-%token GETTER
-%token IMPLEMENTS
-%token IN
-%token INFINITY
-%token INHERIT
-%token INTERFACE
-%token LONG
-%token MODULE
-%token NAN
-%token NATIVE
-%token NULL_LITERAL
-%token OBJECT
-%token OCTET
-%token OMITTABLE
-%token OPTIONAL
-%token OR
-%token PARTIAL
-%token RAISES
-%token READONLY
-%token SETRAISES
-%token SETTER
-%token SEQUENCE
-%token SHORT
-%token STATIC
-%token STRING
-%token STRINGIFIER
-%token TRUE
-%token TYPEDEF
-%token UNRESTRICTED
-%token UNSIGNED
-%token VOID
-
-%token POUND_SIGN
-
-%token <text> IDENTIFIER
-%token <value> INT_LITERAL
-%token <text> FLOAT_LITERAL
-%token <text> STRING_LITERAL
-%token <text> OTHER_LITERAL
-%token <text> JAVADOC
+%token TOK_ANY
+%token TOK_ATTRIBUTE
+%token TOK_BOOLEAN
+%token TOK_BYTE
+%token TOK_CALLBACK
+%token TOK_LEGACYCALLER
+%token TOK_CONST
+%token TOK_CREATOR
+%token TOK_DATE
+%token TOK_DELETER
+%token TOK_DICTIONARY
+%token TOK_DOUBLE
+%token TOK_ELLIPSIS
+%token TOK_ENUM
+%token TOK_EOL
+%token TOK_EXCEPTION
+%token TOK_FALSE
+%token TOK_FLOAT
+%token TOK_GETRAISES
+%token TOK_GETTER
+%token TOK_IMPLEMENTS
+%token TOK_IN
+%token TOK_INFINITY
+%token TOK_INHERIT
+%token TOK_INTERFACE
+%token TOK_LONG
+%token TOK_MODULE
+%token TOK_NAN
+%token TOK_NATIVE
+%token TOK_NULL_LITERAL
+%token TOK_OBJECT
+%token TOK_OCTET
+%token TOK_OMITTABLE
+%token TOK_OPTIONAL
+%token TOK_OR
+%token TOK_PARTIAL
+%token TOK_RAISES
+%token TOK_READONLY
+%token TOK_SETRAISES
+%token TOK_SETTER
+%token TOK_SEQUENCE
+%token TOK_SHORT
+%token TOK_STATIC
+%token TOK_STRING
+%token TOK_STRINGIFIER
+%token TOK_TRUE
+%token TOK_TYPEDEF
+%token TOK_UNRESTRICTED
+%token TOK_UNSIGNED
+%token TOK_VOID
+
+%token TOK_POUND_SIGN
+
+%token <text> TOK_IDENTIFIER
+%token <value> TOK_INT_LITERAL
+%token <text> TOK_FLOAT_LITERAL
+%token <text> TOK_STRING_LITERAL
+%token <text> TOK_OTHER_LITERAL
+%token <text> TOK_JAVADOC
%type <text> Inheritance
%type <ifmember> InterfaceMembers
@@ -147,7 +142,7 @@ Definition:
/* [3] */
CallbackOrInterface:
- CALLBACK CallbackRestOrInterface
+ TOK_CALLBACK CallbackRestOrInterface
|
Interface
;
@@ -161,14 +156,14 @@ CallbackRestOrInterface:
/* [5] */
Interface:
- INTERFACE IDENTIFIER Inheritance '{' InterfaceMembers '}' ';'
+ TOK_INTERFACE TOK_IDENTIFIER Inheritance '{' InterfaceMembers '}' ';'
{
}
;
/* [6] */
Partial:
- PARTIAL PartialDefinition
+ TOK_PARTIAL PartialDefinition
;
/* [7] */
@@ -180,7 +175,7 @@ PartialDefinition:
/* [8] */
PartialInterface:
- INTERFACE IDENTIFIER '{' InterfaceMembers '}' ';'
+ TOK_INTERFACE TOK_IDENTIFIER '{' InterfaceMembers '}' ';'
;
/* [9] */
@@ -205,7 +200,7 @@ InterfaceMember:
/* [11] */
Dictionary:
- DICTIONARY IDENTIFIER Inheritance '{' DictionaryMembers '}' ';'
+ TOK_DICTIONARY TOK_IDENTIFIER Inheritance '{' DictionaryMembers '}' ';'
;
/* [12] */
@@ -217,12 +212,12 @@ DictionaryMembers:
/* [13] */
DictionaryMember:
- Type IDENTIFIER Default ";"
+ Type TOK_IDENTIFIER Default ";"
;
/* [14] */
PartialDictionary:
- DICTIONARY IDENTIFIER '{' DictionaryMembers '}' ';'
+ TOK_DICTIONARY TOK_IDENTIFIER '{' DictionaryMembers '}' ';'
/* [15] */
Default:
@@ -236,14 +231,14 @@ Default:
DefaultValue:
ConstValue
|
- STRING_LITERAL
+ TOK_STRING_LITERAL
;
/* [17] */
Exception:
/* empty */
|
- EXCEPTION IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
+ TOK_EXCEPTION TOK_IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
;
/* [18] */
@@ -260,7 +255,7 @@ Inheritance:
$$ = NULL;
}
|
- ':' IDENTIFIER
+ ':' TOK_IDENTIFIER
{
$$ = $2;
}
@@ -268,38 +263,38 @@ Inheritance:
/* [20] */
Enum:
- ENUM IDENTIFIER '{' EnumValueList '}' ';'
+ TOK_ENUM TOK_IDENTIFIER '{' EnumValueList '}' ';'
;
/* [21] */
EnumValueList:
- STRING_LITERAL EnumValues
+ TOK_STRING_LITERAL EnumValues
;
/* [22] */
EnumValues:
/* empty */
|
- ',' STRING_LITERAL EnumValues
+ ',' TOK_STRING_LITERAL EnumValues
;
/* [23] - bug in w3c grammar? it doesnt list the equals as a terminal */
CallbackRest:
- IDENTIFIER '=' ReturnType '(' ArgumentList ')' ';'
+ TOK_IDENTIFIER '=' ReturnType '(' ArgumentList ')' ';'
/* [24] */
Typedef:
- TYPEDEF ExtendedAttributeList Type IDENTIFIER ';'
+ TOK_TYPEDEF ExtendedAttributeList Type TOK_IDENTIFIER ';'
;
/* [25] */
ImplementsStatement:
- IDENTIFIER IMPLEMENTS IDENTIFIER ';'
+ TOK_IDENTIFIER TOK_IMPLEMENTS TOK_IDENTIFIER ';'
;
/* [26] */
Const:
- CONST ConstType IDENTIFIER '=' ConstValue ';'
+ TOK_CONST ConstType TOK_IDENTIFIER '=' ConstValue ';'
;
/* [27] */
@@ -308,32 +303,32 @@ ConstValue:
|
FloatLiteral
|
- INT_LITERAL
+ TOK_INT_LITERAL
|
- NULL_LITERAL
+ TOK_NULL_LITERAL
;
/* [28] */
BooleanLiteral:
- TRUE
+ TOK_TRUE
|
- FALSE
+ TOK_FALSE
;
/* [29] */
FloatLiteral:
- FLOAT_LITERAL
+ TOK_FLOAT_LITERAL
|
- '-' INFINITY
+ '-' TOK_INFINITY
|
- INFINITY
+ TOK_INFINITY
|
- NAN
+ TOK_NAN
;
/* [30] */
AttributeOrOperation:
- STRINGIFIER StringifierAttributeOrOperation
+ TOK_STRINGIFIER StringifierAttributeOrOperation
|
Attribute
|
@@ -351,21 +346,21 @@ StringifierAttributeOrOperation:
/* [32] */
Attribute:
- Inherit ReadOnly ATTRIBUTE Type IDENTIFIER ';'
+ Inherit ReadOnly TOK_ATTRIBUTE Type TOK_IDENTIFIER ';'
;
/* [33] */
Inherit:
/* empty */
|
- INHERIT
+ TOK_INHERIT
;
/* [34] */
ReadOnly:
/* empty */
|
- READONLY
+ TOK_READONLY
;
/* [35] */
@@ -375,7 +370,7 @@ Operation:
/* [36] */
Qualifiers:
- STATIC
+ TOK_STATIC
|
Specials
;
@@ -389,15 +384,15 @@ Specials:
/* [38] */
Special:
- GETTER
+ TOK_GETTER
|
- SETTER
+ TOK_SETTER
|
- CREATOR
+ TOK_CREATOR
|
- DELETER
+ TOK_DELETER
|
- LEGACYCALLER
+ TOK_LEGACYCALLER
;
/* [39] */
@@ -409,7 +404,7 @@ OperationRest:
OptionalIdentifier:
/* empty */
|
- IDENTIFIER
+ TOK_IDENTIFIER
;
@@ -435,7 +430,7 @@ Argument:
/* [44] */
OptionalOrRequiredArgument:
- OPTIONAL Type ArgumentName Default
+ TOK_OPTIONAL Type ArgumentName Default
|
Type Ellipsis ArgumentName
;
@@ -444,14 +439,14 @@ OptionalOrRequiredArgument:
ArgumentName:
ArgumentNameKeyword
|
- IDENTIFIER
+ TOK_IDENTIFIER
;
/* [46] */
Ellipsis:
/* empty */
|
- ELLIPSIS
+ TOK_ELLIPSIS
;
/* [47] */
@@ -463,7 +458,7 @@ ExceptionMember:
/* [48] */
ExceptionField:
- Type IDENTIFIER ';'
+ Type TOK_IDENTIFIER ';'
;
/* [49] extended attribute list inside square brackets */
@@ -513,21 +508,21 @@ ExtendedAttributeInner:
/* [54] */
Other:
- INT_LITERAL
+ TOK_INT_LITERAL
|
- FLOAT_LITERAL
+ TOK_FLOAT_LITERAL
|
- IDENTIFIER
+ TOK_IDENTIFIER
|
- STRING_LITERAL
+ TOK_STRING_LITERAL
|
- OTHER_LITERAL
+ TOK_OTHER_LITERAL
|
'-'
|
'.'
|
- ELLIPSIS
+ TOK_ELLIPSIS
|
':'
|
@@ -541,90 +536,90 @@ Other:
|
'?'
|
- DATE
+ TOK_DATE
|
- STRING
+ TOK_STRING
|
- INFINITY
+ TOK_INFINITY
|
- NAN
+ TOK_NAN
|
- ANY
+ TOK_ANY
|
- BOOLEAN
+ TOK_BOOLEAN
|
- BYTE
+ TOK_BYTE
|
- DOUBLE
+ TOK_DOUBLE
|
- FALSE
+ TOK_FALSE
|
- FLOAT
+ TOK_FLOAT
|
- LONG
+ TOK_LONG
|
- NULL_LITERAL
+ TOK_NULL_LITERAL
|
- OBJECT
+ TOK_OBJECT
|
- OCTET
+ TOK_OCTET
|
- OR
+ TOK_OR
|
- OPTIONAL
+ TOK_OPTIONAL
|
- SEQUENCE
+ TOK_SEQUENCE
|
- SHORT
+ TOK_SHORT
|
- TRUE
+ TOK_TRUE
|
- UNSIGNED
+ TOK_UNSIGNED
|
- VOID
+ TOK_VOID
|
ArgumentNameKeyword
;
/* [55] */
ArgumentNameKeyword:
- ATTRIBUTE
+ TOK_ATTRIBUTE
|
- CALLBACK
+ TOK_CALLBACK
|
- CONST
+ TOK_CONST
|
- CREATOR
+ TOK_CREATOR
|
- DELETER
+ TOK_DELETER
|
- DICTIONARY
+ TOK_DICTIONARY
|
- ENUM
+ TOK_ENUM
|
- EXCEPTION
+ TOK_EXCEPTION
|
- GETTER
+ TOK_GETTER
|
- IMPLEMENTS
+ TOK_IMPLEMENTS
|
- INHERIT
+ TOK_INHERIT
|
- INTERFACE
+ TOK_INTERFACE
|
- LEGACYCALLER
+ TOK_LEGACYCALLER
|
- PARTIAL
+ TOK_PARTIAL
|
- SETTER
+ TOK_SETTER
|
- STATIC
+ TOK_STATIC
|
- STRINGIFIER
+ TOK_STRINGIFIER
|
- TYPEDEF
+ TOK_TYPEDEF
|
- UNRESTRICTED
+ TOK_UNRESTRICTED
;
/* [56] as it says an other element or a comma */
@@ -645,12 +640,12 @@ Type:
SingleType:
NonAnyType
|
- ANY TypeSuffixStartingWithArray
+ TOK_ANY TypeSuffixStartingWithArray
;
/* [59] */
UnionType:
- '(' UnionMemberType OR UnionMemberType UnionMemberTypes ')'
+ '(' UnionMemberType TOK_OR UnionMemberType UnionMemberTypes ')'
;
/* [60] */
@@ -659,36 +654,36 @@ UnionMemberType:
|
UnionType TypeSuffix
|
- ANY '[' ']' TypeSuffix
+ TOK_ANY '[' ']' TypeSuffix
;
/* [61] */
UnionMemberTypes:
/* empty */
|
- OR UnionMemberType UnionMemberTypes
+ TOK_OR UnionMemberType UnionMemberTypes
;
/* [62] */
NonAnyType:
PrimitiveType TypeSuffix
|
- STRING TypeSuffix
+ TOK_STRING TypeSuffix
|
- IDENTIFIER TypeSuffix
+ TOK_IDENTIFIER TypeSuffix
|
- SEQUENCE '<' Type '>' Null
+ TOK_SEQUENCE '<' Type '>' Null
|
- OBJECT TypeSuffix
+ TOK_OBJECT TypeSuffix
|
- DATE TypeSuffix
+ TOK_DATE TypeSuffix
;
/* [63] */
ConstType:
PrimitiveType Null
|
- IDENTIFIER Null
+ TOK_IDENTIFIER Null
;
/* [64] */
@@ -697,46 +692,46 @@ PrimitiveType:
|
UnrestrictedFloatType
|
- BOOLEAN
+ TOK_BOOLEAN
|
- BYTE
+ TOK_BYTE
|
- OCTET
+ TOK_OCTET
;
/* [65] */
UnrestrictedFloatType:
- UNRESTRICTED FloatType
+ TOK_UNRESTRICTED FloatType
|
FloatType
;
/* [66] */
FloatType:
- FLOAT
+ TOK_FLOAT
|
- DOUBLE
+ TOK_DOUBLE
;
/* [67] */
UnsignedIntegerType:
- UNSIGNED IntegerType
+ TOK_UNSIGNED IntegerType
|
IntegerType
;
/* [68] */
IntegerType:
- SHORT
+ TOK_SHORT
|
- LONG OptionalLong
+ TOK_LONG OptionalLong
;
/* [69] */
OptionalLong:
/* empty */
|
- LONG
+ TOK_LONG
;
/* [70] */
@@ -766,7 +761,7 @@ Null:
ReturnType:
Type
|
- VOID
+ TOK_VOID
;
%%
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/a6798ef1b89a2eee44c...
commit a6798ef1b89a2eee44c3e885d833075258b2330d
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
complete grammar
simplify lexer
diff --git a/javascript/idl/webidl.l b/javascript/idl/webidl.l
index e8a09f3..acaedb6 100644
--- a/javascript/idl/webidl.l
+++ b/javascript/idl/webidl.l
@@ -40,8 +40,6 @@
yylloc->first_column = yylloc->last_column + 1; \
yylloc->last_column += yyleng;
-static bool pp_mode = false;
-
%}
/* regular definitions */
@@ -90,7 +88,7 @@ HexEscapeSequence x{HexDigit}{2}
UnicodeEscapeSequence u{HexDigit}{4}
CharacterEscapeSequence {SingleEscapeCharacter}|{NonEscapeCharacter}
EscapeSequence {CharacterEscapeSequence}|0|{HexEscapeSequence}|{UnicodeEscapeSequence}
-DoubleStringCharacter ([^\"\\\n\r]|\\{EscapeSequence})
+quotedstring ([^\"\\\n\r]|\\{EscapeSequence})
Identifier [A-Z_a-z][0-9A-Z_a-z]*
other [^\t\n\r 0-9A-Z_a-z]
@@ -106,11 +104,6 @@ poundsign ^{whitespace}*#
/* update position counts */
++yylloc->last_line;
yylloc->last_column = 0;
- if (pp_mode) {
- /* in preprocessor mode emit an EOL token */
- pp_mode = false;
- return EOL;
- }
}
/* PrimitiveType terminals */
@@ -218,9 +211,9 @@ readonly return READONLY;
{DecimalLiteral} yylval->text = strdup(yytext); return FLOAT_LITERAL;
-\"{DoubleStringCharacter}*\" yylval->text = strdup(yytext); return STRING_LITERAL;
+\"{quotedstring}*\" yylval->text = strdup(yytext); return STRING_LITERAL;
-{multicomment} {
+{multicomment} {
/* multicomment */
char* s = yytext;
for (; *s; ++s)
@@ -258,12 +251,9 @@ readonly return READONLY;
{poundsign}include BEGIN(incl);
-{poundsign} pp_mode = true; return POUND_SIGN;
-
-
<incl>[ \t]*\" /* eat the whitespace and open quotes */
-<incl>[^\t\n\"]+ {
+<incl>[^\t\n\"]+ {
/* got the include file name */
yyin = fopen( yytext, "r" );
diff --git a/javascript/idl/webidl.y b/javascript/idl/webidl.y
index 4aad3ec..4295a03 100644
--- a/javascript/idl/webidl.y
+++ b/javascript/idl/webidl.y
@@ -121,24 +121,28 @@ main()
%%
- /* start with definitions [1] */
+ /* [1] start with definitions */
Definitions:
/* empty */
|
ExtendedAttributeList Definition Definitions
- |
- Preprocessor
;
-Preprocessor:
- POUND_SIGN EOL
- ;
-
/* [2] */
Definition:
CallbackOrInterface
|
- PARTIAL | DICTIONARY | EXCEPTION | ENUM | TYPEDEF
+ Partial
+ |
+ Dictionary
+ |
+ Exception
+ |
+ Enum
+ |
+ Typedef
+ |
+ ImplementsStatement
;
/* [3] */
@@ -162,6 +166,23 @@ Interface:
}
;
+ /* [6] */
+Partial:
+ PARTIAL PartialDefinition
+ ;
+
+ /* [7] */
+PartialDefinition:
+ PartialInterface
+ |
+ PartialDictionary
+ ;
+
+ /* [8] */
+PartialInterface:
+ INTERFACE IDENTIFIER '{' InterfaceMembers '}' ';'
+ ;
+
/* [9] */
InterfaceMembers:
/* empty */
@@ -182,6 +203,27 @@ InterfaceMember:
AttributeOrOperation
;
+ /* [11] */
+Dictionary:
+ DICTIONARY IDENTIFIER Inheritance '{' DictionaryMembers '}' ';'
+ ;
+
+ /* [12] */
+DictionaryMembers:
+ /* empty */
+ |
+ ExtendedAttributeList DictionaryMember DictionaryMembers
+ ;
+
+ /* [13] */
+DictionaryMember:
+ Type IDENTIFIER Default ";"
+ ;
+
+ /* [14] */
+PartialDictionary:
+ DICTIONARY IDENTIFIER '{' DictionaryMembers '}' ';'
+
/* [15] */
Default:
/* empty */
@@ -197,14 +239,14 @@ DefaultValue:
STRING_LITERAL
;
-/* [17] */
+ /* [17] */
Exception:
/* empty */
|
EXCEPTION IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
;
-/* [18] */
+ /* [18] */
ExceptionMembers:
/* empty */
|
@@ -224,11 +266,27 @@ Inheritance:
}
;
- /* [23] - incomplete */
-CallbackRest:
- IDENTIFIER ';'
+/* [20] */
+Enum:
+ ENUM IDENTIFIER '{' EnumValueList '}' ';'
+ ;
+
+/* [21] */
+EnumValueList:
+ STRING_LITERAL EnumValues
;
+/* [22] */
+EnumValues:
+ /* empty */
+ |
+ ',' STRING_LITERAL EnumValues
+ ;
+
+ /* [23] - bug in w3c grammar? it doesnt list the equals as a terminal */
+CallbackRest:
+ IDENTIFIER '=' ReturnType '(' ArgumentList ')' ';'
+
/* [24] */
Typedef:
TYPEDEF ExtendedAttributeList Type IDENTIFIER ';'
@@ -442,6 +500,8 @@ ExtendedAttributeRest:
/* [53] extended attributes are nested with normal, square and curly braces */
ExtendedAttributeInner:
+ /* empty */
+ |
'(' ExtendedAttributeInner ')' ExtendedAttributeInner
|
'[' ExtendedAttributeInner ']' ExtendedAttributeInner
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/edaf5027d9936651cfa...
commit edaf5027d9936651cfae9d0837f20910be690b0c
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add include of other idl files
diff --git a/javascript/idl/window.idl b/javascript/idl/window.idl
index 1cb6721..7114709 100644
--- a/javascript/idl/window.idl
+++ b/javascript/idl/window.idl
@@ -1,4 +1,4 @@
-#include "eventtarget.h"
+#include "eventtarget.idl"
[NamedPropertiesObject]
interface Window : EventTarget {
@@ -116,4 +116,4 @@ interface Window : EventTarget {
attribute EventHandler onunload;
attribute EventHandler onvolumechange;
attribute EventHandler onwaiting;
-};
\ No newline at end of file
+};
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/0035ab8cf5df82dd0b3...
commit 0035ab8cf5df82dd0b316d5b4f4bde3f52c6975c
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
add ignore file
diff --git a/javascript/idl/.gitignore b/javascript/idl/.gitignore
new file mode 100644
index 0000000..dd7ead0
--- /dev/null
+++ b/javascript/idl/.gitignore
@@ -0,0 +1,7 @@
+*.o
+genbind
+webidl-lexer.c
+webidl-lexer.h
+webidl-parser.c
+webidl-parser.h
+
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/de1bcd1f34727206e46...
commit de1bcd1f34727206e46b1faa4d9dc6b7d1a0f1a6
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
most of webidl grammar in and viable include processing
diff --git a/javascript/idl/Makefile b/javascript/idl/Makefile
index a6a3eba..f493774 100644
--- a/javascript/idl/Makefile
+++ b/javascript/idl/Makefile
@@ -1,5 +1,7 @@
#
+CFLAGS+=-Wall
+
.PHONY: all clean
all: genbind
@@ -7,8 +9,12 @@ all: genbind
genbind: webidl-parser.o webidl-lexer.o
$(CC) -o $@ $^
+webidl-parser.o:webidl-parser.c webidl-lexer.h
+
+webidl-lexer.h: webidl-lexer.c
+
webidl-parser.c: webidl.y
- bison -t $<
+ bison --report=state -t $<
webidl-lexer.c: webidl.l
flex $<
diff --git a/javascript/idl/webidl.l b/javascript/idl/webidl.l
index 9518876..e8a09f3 100644
--- a/javascript/idl/webidl.l
+++ b/javascript/idl/webidl.l
@@ -1,23 +1,4 @@
/*
- * Copyright 2011, 2012 Esrille Inc.
- * Copyright 2008-2010 Google Inc.
- * Copyright 2007 Nintendo Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/*
* This is a unicode capable lexer for web IDL mostly derived from:
*
* W3C WEB IDL - http://www.w3.org/TR/WebIDL/ (especially the grammar
@@ -37,6 +18,9 @@
%option yylineno
%option bison-bridge
%option bison-locations
+%option nodefault
+%option warn
+%option debug
/* header block */
%{
@@ -82,15 +66,6 @@ PS (\xe2\x80\xa9)
/* non breaking space \u00A0 */
NBSP (\xc2\xa0)
-/* Lu is the set of Unicode characters up to \u00ff */
-/* Lu (\xc3[\x80-\x9e])*/
-
-/* Ll is set of Unicode lower case letters up to \u00ff */
-/* Ll (\xc2[\xaa\xb5\xba])|(\xc3[\x9f-\xbf]) */
-
-/* Unicode string excluding USP, LS, PS, Lu and Ll */
-/*Unicode ([\xc4-\xdf][\x80-\xbf])|(\xe0[\xa0-\xbf][\x80-\xbf])|(\e1[\x80-\x99][\x80-\xbf])|(\e1\9a[\x81-\xbf])|(\e1[\x9b-\x9f][\x80-\xbf])|(\e1\xa0[\x80-\x8d\x8f-\xbf])|(\e1[\xa1-\xbf][\x80-\xbf])|(\e2\x80[\x8b-\xa7\xaa-\xbf])|(\e2\x81[\x80-\x9e\xa0-\xbf])|(\e2[\x82-\xbf][\x80-\xbf])|(\e3\x80[\x81-\xbf])|(\e3[\x81-\xbf][\x80-\xbf])|([\xe4-\xec][\x80-\xbf][\x80-\xbf])|(\xed[\x80-\x9f][\x80-\xbf])|([\xee-\xef][\x80-\xbf][\x80-\xbf])|(\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf])|([\xf1-\xf3][\x80-\xbf][\x80-\xbf][\x80-\xbf])|(\xf4[\x80-\x8f][\x80-\xbf][\x80-\xbf])*/
-
/* web idl grammar for whitespace matches single and multiline
* comments too. Here there are separate definitions for both single
* and multiline comments.
@@ -118,8 +93,11 @@ EscapeSequence {CharacterEscapeSequence}|0|{HexEscapeSequence}|{Unicode
DoubleStringCharacter ([^\"\\\n\r]|\\{EscapeSequence})
Identifier [A-Z_a-z][0-9A-Z_a-z]*
-PoundSign ^{whitespace}*#
+other [^\t\n\r 0-9A-Z_a-z]
+
+poundsign ^{whitespace}*#
+%x incl
%%
{whitespace} ++yylloc->last_column; /* skip whitespace */
@@ -143,7 +121,7 @@ byte return BYTE;
octet return OCTET;
- /* ArgumentNameKeyword terminals */
+ /* terminals */
attribute return ATTRIBUTE;
@@ -183,8 +161,6 @@ typedef return TYPEDEF;
unrestricted return UNRESTRICTED;
- /* Other terminals - single characters are handled by the final . rule */
-
"..." return ELLIPSIS;
Date return DATE;
@@ -207,7 +183,7 @@ long return LONG;
null return NULL_LITERAL;
-object yylval->name = strdup(yytext); return IDENTIFIER;
+object yylval->text = strdup(yytext); return IDENTIFIER;
or return OR;
@@ -228,57 +204,21 @@ void return VOID;
readonly return READONLY;
- /*
-getraises {
-
- return GETRAISES;
- }
-in {
-
- return IN;
- }
-module {
-
- return MODULE;
- }
-native {
-
- return NATIVE;
- }
-omittable {
-
- return OMITTABLE;
- }
-
-raises {
-
- return RAISES;
- }
-setraises {
-
- return SETRAISES;
- }
-string {
-
- return STRING;
- }
- */
-
{Identifier} {
// A leading "_" is used to escape an identifier from looking like a reserved word terminal.
- yylval->name = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
+ yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
return IDENTIFIER;
}
-{DecimalIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{DecimalIntegerLiteral} yylval->value = strtol(yytext, NULL, 10); return INT_LITERAL;
-{OctalIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{OctalIntegerLiteral} yylval->value = strtol(yytext, NULL, 8); return INT_LITERAL;
-{HexIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{HexIntegerLiteral} yylval->value = strtol(yytext, NULL, 16); return INT_LITERAL;
-{DecimalLiteral} yylval->name = strdup(yytext); return FLOATING_PT_LITERAL;
+{DecimalLiteral} yylval->text = strdup(yytext); return FLOAT_LITERAL;
-\"{DoubleStringCharacter}*\" yylval->name = strdup(yytext); return STRING_LITERAL;
+\"{DoubleStringCharacter}*\" yylval->text = strdup(yytext); return STRING_LITERAL;
{multicomment} {
/* multicomment */
@@ -298,12 +238,12 @@ string {
if (strncmp(yytext, "/**", 3) == 0)
{
/* Javadoc style comment */
- yylval->name = strdup(yytext);
+ yylval->text = strdup(yytext);
return JAVADOC;
}
}
-{singlecomment} {
+{singlecomment} {
/* singlecomment */
int c;
@@ -314,8 +254,41 @@ string {
yylloc->last_column = 0;
}
-{PoundSign} pp_mode = true; return POUND_SIGN;
-. return (int) yytext[0];
+
+{poundsign}include BEGIN(incl);
+
+{poundsign} pp_mode = true; return POUND_SIGN;
+
+
+<incl>[ \t]*\" /* eat the whitespace and open quotes */
+
+<incl>[^\t\n\"]+ {
+ /* got the include file name */
+ yyin = fopen( yytext, "r" );
+
+ if ( ! yyin ) {
+ fprintf(stderr, "Unable to open include %s\n", yytext);
+ exit(3);
+ }
+ yypush_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ));
+
+ BEGIN(INITIAL);
+ }
+
+<incl>\n BEGIN(INITIAL);
+
+<<EOF>> {
+ yypop_buffer_state();
+
+ if ( !YY_CURRENT_BUFFER ) {
+ yyterminate();
+ } else {
+ BEGIN(incl);
+ }
+
+ }
+
+{other} return (int) yytext[0];
%%
diff --git a/javascript/idl/webidl.y b/javascript/idl/webidl.y
index a584a8f..4aad3ec 100644
--- a/javascript/idl/webidl.y
+++ b/javascript/idl/webidl.y
@@ -1,35 +1,13 @@
/*
- * Copyright 2011, 2012 Esrille Inc.
- * Copyright 2008-2010 Google Inc.
- * Copyright 2007 Nintendo Co., Ltd.
+ * This is a bison parser for web IDL derived from the the grammar in
+ * apendix A of W3C WEB IDL - http://www.w3.org/TR/WebIDL/
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * These coded instructions, statements, and computer programs contain
- * software derived from the following specifications:
- *
- * W3C,
- * Web IDL,
- * W3C Candidate Recommendation 19 April 2012.
- * http://dev.w3.org/2006/webapi/WebIDL/
*/
%{
/*
- * Parser.y file
+ * webidl.y file
* To generate the parser run: "bison webidl.y"
*/
@@ -39,7 +17,10 @@
#include "webidl-parser.h"
#include "webidl-lexer.h"
- extern int yydebug;
+extern int yydebug;
+
+ struct ifmembers_s {
+ };
void yyerror(const char *str)
{
@@ -54,7 +35,7 @@ int yywrap()
main()
{
yydebug = 1;
- yyparse();
+ yyparse();
}
@@ -68,8 +49,10 @@ main()
%union
{
- int attr;
- char* name;
+ int attr;
+ char* text;
+ long value;
+ struct ifmember_s **ifmember;
}
@@ -126,21 +109,604 @@ main()
%token POUND_SIGN
-%token <name> IDENTIFIER
-%token <name> INTEGER_LITERAL
-%token <name> FLOATING_PT_LITERAL
-%token <name> STRING_LITERAL
-%token <name> JAVADOC
+%token <text> IDENTIFIER
+%token <value> INT_LITERAL
+%token <text> FLOAT_LITERAL
+%token <text> STRING_LITERAL
+%token <text> OTHER_LITERAL
+%token <text> JAVADOC
+
+%type <text> Inheritance
+%type <ifmember> InterfaceMembers
%%
-anything:
- |
- anything any;
+ /* start with definitions [1] */
+Definitions:
+ /* empty */
+ |
+ ExtendedAttributeList Definition Definitions
+ |
+ Preprocessor
+ ;
+
+Preprocessor:
+ POUND_SIGN EOL
+ ;
+
+ /* [2] */
+Definition:
+ CallbackOrInterface
+ |
+ PARTIAL | DICTIONARY | EXCEPTION | ENUM | TYPEDEF
+ ;
+
+ /* [3] */
+CallbackOrInterface:
+ CALLBACK CallbackRestOrInterface
+ |
+ Interface
+ ;
+
+ /* [4] */
+CallbackRestOrInterface:
+ CallbackRest
+ |
+ Interface
+ ;
+
+ /* [5] */
+Interface:
+ INTERFACE IDENTIFIER Inheritance '{' InterfaceMembers '}' ';'
+ {
+ }
+ ;
+
+ /* [9] */
+InterfaceMembers:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ExtendedAttributeList InterfaceMember InterfaceMembers
+ {
+ $$ = NULL;
+ }
+ ;
+
+ /* [10] */
+InterfaceMember:
+ Const
+ |
+ AttributeOrOperation
+ ;
+
+ /* [15] */
+Default:
+ /* empty */
+ |
+ '=' DefaultValue
+ ;
+
+
+ /* [16] */
+DefaultValue:
+ ConstValue
+ |
+ STRING_LITERAL
+ ;
+
+/* [17] */
+Exception:
+ /* empty */
+ |
+ EXCEPTION IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
+ ;
+
+/* [18] */
+ExceptionMembers:
+ /* empty */
+ |
+ ExtendedAttributeList ExceptionMember ExceptionMembers
+ ;
+
+ /* [19] returns a string */
+Inheritance:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ':' IDENTIFIER
+ {
+ $$ = $2;
+ }
+ ;
+
+ /* [23] - incomplete */
+CallbackRest:
+ IDENTIFIER ';'
+ ;
+
+ /* [24] */
+Typedef:
+ TYPEDEF ExtendedAttributeList Type IDENTIFIER ';'
+ ;
+
+ /* [25] */
+ImplementsStatement:
+ IDENTIFIER IMPLEMENTS IDENTIFIER ';'
+ ;
+
+ /* [26] */
+Const:
+ CONST ConstType IDENTIFIER '=' ConstValue ';'
+ ;
+
+ /* [27] */
+ConstValue:
+ BooleanLiteral
+ |
+ FloatLiteral
+ |
+ INT_LITERAL
+ |
+ NULL_LITERAL
+ ;
+
+ /* [28] */
+BooleanLiteral:
+ TRUE
+ |
+ FALSE
+ ;
+
+ /* [29] */
+FloatLiteral:
+ FLOAT_LITERAL
+ |
+ '-' INFINITY
+ |
+ INFINITY
+ |
+ NAN
+ ;
+
+ /* [30] */
+AttributeOrOperation:
+ STRINGIFIER StringifierAttributeOrOperation
+ |
+ Attribute
+ |
+ Operation
+ ;
+
+ /* [31] */
+StringifierAttributeOrOperation:
+ Attribute
+ |
+ OperationRest
+ |
+ ';'
+ ;
+
+ /* [32] */
+Attribute:
+ Inherit ReadOnly ATTRIBUTE Type IDENTIFIER ';'
+ ;
+
+ /* [33] */
+Inherit:
+ /* empty */
+ |
+ INHERIT
+ ;
+
+ /* [34] */
+ReadOnly:
+ /* empty */
+ |
+ READONLY
+ ;
+
+ /* [35] */
+Operation:
+ Qualifiers OperationRest
+ ;
+
+ /* [36] */
+Qualifiers:
+ STATIC
+ |
+ Specials
+ ;
+
+ /* [37] */
+Specials:
+ /* empty */
+ |
+ Special Specials
+ ;
+
+ /* [38] */
+Special:
+ GETTER
+ |
+ SETTER
+ |
+ CREATOR
+ |
+ DELETER
+ |
+ LEGACYCALLER
+ ;
+
+ /* [39] */
+OperationRest:
+ ReturnType OptionalIdentifier '(' ArgumentList ')' ';'
+ ;
+
+ /* [40] */
+OptionalIdentifier:
+ /* empty */
+ |
+ IDENTIFIER
+ ;
+
+
+ /* [41] */
+ArgumentList:
+ /* empty */
+ |
+ Argument Arguments
+ ;
+
+ /* [42] */
+Arguments:
+ /* empty */
+ |
+ ',' Argument Arguments
+ ;
+
+
+ /* [43] */
+Argument:
+ ExtendedAttributeList OptionalOrRequiredArgument
+ ;
+
+ /* [44] */
+OptionalOrRequiredArgument:
+ OPTIONAL Type ArgumentName Default
+ |
+ Type Ellipsis ArgumentName
+ ;
+
+ /* [45] */
+ArgumentName:
+ ArgumentNameKeyword
+ |
+ IDENTIFIER
+ ;
+
+ /* [46] */
+Ellipsis:
+ /* empty */
+ |
+ ELLIPSIS
+ ;
+
+ /* [47] */
+ExceptionMember:
+ Const
+ |
+ ExceptionField
+ ;
+
+ /* [48] */
+ExceptionField:
+ Type IDENTIFIER ';'
+ ;
+
+ /* [49] extended attribute list inside square brackets */
+ExtendedAttributeList:
+ /* empty */
+ |
+ '[' ExtendedAttribute ExtendedAttributes ']'
+ ;
+
+ /* [50] extended attributes are separated with a comma */
+ExtendedAttributes:
+ /* empty */
+ |
+ ',' ExtendedAttribute ExtendedAttributes
+ ;
+
+ /* [51] extended attributes are nested with normal, square and curly braces */
+ExtendedAttribute:
+ '(' ExtendedAttributeInner ')' ExtendedAttributeRest
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeRest
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeRest
+ |
+ Other ExtendedAttributeRest
+ ;
+
+ /* [52] extended attributes can be space separated too */
+ExtendedAttributeRest:
+ /* empty */
+ |
+ ExtendedAttribute
+ ;
+
+ /* [53] extended attributes are nested with normal, square and curly braces */
+ExtendedAttributeInner:
+ '(' ExtendedAttributeInner ')' ExtendedAttributeInner
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeInner
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeInner
+ |
+ OtherOrComma ExtendedAttributeInner
+ ;
+
+ /* [54] */
+Other:
+ INT_LITERAL
+ |
+ FLOAT_LITERAL
+ |
+ IDENTIFIER
+ |
+ STRING_LITERAL
+ |
+ OTHER_LITERAL
+ |
+ '-'
+ |
+ '.'
+ |
+ ELLIPSIS
+ |
+ ':'
+ |
+ ';'
+ |
+ '<'
+ |
+ '='
+ |
+ '>'
+ |
+ '?'
+ |
+ DATE
+ |
+ STRING
+ |
+ INFINITY
+ |
+ NAN
+ |
+ ANY
+ |
+ BOOLEAN
+ |
+ BYTE
+ |
+ DOUBLE
+ |
+ FALSE
+ |
+ FLOAT
+ |
+ LONG
+ |
+ NULL_LITERAL
+ |
+ OBJECT
+ |
+ OCTET
+ |
+ OR
+ |
+ OPTIONAL
+ |
+ SEQUENCE
+ |
+ SHORT
+ |
+ TRUE
+ |
+ UNSIGNED
+ |
+ VOID
+ |
+ ArgumentNameKeyword
+ ;
+
+ /* [55] */
+ArgumentNameKeyword:
+ ATTRIBUTE
+ |
+ CALLBACK
+ |
+ CONST
+ |
+ CREATOR
+ |
+ DELETER
+ |
+ DICTIONARY
+ |
+ ENUM
+ |
+ EXCEPTION
+ |
+ GETTER
+ |
+ IMPLEMENTS
+ |
+ INHERIT
+ |
+ INTERFACE
+ |
+ LEGACYCALLER
+ |
+ PARTIAL
+ |
+ SETTER
+ |
+ STATIC
+ |
+ STRINGIFIER
+ |
+ TYPEDEF
+ |
+ UNRESTRICTED
+ ;
+
+ /* [56] as it says an other element or a comma */
+OtherOrComma:
+ Other
+ |
+ ','
+ ;
+
+ /* [57] */
+Type:
+ SingleType
+ |
+ UnionType TypeSuffix
+ ;
+
+ /* [58] */
+SingleType:
+ NonAnyType
+ |
+ ANY TypeSuffixStartingWithArray
+ ;
+
+ /* [59] */
+UnionType:
+ '(' UnionMemberType OR UnionMemberType UnionMemberTypes ')'
+ ;
+
+ /* [60] */
+UnionMemberType:
+ NonAnyType
+ |
+ UnionType TypeSuffix
+ |
+ ANY '[' ']' TypeSuffix
+ ;
+
+ /* [61] */
+UnionMemberTypes:
+ /* empty */
+ |
+ OR UnionMemberType UnionMemberTypes
+ ;
+
+ /* [62] */
+NonAnyType:
+ PrimitiveType TypeSuffix
+ |
+ STRING TypeSuffix
+ |
+ IDENTIFIER TypeSuffix
+ |
+ SEQUENCE '<' Type '>' Null
+ |
+ OBJECT TypeSuffix
+ |
+ DATE TypeSuffix
+ ;
+
+ /* [63] */
+ConstType:
+ PrimitiveType Null
+ |
+ IDENTIFIER Null
+ ;
+
+ /* [64] */
+PrimitiveType:
+ UnsignedIntegerType
+ |
+ UnrestrictedFloatType
+ |
+ BOOLEAN
+ |
+ BYTE
+ |
+ OCTET
+ ;
+
+ /* [65] */
+UnrestrictedFloatType:
+ UNRESTRICTED FloatType
+ |
+ FloatType
+ ;
+
+ /* [66] */
+FloatType:
+ FLOAT
+ |
+ DOUBLE
+ ;
+
+ /* [67] */
+UnsignedIntegerType:
+ UNSIGNED IntegerType
+ |
+ IntegerType
+ ;
+
+ /* [68] */
+IntegerType:
+ SHORT
+ |
+ LONG OptionalLong
+ ;
+
+ /* [69] */
+OptionalLong:
+ /* empty */
+ |
+ LONG
+ ;
+
+ /* [70] */
+TypeSuffix:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ |
+ '?' TypeSuffixStartingWithArray
+ ;
-any: ANY | ATTRIBUTE | BOOLEAN | BYTE | CALLBACK | LEGACYCALLER | CONST | CREATOR | DATE | DELETER | DICTIONARY | DOUBLE | ELLIPSIS | ENUM | EOL | EXCEPTION | FALSE | FLOAT | GETRAISES | GETTER | IMPLEMENTS | IN | INFINITY | INHERIT | INTERFACE | LONG | MODULE | NAN | NATIVE | NULL_LITERAL | OBJECT | OCTET | OMITTABLE | OPTIONAL | OR | PARTIAL | RAISES | READONLY | SETRAISES | SETTER | SEQUENCE | SHORT | STATIC | STRING | STRINGIFIER | TRUE | TYPEDEF | UNRESTRICTED | UNSIGNED | VOID | POUND_SIGN | IDENTIFIER | INTEGER_LITERAL | FLOATING_PT_LITERAL | STRING_LITERAL | JAVADOC | ':' | ';' | '{' | '}' | '(' | ')' | '[' | ']' | '<' | '>'| '=' | ',' | '?'
-;
+ /* [71] */
+TypeSuffixStartingWithArray:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ ;
+ /* [72] */
+Null:
+ /* empty */
+ |
+ '?'
+ ;
+ /* [73] */
+ReturnType:
+ Type
+ |
+ VOID
+ ;
%%
-----------------------------------------------------------------------
Summary of changes:
javascript/idl/.gitignore | 7 +
javascript/idl/Makefile | 28 ++-
javascript/idl/binder.c | 52 +++
javascript/idl/genbind.l | 56 +++
javascript/idl/genbind.y | 63 +++
javascript/idl/htmldocument.bnd | 3 +
javascript/idl/webidl-ast.h | 2 +
javascript/idl/webidl.l | 232 +++++-------
javascript/idl/webidl.y | 820 ++++++++++++++++++++++++++++++++++-----
javascript/idl/window.idl | 4 +-
10 files changed, 1023 insertions(+), 244 deletions(-)
create mode 100644 javascript/idl/.gitignore
create mode 100644 javascript/idl/binder.c
create mode 100644 javascript/idl/genbind.l
create mode 100644 javascript/idl/genbind.y
create mode 100644 javascript/idl/htmldocument.bnd
create mode 100644 javascript/idl/webidl-ast.h
diff --git a/javascript/idl/.gitignore b/javascript/idl/.gitignore
new file mode 100644
index 0000000..dd7ead0
--- /dev/null
+++ b/javascript/idl/.gitignore
@@ -0,0 +1,7 @@
+*.o
+genbind
+webidl-lexer.c
+webidl-lexer.h
+webidl-parser.c
+webidl-parser.h
+
diff --git a/javascript/idl/Makefile b/javascript/idl/Makefile
index a6a3eba..b9a0643 100644
--- a/javascript/idl/Makefile
+++ b/javascript/idl/Makefile
@@ -1,17 +1,37 @@
#
+CFLAGS+=-Wall
+
.PHONY: all clean
all: genbind
-genbind: webidl-parser.o webidl-lexer.o
+genbind: binder.o genbind-parser.o genbind-lexer.o webidl-parser.o webidl-lexer.o
$(CC) -o $@ $^
-webidl-parser.c: webidl.y
- bison -t $<
+webidl-parser.o: webidl-parser.c webidl-parser.h webidl-lexer.h
+
+webidl-parser.h webidl-parser.c: webidl.y
+ bison --report=state -t $<
+
+webidl-lexer.h: webidl-lexer.c
webidl-lexer.c: webidl.l
flex $<
+
+genbind-parser.o: genbind-parser.c genbind-parser.h genbind-lexer.h
+
+genbind-parser.h genbind-parser.c: genbind.y
+ bison --report=state -t $<
+
+genbind-lexer.h: genbind-lexer.c
+
+genbind-lexer.c: genbind.l
+ flex $<
+
+
+binder.o: webidl-parser.h genbind-parser.h
+
clean:
- $(RM) genbind webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h *.o
+ $(RM) genbind webidl-parser.c webidl-lexer.c webidl-lexer.h webidl-parser.h genbind-parser.c genbind-lexer.c genbind-lexer.h genbind-parser.h *.o
diff --git a/javascript/idl/binder.c b/javascript/idl/binder.c
new file mode 100644
index 0000000..150c780
--- /dev/null
+++ b/javascript/idl/binder.c
@@ -0,0 +1,52 @@
+#include <stdio.h>
+
+#include "webidl-ast.h"
+
+#include "webidl-parser.h"
+#include "genbind-parser.h"
+
+extern int webidl_debug;
+extern FILE* webidl_in;
+extern int webidl_parse();
+
+extern int genbind_debug;
+extern FILE* genbind_in;
+extern int genbind_parse();
+
+int loadwebidl(char *filename)
+{
+ FILE *myfile = fopen(filename, "r");
+ if (!myfile) {
+ perror(filename);
+ return 2;
+ }
+ /* set flex to read from file */
+ webidl_in = myfile;
+
+ webidl_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(webidl_in)) {
+ webidl_parse();
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ FILE *myfile = fopen("htmldocument.bnd", "r");
+ if (!myfile) {
+ perror(NULL);
+ return 2;
+ }
+ /* set flex to read from file */
+ genbind_in = myfile;
+
+ genbind_debug = 1;
+
+ /* parse through the input until there is no more: */
+ while (!feof(genbind_in)) {
+ genbind_parse();
+ }
+ return 0;
+}
diff --git a/javascript/idl/genbind.l b/javascript/idl/genbind.l
new file mode 100644
index 0000000..c658ee8
--- /dev/null
+++ b/javascript/idl/genbind.l
@@ -0,0 +1,56 @@
+/*
+ * binding generator lexer
+ */
+
+/* lexer options */
+%option outfile="genbind-lexer.c"
+%option header-file="genbind-lexer.h"
+%option never-interactive
+ /* %option yylineno */
+%option bison-bridge
+%option bison-locations
+%option nodefault
+%option warn
+%option debug
+%option prefix="genbind_"
+%option nounput
+
+/* header block */
+%{
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+
+%}
+
+ /* other Unicode “space separator” */
+USP (\xe1\x9a\x80)|(\xe1\xa0\x8e)|(\xe2\x80[\x80-\x8a])|(\xe2\x80\xaf)|(\xe2\x81\x9f)|(\xe3\x80\x80)
+
+/* non breaking space \u00A0 */
+NBSP (\xc2\xa0)
+
+whitespace ([ \t\v\f\n]|{NBSP}|{USP})
+multicomment \/\*(([^*])|(\*[^/]))*\*\/
+
+quotedstring [^\"\\\n\r]
+
+other [^\t\n\r 0-9A-Z_a-z]
+
+%%
+
+{whitespace} /* nothing */
+
+webidlfile return TOK_IDLFILE;
+
+\"{quotedstring}*\" yylval->text = strndup(yytext + 1,strlen(yytext+1) - 1 ); return TOK_STRING_LITERAL;
+
+{multicomment} /* nothing */
+
+{other} return (int) yytext[0];
+
+. /* nothing */
+
+%%
\ No newline at end of file
diff --git a/javascript/idl/genbind.y b/javascript/idl/genbind.y
new file mode 100644
index 0000000..533ff2b
--- /dev/null
+++ b/javascript/idl/genbind.y
@@ -0,0 +1,63 @@
+/*
+ * This is a bison parser for genbind
+ *
+ */
+
+%{
+
+#include <stdio.h>
+#include <string.h>
+
+#include "genbind-parser.h"
+#include "genbind-lexer.h"
+
+ extern int loadwebidl(char *filename);
+
+void genbind_error(const char *str)
+{
+ fprintf(stderr,"error: %s\n",str);
+}
+
+
+int genbind_wrap()
+{
+ return 1;
+}
+
+
+
+%}
+
+%output "genbind-parser.c"
+%defines "genbind-parser.h"
+
+%locations
+%define api.pure
+%name-prefix "genbind_"
+
+%union
+{
+ char* text;
+}
+
+%token TOK_IDLFILE
+
+%token <text> TOK_STRING_LITERAL
+
+%%
+
+ /* [1] start with instructions */
+Instructions:
+ /* empty */
+ |
+ IdlFile
+ ;
+
+IdlFile:
+ TOK_IDLFILE TOK_STRING_LITERAL
+ {
+ loadwebidl($2);
+ }
+ ;
+
+%%
diff --git a/javascript/idl/htmldocument.bnd b/javascript/idl/htmldocument.bnd
new file mode 100644
index 0000000..6f02c75
--- /dev/null
+++ b/javascript/idl/htmldocument.bnd
@@ -0,0 +1,3 @@
+/* test binding docuemnt */
+
+webidlfile "htmldocument.idl"
diff --git a/javascript/idl/webidl-ast.h b/javascript/idl/webidl-ast.h
new file mode 100644
index 0000000..96d7c2a
--- /dev/null
+++ b/javascript/idl/webidl-ast.h
@@ -0,0 +1,2 @@
+ struct ifmembers_s {
+ };
diff --git a/javascript/idl/webidl.l b/javascript/idl/webidl.l
index 9518876..7828f67 100644
--- a/javascript/idl/webidl.l
+++ b/javascript/idl/webidl.l
@@ -1,23 +1,4 @@
/*
- * Copyright 2011, 2012 Esrille Inc.
- * Copyright 2008-2010 Google Inc.
- * Copyright 2007 Nintendo Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/*
* This is a unicode capable lexer for web IDL mostly derived from:
*
* W3C WEB IDL - http://www.w3.org/TR/WebIDL/ (especially the grammar
@@ -37,14 +18,14 @@
%option yylineno
%option bison-bridge
%option bison-locations
+%option nodefault
+%option warn
+%option debug
+%option prefix="webidl_"
+%option nounput
/* header block */
%{
-/*
- * webidl.l file
- * To generate the lexical analyzer run: "flex webidl.l"
- *
- */
#include <stdbool.h>
#include <stdio.h>
@@ -56,8 +37,6 @@
yylloc->first_column = yylloc->last_column + 1; \
yylloc->last_column += yyleng;
-static bool pp_mode = false;
-
%}
/* regular definitions */
@@ -82,15 +61,6 @@ PS (\xe2\x80\xa9)
/* non breaking space \u00A0 */
NBSP (\xc2\xa0)
-/* Lu is the set of Unicode characters up to \u00ff */
-/* Lu (\xc3[\x80-\x9e])*/
-
-/* Ll is set of Unicode lower case letters up to \u00ff */
-/* Ll (\xc2[\xaa\xb5\xba])|(\xc3[\x9f-\xbf]) */
-
-/* Unicode string excluding USP, LS, PS, Lu and Ll */
-/*Unicode ([\xc4-\xdf][\x80-\xbf])|(\xe0[\xa0-\xbf][\x80-\xbf])|(\e1[\x80-\x99][\x80-\xbf])|(\e1\9a[\x81-\xbf])|(\e1[\x9b-\x9f][\x80-\xbf])|(\e1\xa0[\x80-\x8d\x8f-\xbf])|(\e1[\xa1-\xbf][\x80-\xbf])|(\e2\x80[\x8b-\xa7\xaa-\xbf])|(\e2\x81[\x80-\x9e\xa0-\xbf])|(\e2[\x82-\xbf][\x80-\xbf])|(\e3\x80[\x81-\xbf])|(\e3[\x81-\xbf][\x80-\xbf])|([\xe4-\xec][\x80-\xbf][\x80-\xbf])|(\xed[\x80-\x9f][\x80-\xbf])|([\xee-\xef][\x80-\xbf][\x80-\xbf])|(\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf])|([\xf1-\xf3][\x80-\xbf][\x80-\xbf][\x80-\xbf])|(\xf4[\x80-\x8f][\x80-\xbf][\x80-\xbf])*/
-
/* web idl grammar for whitespace matches single and multiline
* comments too. Here there are separate definitions for both single
* and multiline comments.
@@ -115,11 +85,14 @@ HexEscapeSequence x{HexDigit}{2}
UnicodeEscapeSequence u{HexDigit}{4}
CharacterEscapeSequence {SingleEscapeCharacter}|{NonEscapeCharacter}
EscapeSequence {CharacterEscapeSequence}|0|{HexEscapeSequence}|{UnicodeEscapeSequence}
-DoubleStringCharacter ([^\"\\\n\r]|\\{EscapeSequence})
+quotedstring ([^\"\\\n\r]|\\{EscapeSequence})
Identifier [A-Z_a-z][0-9A-Z_a-z]*
-PoundSign ^{whitespace}*#
+other [^\t\n\r 0-9A-Z_a-z]
+
+poundsign ^{whitespace}*#
+%x incl
%%
{whitespace} ++yylloc->last_column; /* skip whitespace */
@@ -128,159 +101,116 @@ PoundSign ^{whitespace}*#
/* update position counts */
++yylloc->last_line;
yylloc->last_column = 0;
- if (pp_mode) {
- /* in preprocessor mode emit an EOL token */
- pp_mode = false;
- return EOL;
- }
}
/* PrimitiveType terminals */
-boolean return BOOLEAN;
-
-byte return BYTE;
+boolean return TOK_BOOLEAN;
-octet return OCTET;
+byte return TOK_BYTE;
+octet return TOK_OCTET;
- /* ArgumentNameKeyword terminals */
-attribute return ATTRIBUTE;
+ /* terminals */
-callback return CALLBACK;
+attribute return TOK_ATTRIBUTE;
-const return CONST;
+callback return TOK_CALLBACK;
-creator return CREATOR;
+const return TOK_CONST;
-deleter return DELETER;
+creator return TOK_CREATOR;
-dictionary return DICTIONARY;
+deleter return TOK_DELETER;
-enum return ENUM;
+dictionary return TOK_DICTIONARY;
-exception return EXCEPTION;
+enum return TOK_ENUM;
-getter return GETTER;
+exception return TOK_EXCEPTION;
-implements return IMPLEMENTS;
+getter return TOK_GETTER;
-inherit return INHERIT;
+implements return TOK_IMPLEMENTS;
-interface return INTERFACE;
+inherit return TOK_INHERIT;
-legacycaller return LEGACYCALLER;
+interface return TOK_INTERFACE;
-partial return PARTIAL;
+legacycaller return TOK_LEGACYCALLER;
-setter return SETTER;
+partial return TOK_PARTIAL;
-static return STATIC;
+setter return TOK_SETTER;
-stringifier return STRINGIFIER;
+static return TOK_STATIC;
-typedef return TYPEDEF;
+stringifier return TOK_STRINGIFIER;
-unrestricted return UNRESTRICTED;
+typedef return TOK_TYPEDEF;
- /* Other terminals - single characters are handled by the final . rule */
+unrestricted return TOK_UNRESTRICTED;
-"..." return ELLIPSIS;
+"..." return TOK_ELLIPSIS;
-Date return DATE;
+Date return TOK_DATE;
-DOMString return STRING; /* dom strings are just strings */
+DOMString return TOK_STRING; /* dom strings are just strings */
-Infinity return INFINITY;
+Infinity return TOK_INFINITY;
-NaN return NAN;
+NaN return TOK_NAN;
-any return ANY;
+any return TOK_ANY;
-double return DOUBLE;
+double return TOK_DOUBLE;
-false return FALSE;
+false return TOK_FALSE;
-float return FLOAT;
+float return TOK_FLOAT;
-long return LONG;
+long return TOK_LONG;
-null return NULL_LITERAL;
+null return TOK_NULL_LITERAL;
-object yylval->name = strdup(yytext); return IDENTIFIER;
+object yylval->text = strdup(yytext); return TOK_IDENTIFIER;
-or return OR;
+or return TOK_OR;
-optional return OPTIONAL;
+optional return TOK_OPTIONAL;
-sequence return SEQUENCE;
+sequence return TOK_SEQUENCE;
-short return SHORT;
+short return TOK_SHORT;
-true return TRUE;
+true return TOK_TRUE;
-unsigned return UNSIGNED;
+unsigned return TOK_UNSIGNED;
-void return VOID;
+void return TOK_VOID;
/* Terminals not in the Other and ArgumentNameKeyword terminal lists */
-readonly return READONLY;
-
+readonly return TOK_READONLY;
- /*
-getraises {
-
- return GETRAISES;
- }
-in {
-
- return IN;
- }
-module {
-
- return MODULE;
- }
-native {
-
- return NATIVE;
- }
-omittable {
-
- return OMITTABLE;
- }
-
-raises {
-
- return RAISES;
- }
-setraises {
-
- return SETRAISES;
- }
-string {
-
- return STRING;
- }
- */
{Identifier} {
// A leading "_" is used to escape an identifier from looking like a reserved word terminal.
- yylval->name = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
- return IDENTIFIER;
+ yylval->text = (yytext[0] == '_') ? strdup(yytext + 1) : strdup(yytext);
+ return TOK_IDENTIFIER;
}
-{DecimalIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{DecimalIntegerLiteral} yylval->value = strtol(yytext, NULL, 10); return TOK_INT_LITERAL;
-{OctalIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{OctalIntegerLiteral} yylval->value = strtol(yytext, NULL, 8); return TOK_INT_LITERAL;
-{HexIntegerLiteral} yylval->name = strdup(yytext); return INTEGER_LITERAL;
+{HexIntegerLiteral} yylval->value = strtol(yytext, NULL, 16); return TOK_INT_LITERAL;
-{DecimalLiteral} yylval->name = strdup(yytext); return FLOATING_PT_LITERAL;
+{DecimalLiteral} yylval->text = strdup(yytext); return TOK_FLOAT_LITERAL;
-\"{DoubleStringCharacter}*\" yylval->name = strdup(yytext); return STRING_LITERAL;
+\"{quotedstring}*\" yylval->text = strdup(yytext); return TOK_STRING_LITERAL;
-{multicomment} {
+{multicomment} {
/* multicomment */
char* s = yytext;
for (; *s; ++s)
@@ -298,12 +228,12 @@ string {
if (strncmp(yytext, "/**", 3) == 0)
{
/* Javadoc style comment */
- yylval->name = strdup(yytext);
- return JAVADOC;
+ yylval->text = strdup(yytext);
+ return TOK_JAVADOC;
}
}
-{singlecomment} {
+{singlecomment} {
/* singlecomment */
int c;
@@ -314,8 +244,38 @@ string {
yylloc->last_column = 0;
}
-{PoundSign} pp_mode = true; return POUND_SIGN;
-. return (int) yytext[0];
+
+{poundsign}include BEGIN(incl);
+
+<incl>[ \t]*\" /* eat the whitespace and open quotes */
+
+<incl>[^\t\n\"]+ {
+ /* got the include file name */
+ yyin = fopen( yytext, "r" );
+
+ if ( ! yyin ) {
+ fprintf(stderr, "Unable to open include %s\n", yytext);
+ exit(3);
+ }
+ yypush_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ));
+
+ BEGIN(INITIAL);
+ }
+
+<incl>\n BEGIN(INITIAL);
+
+<<EOF>> {
+ yypop_buffer_state();
+
+ if ( !YY_CURRENT_BUFFER ) {
+ yyterminate();
+ } else {
+ BEGIN(incl);
+ }
+
+ }
+
+{other} return (int) yytext[0];
%%
diff --git a/javascript/idl/webidl.y b/javascript/idl/webidl.y
index a584a8f..d5859ff 100644
--- a/javascript/idl/webidl.y
+++ b/javascript/idl/webidl.y
@@ -1,61 +1,31 @@
/*
- * Copyright 2011, 2012 Esrille Inc.
- * Copyright 2008-2010 Google Inc.
- * Copyright 2007 Nintendo Co., Ltd.
+ * This is a bison parser for web IDL derived from the the grammar in
+ * apendix A of W3C WEB IDL - http://www.w3.org/TR/WebIDL/
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * These coded instructions, statements, and computer programs contain
- * software derived from the following specifications:
- *
- * W3C,
- * Web IDL,
- * W3C Candidate Recommendation 19 April 2012.
- * http://dev.w3.org/2006/webapi/WebIDL/
*/
%{
-/*
- * Parser.y file
- * To generate the parser run: "bison webidl.y"
- */
-
#include <stdio.h>
#include <string.h>
+#include "webidl-ast.h"
+
#include "webidl-parser.h"
#include "webidl-lexer.h"
- extern int yydebug;
-void yyerror(const char *str)
+
+void webidl_error(const char *str)
{
fprintf(stderr,"error: %s\n",str);
}
-int yywrap()
+int webidl_wrap()
{
return 1;
}
-main()
-{
- yydebug = 1;
- yyparse();
-}
%}
@@ -65,82 +35,728 @@ main()
%locations
%define api.pure
+%name-prefix "webidl_"
%union
{
- int attr;
- char* name;
+ int attr;
+ char* text;
+ long value;
+ struct ifmember_s **ifmember;
}
-%token ANY
-%token ATTRIBUTE
-%token BOOLEAN
-%token BYTE
-%token CALLBACK
-%token LEGACYCALLER
-%token CONST
-%token CREATOR
-%token DATE
-%token DELETER
-%token DICTIONARY
-%token DOUBLE
-%token ELLIPSIS
-%token ENUM
-%token EOL
-%token EXCEPTION
-%token FALSE
-%token FLOAT
-%token GETRAISES
-%token GETTER
-%token IMPLEMENTS
-%token IN
-%token INFINITY
-%token INHERIT
-%token INTERFACE
-%token LONG
-%token MODULE
-%token NAN
-%token NATIVE
-%token NULL_LITERAL
-%token OBJECT
-%token OCTET
-%token OMITTABLE
-%token OPTIONAL
-%token OR
-%token PARTIAL
-%token RAISES
-%token READONLY
-%token SETRAISES
-%token SETTER
-%token SEQUENCE
-%token SHORT
-%token STATIC
-%token STRING
-%token STRINGIFIER
-%token TRUE
-%token TYPEDEF
-%token UNRESTRICTED
-%token UNSIGNED
-%token VOID
-
-%token POUND_SIGN
-
-%token <name> IDENTIFIER
-%token <name> INTEGER_LITERAL
-%token <name> FLOATING_PT_LITERAL
-%token <name> STRING_LITERAL
-%token <name> JAVADOC
+%token TOK_ANY
+%token TOK_ATTRIBUTE
+%token TOK_BOOLEAN
+%token TOK_BYTE
+%token TOK_CALLBACK
+%token TOK_LEGACYCALLER
+%token TOK_CONST
+%token TOK_CREATOR
+%token TOK_DATE
+%token TOK_DELETER
+%token TOK_DICTIONARY
+%token TOK_DOUBLE
+%token TOK_ELLIPSIS
+%token TOK_ENUM
+%token TOK_EOL
+%token TOK_EXCEPTION
+%token TOK_FALSE
+%token TOK_FLOAT
+%token TOK_GETRAISES
+%token TOK_GETTER
+%token TOK_IMPLEMENTS
+%token TOK_IN
+%token TOK_INFINITY
+%token TOK_INHERIT
+%token TOK_INTERFACE
+%token TOK_LONG
+%token TOK_MODULE
+%token TOK_NAN
+%token TOK_NATIVE
+%token TOK_NULL_LITERAL
+%token TOK_OBJECT
+%token TOK_OCTET
+%token TOK_OMITTABLE
+%token TOK_OPTIONAL
+%token TOK_OR
+%token TOK_PARTIAL
+%token TOK_RAISES
+%token TOK_READONLY
+%token TOK_SETRAISES
+%token TOK_SETTER
+%token TOK_SEQUENCE
+%token TOK_SHORT
+%token TOK_STATIC
+%token TOK_STRING
+%token TOK_STRINGIFIER
+%token TOK_TRUE
+%token TOK_TYPEDEF
+%token TOK_UNRESTRICTED
+%token TOK_UNSIGNED
+%token TOK_VOID
+
+%token TOK_POUND_SIGN
+
+%token <text> TOK_IDENTIFIER
+%token <value> TOK_INT_LITERAL
+%token <text> TOK_FLOAT_LITERAL
+%token <text> TOK_STRING_LITERAL
+%token <text> TOK_OTHER_LITERAL
+%token <text> TOK_JAVADOC
+
+%type <text> Inheritance
+%type <ifmember> InterfaceMembers
%%
-anything:
- |
- anything any;
+ /* [1] start with definitions */
+Definitions:
+ /* empty */
+ |
+ ExtendedAttributeList Definition Definitions
+ ;
+
+ /* [2] */
+Definition:
+ CallbackOrInterface
+ |
+ Partial
+ |
+ Dictionary
+ |
+ Exception
+ |
+ Enum
+ |
+ Typedef
+ |
+ ImplementsStatement
+ ;
+
+ /* [3] */
+CallbackOrInterface:
+ TOK_CALLBACK CallbackRestOrInterface
+ |
+ Interface
+ ;
+
+ /* [4] */
+CallbackRestOrInterface:
+ CallbackRest
+ |
+ Interface
+ ;
+
+ /* [5] */
+Interface:
+ TOK_INTERFACE TOK_IDENTIFIER Inheritance '{' InterfaceMembers '}' ';'
+ {
+ }
+ ;
+
+ /* [6] */
+Partial:
+ TOK_PARTIAL PartialDefinition
+ ;
+
+ /* [7] */
+PartialDefinition:
+ PartialInterface
+ |
+ PartialDictionary
+ ;
+
+ /* [8] */
+PartialInterface:
+ TOK_INTERFACE TOK_IDENTIFIER '{' InterfaceMembers '}' ';'
+ ;
+
+ /* [9] */
+InterfaceMembers:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ExtendedAttributeList InterfaceMember InterfaceMembers
+ {
+ $$ = NULL;
+ }
+ ;
+
+ /* [10] */
+InterfaceMember:
+ Const
+ |
+ AttributeOrOperation
+ ;
+
+ /* [11] */
+Dictionary:
+ TOK_DICTIONARY TOK_IDENTIFIER Inheritance '{' DictionaryMembers '}' ';'
+ ;
+
+ /* [12] */
+DictionaryMembers:
+ /* empty */
+ |
+ ExtendedAttributeList DictionaryMember DictionaryMembers
+ ;
+
+ /* [13] */
+DictionaryMember:
+ Type TOK_IDENTIFIER Default ";"
+ ;
+
+ /* [14] */
+PartialDictionary:
+ TOK_DICTIONARY TOK_IDENTIFIER '{' DictionaryMembers '}' ';'
+
+ /* [15] */
+Default:
+ /* empty */
+ |
+ '=' DefaultValue
+ ;
+
+
+ /* [16] */
+DefaultValue:
+ ConstValue
+ |
+ TOK_STRING_LITERAL
+ ;
+
+ /* [17] */
+Exception:
+ /* empty */
+ |
+ TOK_EXCEPTION TOK_IDENTIFIER Inheritance '{' ExceptionMembers '}' ';'
+ ;
+
+ /* [18] */
+ExceptionMembers:
+ /* empty */
+ |
+ ExtendedAttributeList ExceptionMember ExceptionMembers
+ ;
+
+ /* [19] returns a string */
+Inheritance:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ |
+ ':' TOK_IDENTIFIER
+ {
+ $$ = $2;
+ }
+ ;
+
+/* [20] */
+Enum:
+ TOK_ENUM TOK_IDENTIFIER '{' EnumValueList '}' ';'
+ ;
+
+/* [21] */
+EnumValueList:
+ TOK_STRING_LITERAL EnumValues
+ ;
+
+/* [22] */
+EnumValues:
+ /* empty */
+ |
+ ',' TOK_STRING_LITERAL EnumValues
+ ;
+
+ /* [23] - bug in w3c grammar? it doesnt list the equals as a terminal */
+CallbackRest:
+ TOK_IDENTIFIER '=' ReturnType '(' ArgumentList ')' ';'
+
+ /* [24] */
+Typedef:
+ TOK_TYPEDEF ExtendedAttributeList Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [25] */
+ImplementsStatement:
+ TOK_IDENTIFIER TOK_IMPLEMENTS TOK_IDENTIFIER ';'
+ ;
+
+ /* [26] */
+Const:
+ TOK_CONST ConstType TOK_IDENTIFIER '=' ConstValue ';'
+ ;
+
+ /* [27] */
+ConstValue:
+ BooleanLiteral
+ |
+ FloatLiteral
+ |
+ TOK_INT_LITERAL
+ |
+ TOK_NULL_LITERAL
+ ;
+
+ /* [28] */
+BooleanLiteral:
+ TOK_TRUE
+ |
+ TOK_FALSE
+ ;
+
+ /* [29] */
+FloatLiteral:
+ TOK_FLOAT_LITERAL
+ |
+ '-' TOK_INFINITY
+ |
+ TOK_INFINITY
+ |
+ TOK_NAN
+ ;
+
+ /* [30] */
+AttributeOrOperation:
+ TOK_STRINGIFIER StringifierAttributeOrOperation
+ |
+ Attribute
+ |
+ Operation
+ ;
+
+ /* [31] */
+StringifierAttributeOrOperation:
+ Attribute
+ |
+ OperationRest
+ |
+ ';'
+ ;
+
+ /* [32] */
+Attribute:
+ Inherit ReadOnly TOK_ATTRIBUTE Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [33] */
+Inherit:
+ /* empty */
+ |
+ TOK_INHERIT
+ ;
+
+ /* [34] */
+ReadOnly:
+ /* empty */
+ |
+ TOK_READONLY
+ ;
+
+ /* [35] */
+Operation:
+ Qualifiers OperationRest
+ ;
+
+ /* [36] */
+Qualifiers:
+ TOK_STATIC
+ |
+ Specials
+ ;
+
+ /* [37] */
+Specials:
+ /* empty */
+ |
+ Special Specials
+ ;
+
+ /* [38] */
+Special:
+ TOK_GETTER
+ |
+ TOK_SETTER
+ |
+ TOK_CREATOR
+ |
+ TOK_DELETER
+ |
+ TOK_LEGACYCALLER
+ ;
+
+ /* [39] */
+OperationRest:
+ ReturnType OptionalIdentifier '(' ArgumentList ')' ';'
+ ;
+
+ /* [40] */
+OptionalIdentifier:
+ /* empty */
+ |
+ TOK_IDENTIFIER
+ ;
+
+
+ /* [41] */
+ArgumentList:
+ /* empty */
+ |
+ Argument Arguments
+ ;
+
+ /* [42] */
+Arguments:
+ /* empty */
+ |
+ ',' Argument Arguments
+ ;
+
+
+ /* [43] */
+Argument:
+ ExtendedAttributeList OptionalOrRequiredArgument
+ ;
+
+ /* [44] */
+OptionalOrRequiredArgument:
+ TOK_OPTIONAL Type ArgumentName Default
+ |
+ Type Ellipsis ArgumentName
+ ;
+
+ /* [45] */
+ArgumentName:
+ ArgumentNameKeyword
+ |
+ TOK_IDENTIFIER
+ ;
+
+ /* [46] */
+Ellipsis:
+ /* empty */
+ |
+ TOK_ELLIPSIS
+ ;
+
+ /* [47] */
+ExceptionMember:
+ Const
+ |
+ ExceptionField
+ ;
+
+ /* [48] */
+ExceptionField:
+ Type TOK_IDENTIFIER ';'
+ ;
+
+ /* [49] extended attribute list inside square brackets */
+ExtendedAttributeList:
+ /* empty */
+ |
+ '[' ExtendedAttribute ExtendedAttributes ']'
+ ;
+
+ /* [50] extended attributes are separated with a comma */
+ExtendedAttributes:
+ /* empty */
+ |
+ ',' ExtendedAttribute ExtendedAttributes
+ ;
+
+ /* [51] extended attributes are nested with normal, square and curly braces */
+ExtendedAttribute:
+ '(' ExtendedAttributeInner ')' ExtendedAttributeRest
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeRest
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeRest
+ |
+ Other ExtendedAttributeRest
+ ;
+
+ /* [52] extended attributes can be space separated too */
+ExtendedAttributeRest:
+ /* empty */
+ |
+ ExtendedAttribute
+ ;
+
+ /* [53] extended attributes are nested with normal, square and curly braces */
+ExtendedAttributeInner:
+ /* empty */
+ |
+ '(' ExtendedAttributeInner ')' ExtendedAttributeInner
+ |
+ '[' ExtendedAttributeInner ']' ExtendedAttributeInner
+ |
+ '{' ExtendedAttributeInner '}' ExtendedAttributeInner
+ |
+ OtherOrComma ExtendedAttributeInner
+ ;
+
+ /* [54] */
+Other:
+ TOK_INT_LITERAL
+ |
+ TOK_FLOAT_LITERAL
+ |
+ TOK_IDENTIFIER
+ |
+ TOK_STRING_LITERAL
+ |
+ TOK_OTHER_LITERAL
+ |
+ '-'
+ |
+ '.'
+ |
+ TOK_ELLIPSIS
+ |
+ ':'
+ |
+ ';'
+ |
+ '<'
+ |
+ '='
+ |
+ '>'
+ |
+ '?'
+ |
+ TOK_DATE
+ |
+ TOK_STRING
+ |
+ TOK_INFINITY
+ |
+ TOK_NAN
+ |
+ TOK_ANY
+ |
+ TOK_BOOLEAN
+ |
+ TOK_BYTE
+ |
+ TOK_DOUBLE
+ |
+ TOK_FALSE
+ |
+ TOK_FLOAT
+ |
+ TOK_LONG
+ |
+ TOK_NULL_LITERAL
+ |
+ TOK_OBJECT
+ |
+ TOK_OCTET
+ |
+ TOK_OR
+ |
+ TOK_OPTIONAL
+ |
+ TOK_SEQUENCE
+ |
+ TOK_SHORT
+ |
+ TOK_TRUE
+ |
+ TOK_UNSIGNED
+ |
+ TOK_VOID
+ |
+ ArgumentNameKeyword
+ ;
+
+ /* [55] */
+ArgumentNameKeyword:
+ TOK_ATTRIBUTE
+ |
+ TOK_CALLBACK
+ |
+ TOK_CONST
+ |
+ TOK_CREATOR
+ |
+ TOK_DELETER
+ |
+ TOK_DICTIONARY
+ |
+ TOK_ENUM
+ |
+ TOK_EXCEPTION
+ |
+ TOK_GETTER
+ |
+ TOK_IMPLEMENTS
+ |
+ TOK_INHERIT
+ |
+ TOK_INTERFACE
+ |
+ TOK_LEGACYCALLER
+ |
+ TOK_PARTIAL
+ |
+ TOK_SETTER
+ |
+ TOK_STATIC
+ |
+ TOK_STRINGIFIER
+ |
+ TOK_TYPEDEF
+ |
+ TOK_UNRESTRICTED
+ ;
+
+ /* [56] as it says an other element or a comma */
+OtherOrComma:
+ Other
+ |
+ ','
+ ;
+
+ /* [57] */
+Type:
+ SingleType
+ |
+ UnionType TypeSuffix
+ ;
+
+ /* [58] */
+SingleType:
+ NonAnyType
+ |
+ TOK_ANY TypeSuffixStartingWithArray
+ ;
+
+ /* [59] */
+UnionType:
+ '(' UnionMemberType TOK_OR UnionMemberType UnionMemberTypes ')'
+ ;
+
+ /* [60] */
+UnionMemberType:
+ NonAnyType
+ |
+ UnionType TypeSuffix
+ |
+ TOK_ANY '[' ']' TypeSuffix
+ ;
+
+ /* [61] */
+UnionMemberTypes:
+ /* empty */
+ |
+ TOK_OR UnionMemberType UnionMemberTypes
+ ;
+
+ /* [62] */
+NonAnyType:
+ PrimitiveType TypeSuffix
+ |
+ TOK_STRING TypeSuffix
+ |
+ TOK_IDENTIFIER TypeSuffix
+ |
+ TOK_SEQUENCE '<' Type '>' Null
+ |
+ TOK_OBJECT TypeSuffix
+ |
+ TOK_DATE TypeSuffix
+ ;
+
+ /* [63] */
+ConstType:
+ PrimitiveType Null
+ |
+ TOK_IDENTIFIER Null
+ ;
+
+ /* [64] */
+PrimitiveType:
+ UnsignedIntegerType
+ |
+ UnrestrictedFloatType
+ |
+ TOK_BOOLEAN
+ |
+ TOK_BYTE
+ |
+ TOK_OCTET
+ ;
+
+ /* [65] */
+UnrestrictedFloatType:
+ TOK_UNRESTRICTED FloatType
+ |
+ FloatType
+ ;
+
+ /* [66] */
+FloatType:
+ TOK_FLOAT
+ |
+ TOK_DOUBLE
+ ;
+
+ /* [67] */
+UnsignedIntegerType:
+ TOK_UNSIGNED IntegerType
+ |
+ IntegerType
+ ;
+
+ /* [68] */
+IntegerType:
+ TOK_SHORT
+ |
+ TOK_LONG OptionalLong
+ ;
+
+ /* [69] */
+OptionalLong:
+ /* empty */
+ |
+ TOK_LONG
+ ;
+
+ /* [70] */
+TypeSuffix:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ |
+ '?' TypeSuffixStartingWithArray
+ ;
-any: ANY | ATTRIBUTE | BOOLEAN | BYTE | CALLBACK | LEGACYCALLER | CONST | CREATOR | DATE | DELETER | DICTIONARY | DOUBLE | ELLIPSIS | ENUM | EOL | EXCEPTION | FALSE | FLOAT | GETRAISES | GETTER | IMPLEMENTS | IN | INFINITY | INHERIT | INTERFACE | LONG | MODULE | NAN | NATIVE | NULL_LITERAL | OBJECT | OCTET | OMITTABLE | OPTIONAL | OR | PARTIAL | RAISES | READONLY | SETRAISES | SETTER | SEQUENCE | SHORT | STATIC | STRING | STRINGIFIER | TRUE | TYPEDEF | UNRESTRICTED | UNSIGNED | VOID | POUND_SIGN | IDENTIFIER | INTEGER_LITERAL | FLOATING_PT_LITERAL | STRING_LITERAL | JAVADOC | ':' | ';' | '{' | '}' | '(' | ')' | '[' | ']' | '<' | '>'| '=' | ',' | '?'
-;
+ /* [71] */
+TypeSuffixStartingWithArray:
+ /* empty */
+ |
+ '[' ']' TypeSuffix
+ ;
+ /* [72] */
+Null:
+ /* empty */
+ |
+ '?'
+ ;
+ /* [73] */
+ReturnType:
+ Type
+ |
+ TOK_VOID
+ ;
%%
diff --git a/javascript/idl/window.idl b/javascript/idl/window.idl
index 1cb6721..7114709 100644
--- a/javascript/idl/window.idl
+++ b/javascript/idl/window.idl
@@ -1,4 +1,4 @@
-#include "eventtarget.h"
+#include "eventtarget.idl"
[NamedPropertiesObject]
interface Window : EventTarget {
@@ -116,4 +116,4 @@ interface Window : EventTarget {
attribute EventHandler onunload;
attribute EventHandler onvolumechange;
attribute EventHandler onwaiting;
-};
\ No newline at end of file
+};
--
NetSurf Browser
10 years, 6 months
netsurf: branch chris/spidermonkey-1.70 created. 24c43ea6a210cd1b98e911d989de400ef343e7bb
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/24c43ea6a210cd1b98e91...
...commit http://git.netsurf-browser.org/netsurf.git/commit/24c43ea6a210cd1b98e911d...
...tree http://git.netsurf-browser.org/netsurf.git/tree/24c43ea6a210cd1b98e911d98...
The branch, chris/spidermonkey-1.70 has been created
at 24c43ea6a210cd1b98e911d989de400ef343e7bb (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/24c43ea6a210cd1b98e...
commit 24c43ea6a210cd1b98e911d989de400ef343e7bb
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Spidermonkey <= 1.70 needs a pointer to a results variable even though we don't use it.
diff --git a/javascript/jsapi.c b/javascript/jsapi.c
index fa8726b..5eb43f2 100644
--- a/javascript/jsapi.c
+++ b/javascript/jsapi.c
@@ -132,6 +132,7 @@ js_newcompartment_fail:
bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
{
JSContext *cx = (JSContext *)ctx;
+ jsval rval = NULL;
/* LOG(("%p \"%s\"",cx ,txt)); */
@@ -150,7 +151,7 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen)
if (JS_EvaluateScript(cx,
JS_GetGlobalObject(cx),
txt, txtlen,
- "<head>", 0, NULL) == JS_TRUE) {
+ "<head>", 0, &rval) == JS_TRUE) {
return true;
}
-----------------------------------------------------------------------
--
NetSurf Browser
10 years, 6 months
iconv: branch master updated. 097de4ee4cd1e7df6661c94b87a5389e0cf50b77
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/iconv.git/shortlog/097de4ee4cd1e7df6661c94...
...commit http://git.netsurf-browser.org/iconv.git/commit/097de4ee4cd1e7df6661c94b8...
...tree http://git.netsurf-browser.org/iconv.git/tree/097de4ee4cd1e7df6661c94b87a...
The branch, master has been updated
via 097de4ee4cd1e7df6661c94b87a5389e0cf50b77 (commit)
via 337e123808d64cf7ac476c0c10d23c24c3931caa (commit)
via 7127f90276264ae81fb113f6fa8766c390f60fb3 (commit)
from 5cd189240b1edd74063361a82ae917a1a1369776 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/iconv.git/commitdiff/097de4ee4cd1e7df6661c...
commit 097de4ee4cd1e7df6661c94b87a5389e0cf50b77
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Ignore include/lib*
diff --git a/unicode/.gitignore b/unicode/.gitignore
new file mode 100644
index 0000000..c1845f3
--- /dev/null
+++ b/unicode/.gitignore
@@ -0,0 +1,2 @@
+include
+lib*
commitdiff http://git.netsurf-browser.org/iconv.git/commitdiff/337e123808d64cf7ac476...
commit 337e123808d64cf7ac476c0c10d23c24c3931caa
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Fix bitrot in riscos-dist target
diff --git a/Makefile b/Makefile
index 7943f72..b80c433 100644
--- a/Makefile
+++ b/Makefile
@@ -45,11 +45,9 @@ ifeq ($(COMPONENT_TYPE),riscos-module)
# TODO: Make this sensible. Preferably by making use of the install target.
riscos-dist: all
- $(Q)svn export -q riscos riscos-dist
- $(Q)$(CP) $(CPFLAGS) riscos/!Boot/Resources/!Unicode/Files/Aliases \
- riscos-dist/!Boot/Resources/!Unicode/Files/
+ $(Q)$(CP) $(CPFLAGS) -r riscos riscos-dist
+ $(Q)$(MKDIR) -p riscos-dist/!System/310/Modules
$(Q)$(CP) $(CPFLAGS) $(BUILDDIR)/iconv,ffa riscos-dist/!System/310/Modules/Iconv,ffa
- $(Q)svn export -q doc riscos-dist/doc
$(Q)$(RM) $(RMFLAGS) -r riscos-dist/doc/Standards
$(Q)$(CP) $(CPFLAGS) include/iconv/iconv.h riscos-dist/stubs/
$(Q)(cd riscos-dist ; $(GCCSDK_INSTALL_CROSSBIN)/zip -9r, ../iconv.zip *)
@@ -58,7 +56,7 @@ ifeq ($(COMPONENT_TYPE),riscos-module)
$(Q)$(MV) $(MVFLAGS) riscos-dist/!System riscos-dist/System
$(Q)$(RM) $(RMFLAGS) -r riscos-dist/doc riscos-dist/stubs
$(Q)$(RM) $(RMFLAGS) riscos-dist/ReadMe
- $(Q)svn export -q riscpkg/RiscPkg riscos-dist/RiscPkg
+ $(Q)$(CP) $(CPFLAGS) -r riscpkg/RiscPkg riscos-dist/
$(Q)$(CP) $(CPFLAGS) COPYING riscos-dist/RiscPkg/Copyright
$(Q)(cd riscos-dist ; $(GCCSDK_INSTALL_CROSSBIN)/zip -9r, ../iconv-pkg.zip *)
$(Q)$(RM) $(RMFLAGS) -r riscos-dist
commitdiff http://git.netsurf-browser.org/iconv.git/commitdiff/7127f90276264ae81fb11...
commit 7127f90276264ae81fb113f6fa8766c390f60fb3
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
Purge makealiases; it's moved to ROOL's repository.
diff --git a/aliases/Makefile b/aliases/Makefile
deleted file mode 100644
index ab0ebae..0000000
--- a/aliases/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-makealiases_SRCS := makealiases.c
-
-aliases_DATA := aliases-top character-sets aliases-bottom
-
-aliases := $(CURDIR)/riscos/!Boot/Resources/!Unicode/Files/Aliases
-
-makealiases := $(addprefix $(BUILDDIR)/, \
- $(subst /,_,$(addprefix $(DIR),makealiases)))
-
-DISTCLEAN_ITEMS := $(DISTCLEAN_ITEMS) $(aliases)
-
-# Target for building aliases file
-$(aliases): $(makealiases) $(addprefix $(DIR)data/, $(aliases_DATA))
- $(VQ)$(ECHO) $(ECHOFLAGS) " ALIASES: $@"
- $(Q)$(makealiases) $(wordlist 2,$(words $^),$^) $@
-
-# Target for building makealiases binary
-$(makealiases): $(addprefix $(DIR), $(makealiases_SRCS))
- $(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $^
-
-POST_TARGETS := $(POST_TARGETS) $(aliases)
-
-include $(NSBUILD)/Makefile.subdir
diff --git a/aliases/data/aliases-bottom b/aliases/data/aliases-bottom
deleted file mode 100644
index 5f58d9d..0000000
--- a/aliases/data/aliases-bottom
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Additional encodings not defined by IANA
-
-# Arbitrary allocations
-#CP737 3001
-#CP853 3002
-#CP856 3003
-CP874 3004 WINDOWS-874
-#CP922 3005
-#CP1046 3006
-#CP1124 3007
-#CP1125 3008 WINDOWS-1125
-#CP1129 3009
-#CP1133 3010 IBM-CP1133
-#CP1161 3011 IBM-1161 IBM1161 CSIBM1161
-#CP1162 3012 IBM-1162 IBM1162 CSIBM1162
-#CP1163 3013 IBM-1163 IBM1163 CSIBM1163
-#GEORGIAN-ACADEMY 3014
-#GEORGIAN-PS 3015
-#KOI8-RU 3016
-#KOI8-T 3017
-#MACARABIC 3018 X-MAC-ARABIC MAC-ARABIC
-#MACCROATIAN 3019 X-MAC-CROATIAN MAC-CROATIAN
-#MACGREEK 3020 X-MAC-GREEK MAC-GREEK
-#MACHEBREW 3021 X-MAC-HEBREW MAC-HEBREW
-#MACICELAND 3022 X-MAC-ICELAND MAC-ICELAND
-#MACROMANIA 3023 X-MAC-ROMANIA MAC-ROMANIA
-#MACTHAI 3024 X-MAC-THAI MAC-THAI
-#MACTURKISH 3025 X-MAC-TURKISH MAC-TURKISH
-#MULELAO-1 3026
-CP949 3027 WINDOWS-949
-
-# From Unicode Lib
-ISO-IR-182 4000
-ISO-IR-197 4002
-ISO-2022-JP-1 4008
-MACCYRILLIC 4009 X-MAC-CYRILLIC MAC-CYRILLIC
-MACUKRAINE 4010 X-MAC-UKRAINIAN MAC-UKRAINIAN
-MACCENTRALEUROPE 4011 X-MAC-CENTRALEURROMAN MAC-CENTRALEURROMAN
-JOHAB 4012
-ISO-8859-11 4014 iso-ir-166 ISO_8859-11 ISO8859-11 8859_11
-X-CURRENT 4999 X-SYSTEM
-X-ACORN-LATIN1 5001
-X-ACORN-FUZZY 5002
diff --git a/aliases/data/aliases-top b/aliases/data/aliases-top
deleted file mode 100644
index 84bf99c..0000000
--- a/aliases/data/aliases-top
+++ /dev/null
@@ -1,10 +0,0 @@
-# > Unicode:Files.Aliases
-# Mapping of character set encoding names to their canonical form
-#
-# Lines starting with a '#' are comments, blank lines are ignored.
-#
-# Based on http://www.iana.org/assignments/character-sets and
-# http://www.iana.org/assignments/ianacharset-mib
-#
-# Canonical Form MIBenum Aliases...
-#
diff --git a/aliases/data/character-sets b/aliases/data/character-sets
deleted file mode 100644
index 8cda52d..0000000
--- a/aliases/data/character-sets
+++ /dev/null
@@ -1,1868 +0,0 @@
-
-===================================================================
-CHARACTER SETS
-
-(last updated 28 January 2005)
-
-These are the official names for character sets that may be used in
-the Internet and may be referred to in Internet documentation. These
-names are expressed in ANSI_X3.4-1968 which is commonly called
-US-ASCII or simply ASCII. The character set most commonly use in the
-Internet and used especially in protocol standards is US-ASCII, this
-is strongly encouraged. The use of the name US-ASCII is also
-encouraged.
-
-The character set names may be up to 40 characters taken from the
-printable characters of US-ASCII. However, no distinction is made
-between use of upper and lower case letters.
-
-The MIBenum value is a unique value for use in MIBs to identify coded
-character sets.
-
-The value space for MIBenum values has been divided into three
-regions. The first region (3-999) consists of coded character sets
-that have been standardized by some standard setting organization.
-This region is intended for standards that do not have subset
-implementations. The second region (1000-1999) is for the Unicode and
-ISO/IEC 10646 coded character sets together with a specification of a
-(set of) sub-repertoires that may occur. The third region (>1999) is
-intended for vendor specific coded character sets.
-
- Assigned MIB enum Numbers
- -------------------------
- 0-2 Reserved
- 3-999 Set By Standards Organizations
- 1000-1999 Unicode / 10646
- 2000-2999 Vendor
-
-The aliases that start with "cs" have been added for use with the
-IANA-CHARSET-MIB as originally defined in RFC3808, and as currently
-maintained by IANA at http://www/iana.org/assignments/ianacharset-mib.
-Note that the ianacharset-mib needs to be kept in sync with this
-registry. These aliases that start with "cs" contain the standard
-numbers along with suggestive names in order to facilitate applications
-that want to display the names in user interfaces. The "cs" stands
-for character set and is provided for applications that need a lower
-case first letter but want to use mixed case thereafter that cannot
-contain any special characters, such as underbar ("_") and dash ("-").
-
-If the character set is from an ISO standard, its cs alias is the ISO
-standard number or name. If the character set is not from an ISO
-standard, but is registered with ISO (IPSJ/ITSCJ is the current ISO
-Registration Authority), the ISO Registry number is specified as
-ISOnnn followed by letters suggestive of the name or standards number
-of the code set. When a national or international standard is
-revised, the year of revision is added to the cs alias of the new
-character set entry in the IANA Registry in order to distinguish the
-revised character set from the original character set.
-
-
-Character Set Reference
-------------- ---------
-
-Name: ANSI_X3.4-1968 [RFC1345,KXS2]
-MIBenum: 3
-Source: ECMA registry
-Alias: iso-ir-6
-Alias: ANSI_X3.4-1986
-Alias: ISO_646.irv:1991
-Alias: ASCII
-Alias: ISO646-US
-Alias: US-ASCII (preferred MIME name)
-Alias: us
-Alias: IBM367
-Alias: cp367
-Alias: csASCII
-
-Name: ISO-10646-UTF-1
-MIBenum: 27
-Source: Universal Transfer Format (1), this is the multibyte
- encoding, that subsets ASCII-7. It does not have byte
- ordering issues.
-Alias: csISO10646UTF1
-
-Name: ISO_646.basic:1983 [RFC1345,KXS2]
-MIBenum: 28
-Source: ECMA registry
-Alias: ref
-Alias: csISO646basic1983
-
-Name: INVARIANT [RFC1345,KXS2]
-MIBenum: 29
-Alias: csINVARIANT
-
-Name: ISO_646.irv:1983 [RFC1345,KXS2]
-MIBenum: 30
-Source: ECMA registry
-Alias: iso-ir-2
-Alias: irv
-Alias: csISO2IntlRefVersion
-
-Name: BS_4730 [RFC1345,KXS2]
-MIBenum: 20
-Source: ECMA registry
-Alias: iso-ir-4
-Alias: ISO646-GB
-Alias: gb
-Alias: uk
-Alias: csISO4UnitedKingdom
-
-Name: NATS-SEFI [RFC1345,KXS2]
-MIBenum: 31
-Source: ECMA registry
-Alias: iso-ir-8-1
-Alias: csNATSSEFI
-
-Name: NATS-SEFI-ADD [RFC1345,KXS2]
-MIBenum: 32
-Source: ECMA registry
-Alias: iso-ir-8-2
-Alias: csNATSSEFIADD
-
-Name: NATS-DANO [RFC1345,KXS2]
-MIBenum: 33
-Source: ECMA registry
-Alias: iso-ir-9-1
-Alias: csNATSDANO
-
-Name: NATS-DANO-ADD [RFC1345,KXS2]
-MIBenum: 34
-Source: ECMA registry
-Alias: iso-ir-9-2
-Alias: csNATSDANOADD
-
-Name: SEN_850200_B [RFC1345,KXS2]
-MIBenum: 35
-Source: ECMA registry
-Alias: iso-ir-10
-Alias: FI
-Alias: ISO646-FI
-Alias: ISO646-SE
-Alias: se
-Alias: csISO10Swedish
-
-Name: SEN_850200_C [RFC1345,KXS2]
-MIBenum: 21
-Source: ECMA registry
-Alias: iso-ir-11
-Alias: ISO646-SE2
-Alias: se2
-Alias: csISO11SwedishForNames
-
-Name: KS_C_5601-1987 [RFC1345,KXS2]
-MIBenum: 36
-Source: ECMA registry
-Alias: iso-ir-149
-Alias: KS_C_5601-1989
-Alias: KSC_5601
-Alias: korean
-Alias: csKSC56011987
-
-Name: ISO-2022-KR (preferred MIME name) [RFC1557,Choi]
-MIBenum: 37
-Source: RFC-1557 (see also KS_C_5601-1987)
-Alias: csISO2022KR
-
-Name: EUC-KR (preferred MIME name) [RFC1557,Choi]
-MIBenum: 38
-Source: RFC-1557 (see also KS_C_5861-1992)
-Alias: csEUCKR
-
-Name: ISO-2022-JP (preferred MIME name) [RFC1468,Murai]
-MIBenum: 39
-Source: RFC-1468 (see also RFC-2237)
-Alias: csISO2022JP
-
-Name: ISO-2022-JP-2 (preferred MIME name) [RFC1554,Ohta]
-MIBenum: 40
-Source: RFC-1554
-Alias: csISO2022JP2
-
-Name: ISO-2022-CN [RFC1922]
-MIBenum: 104
-Source: RFC-1922
-
-Name: ISO-2022-CN-EXT [RFC1922]
-MIBenum: 105
-Source: RFC-1922
-
-Name: JIS_C6220-1969-jp [RFC1345,KXS2]
-MIBenum: 41
-Source: ECMA registry
-Alias: JIS_C6220-1969
-Alias: iso-ir-13
-Alias: katakana
-Alias: x0201-7
-Alias: csISO13JISC6220jp
-
-Name: JIS_C6220-1969-ro [RFC1345,KXS2]
-MIBenum: 42
-Source: ECMA registry
-Alias: iso-ir-14
-Alias: jp
-Alias: ISO646-JP
-Alias: csISO14JISC6220ro
-
-Name: IT [RFC1345,KXS2]
-MIBenum: 22
-Source: ECMA registry
-Alias: iso-ir-15
-Alias: ISO646-IT
-Alias: csISO15Italian
-
-Name: PT [RFC1345,KXS2]
-MIBenum: 43
-Source: ECMA registry
-Alias: iso-ir-16
-Alias: ISO646-PT
-Alias: csISO16Portuguese
-
-Name: ES [RFC1345,KXS2]
-MIBenum: 23
-Source: ECMA registry
-Alias: iso-ir-17
-Alias: ISO646-ES
-Alias: csISO17Spanish
-
-Name: greek7-old [RFC1345,KXS2]
-MIBenum: 44
-Source: ECMA registry
-Alias: iso-ir-18
-Alias: csISO18Greek7Old
-
-Name: latin-greek [RFC1345,KXS2]
-MIBenum: 45
-Source: ECMA registry
-Alias: iso-ir-19
-Alias: csISO19LatinGreek
-
-Name: DIN_66003 [RFC1345,KXS2]
-MIBenum: 24
-Source: ECMA registry
-Alias: iso-ir-21
-Alias: de
-Alias: ISO646-DE
-Alias: csISO21German
-
-Name: NF_Z_62-010_(1973) [RFC1345,KXS2]
-MIBenum: 46
-Source: ECMA registry
-Alias: iso-ir-25
-Alias: ISO646-FR1
-Alias: csISO25French
-
-Name: Latin-greek-1 [RFC1345,KXS2]
-MIBenum: 47
-Source: ECMA registry
-Alias: iso-ir-27
-Alias: csISO27LatinGreek1
-
-Name: ISO_5427 [RFC1345,KXS2]
-MIBenum: 48
-Source: ECMA registry
-Alias: iso-ir-37
-Alias: csISO5427Cyrillic
-
-Name: JIS_C6226-1978 [RFC1345,KXS2]
-MIBenum: 49
-Source: ECMA registry
-Alias: iso-ir-42
-Alias: csISO42JISC62261978
-
-Name: BS_viewdata [RFC1345,KXS2]
-MIBenum: 50
-Source: ECMA registry
-Alias: iso-ir-47
-Alias: csISO47BSViewdata
-
-Name: INIS [RFC1345,KXS2]
-MIBenum: 51
-Source: ECMA registry
-Alias: iso-ir-49
-Alias: csISO49INIS
-
-Name: INIS-8 [RFC1345,KXS2]
-MIBenum: 52
-Source: ECMA registry
-Alias: iso-ir-50
-Alias: csISO50INIS8
-
-Name: INIS-cyrillic [RFC1345,KXS2]
-MIBenum: 53
-Source: ECMA registry
-Alias: iso-ir-51
-Alias: csISO51INISCyrillic
-
-Name: ISO_5427:1981 [RFC1345,KXS2]
-MIBenum: 54
-Source: ECMA registry
-Alias: iso-ir-54
-Alias: ISO5427Cyrillic1981
-
-Name: ISO_5428:1980 [RFC1345,KXS2]
-MIBenum: 55
-Source: ECMA registry
-Alias: iso-ir-55
-Alias: csISO5428Greek
-
-Name: GB_1988-80 [RFC1345,KXS2]
-MIBenum: 56
-Source: ECMA registry
-Alias: iso-ir-57
-Alias: cn
-Alias: ISO646-CN
-Alias: csISO57GB1988
-
-Name: GB_2312-80 [RFC1345,KXS2]
-MIBenum: 57
-Source: ECMA registry
-Alias: iso-ir-58
-Alias: chinese
-Alias: csISO58GB231280
-
-Name: NS_4551-1 [RFC1345,KXS2]
-MIBenum: 25
-Source: ECMA registry
-Alias: iso-ir-60
-Alias: ISO646-NO
-Alias: no
-Alias: csISO60DanishNorwegian
-Alias: csISO60Norwegian1
-
-Name: NS_4551-2 [RFC1345,KXS2]
-MIBenum: 58
-Source: ECMA registry
-Alias: ISO646-NO2
-Alias: iso-ir-61
-Alias: no2
-Alias: csISO61Norwegian2
-
-Name: NF_Z_62-010 [RFC1345,KXS2]
-MIBenum: 26
-Source: ECMA registry
-Alias: iso-ir-69
-Alias: ISO646-FR
-Alias: fr
-Alias: csISO69French
-
-Name: videotex-suppl [RFC1345,KXS2]
-MIBenum: 59
-Source: ECMA registry
-Alias: iso-ir-70
-Alias: csISO70VideotexSupp1
-
-Name: PT2 [RFC1345,KXS2]
-MIBenum: 60
-Source: ECMA registry
-Alias: iso-ir-84
-Alias: ISO646-PT2
-Alias: csISO84Portuguese2
-
-Name: ES2 [RFC1345,KXS2]
-MIBenum: 61
-Source: ECMA registry
-Alias: iso-ir-85
-Alias: ISO646-ES2
-Alias: csISO85Spanish2
-
-Name: MSZ_7795.3 [RFC1345,KXS2]
-MIBenum: 62
-Source: ECMA registry
-Alias: iso-ir-86
-Alias: ISO646-HU
-Alias: hu
-Alias: csISO86Hungarian
-
-Name: JIS_C6226-1983 [RFC1345,KXS2]
-MIBenum: 63
-Source: ECMA registry
-Alias: iso-ir-87
-Alias: x0208
-Alias: JIS_X0208-1983
-Alias: csISO87JISX0208
-
-Name: greek7 [RFC1345,KXS2]
-MIBenum: 64
-Source: ECMA registry
-Alias: iso-ir-88
-Alias: csISO88Greek7
-
-Name: ASMO_449 [RFC1345,KXS2]
-MIBenum: 65
-Source: ECMA registry
-Alias: ISO_9036
-Alias: arabic7
-Alias: iso-ir-89
-Alias: csISO89ASMO449
-
-Name: iso-ir-90 [RFC1345,KXS2]
-MIBenum: 66
-Source: ECMA registry
-Alias: csISO90
-
-Name: JIS_C6229-1984-a [RFC1345,KXS2]
-MIBenum: 67
-Source: ECMA registry
-Alias: iso-ir-91
-Alias: jp-ocr-a
-Alias: csISO91JISC62291984a
-
-Name: JIS_C6229-1984-b [RFC1345,KXS2]
-MIBenum: 68
-Source: ECMA registry
-Alias: iso-ir-92
-Alias: ISO646-JP-OCR-B
-Alias: jp-ocr-b
-Alias: csISO92JISC62991984b
-
-Name: JIS_C6229-1984-b-add [RFC1345,KXS2]
-MIBenum: 69
-Source: ECMA registry
-Alias: iso-ir-93
-Alias: jp-ocr-b-add
-Alias: csISO93JIS62291984badd
-
-Name: JIS_C6229-1984-hand [RFC1345,KXS2]
-MIBenum: 70
-Source: ECMA registry
-Alias: iso-ir-94
-Alias: jp-ocr-hand
-Alias: csISO94JIS62291984hand
-
-Name: JIS_C6229-1984-hand-add [RFC1345,KXS2]
-MIBenum: 71
-Source: ECMA registry
-Alias: iso-ir-95
-Alias: jp-ocr-hand-add
-Alias: csISO95JIS62291984handadd
-
-Name: JIS_C6229-1984-kana [RFC1345,KXS2]
-MIBenum: 72
-Source: ECMA registry
-Alias: iso-ir-96
-Alias: csISO96JISC62291984kana
-
-Name: ISO_2033-1983 [RFC1345,KXS2]
-MIBenum: 73
-Source: ECMA registry
-Alias: iso-ir-98
-Alias: e13b
-Alias: csISO2033
-
-Name: ANSI_X3.110-1983 [RFC1345,KXS2]
-MIBenum: 74
-Source: ECMA registry
-Alias: iso-ir-99
-Alias: CSA_T500-1983
-Alias: NAPLPS
-Alias: csISO99NAPLPS
-
-Name: ISO_8859-1:1987 [RFC1345,KXS2]
-MIBenum: 4
-Source: ECMA registry
-Alias: iso-ir-100
-Alias: ISO_8859-1
-Alias: ISO-8859-1 (preferred MIME name)
-Alias: latin1
-Alias: l1
-Alias: IBM819
-Alias: CP819
-Alias: csISOLatin1
-
-Name: ISO_8859-2:1987 [RFC1345,KXS2]
-MIBenum: 5
-Source: ECMA registry
-Alias: iso-ir-101
-Alias: ISO_8859-2
-Alias: ISO-8859-2 (preferred MIME name)
-Alias: latin2
-Alias: l2
-Alias: csISOLatin2
-
-Name: T.61-7bit [RFC1345,KXS2]
-MIBenum: 75
-Source: ECMA registry
-Alias: iso-ir-102
-Alias: csISO102T617bit
-
-Name: T.61-8bit [RFC1345,KXS2]
-MIBenum: 76
-Alias: T.61
-Source: ECMA registry
-Alias: iso-ir-103
-Alias: csISO103T618bit
-
-Name: ISO_8859-3:1988 [RFC1345,KXS2]
-MIBenum: 6
-Source: ECMA registry
-Alias: iso-ir-109
-Alias: ISO_8859-3
-Alias: ISO-8859-3 (preferred MIME name)
-Alias: latin3
-Alias: l3
-Alias: csISOLatin3
-
-Name: ISO_8859-4:1988 [RFC1345,KXS2]
-MIBenum: 7
-Source: ECMA registry
-Alias: iso-ir-110
-Alias: ISO_8859-4
-Alias: ISO-8859-4 (preferred MIME name)
-Alias: latin4
-Alias: l4
-Alias: csISOLatin4
-
-Name: ECMA-cyrillic
-MIBenum: 77
-Source: ISO registry (formerly ECMA registry)
- http://www.itscj.ipsj.jp/ISO-IR/111.pdf
-Alias: iso-ir-111
-Alias: KOI8-E
-Alias: csISO111ECMACyrillic
-
-Name: CSA_Z243.4-1985-1 [RFC1345,KXS2]
-MIBenum: 78
-Source: ECMA registry
-Alias: iso-ir-121
-Alias: ISO646-CA
-Alias: csa7-1
-Alias: ca
-Alias: csISO121Canadian1
-
-Name: CSA_Z243.4-1985-2 [RFC1345,KXS2]
-MIBenum: 79
-Source: ECMA registry
-Alias: iso-ir-122
-Alias: ISO646-CA2
-Alias: csa7-2
-Alias: csISO122Canadian2
-
-Name: CSA_Z243.4-1985-gr [RFC1345,KXS2]
-MIBenum: 80
-Source: ECMA registry
-Alias: iso-ir-123
-Alias: csISO123CSAZ24341985gr
-
-Name: ISO_8859-6:1987 [RFC1345,KXS2]
-MIBenum: 9
-Source: ECMA registry
-Alias: iso-ir-127
-Alias: ISO_8859-6
-Alias: ISO-8859-6 (preferred MIME name)
-Alias: ECMA-114
-Alias: ASMO-708
-Alias: arabic
-Alias: csISOLatinArabic
-
-Name: ISO_8859-6-E [RFC1556,IANA]
-MIBenum: 81
-Source: RFC1556
-Alias: csISO88596E
-Alias: ISO-8859-6-E (preferred MIME name)
-
-Name: ISO_8859-6-I [RFC1556,IANA]
-MIBenum: 82
-Source: RFC1556
-Alias: csISO88596I
-Alias: ISO-8859-6-I (preferred MIME name)
-
-Name: ISO_8859-7:1987 [RFC1947,RFC1345,KXS2]
-MIBenum: 10
-Source: ECMA registry
-Alias: iso-ir-126
-Alias: ISO_8859-7
-Alias: ISO-8859-7 (preferred MIME name)
-Alias: ELOT_928
-Alias: ECMA-118
-Alias: greek
-Alias: greek8
-Alias: csISOLatinGreek
-
-Name: T.101-G2 [RFC1345,KXS2]
-MIBenum: 83
-Source: ECMA registry
-Alias: iso-ir-128
-Alias: csISO128T101G2
-
-Name: ISO_8859-8:1988 [RFC1345,KXS2]
-MIBenum: 11
-Source: ECMA registry
-Alias: iso-ir-138
-Alias: ISO_8859-8
-Alias: ISO-8859-8 (preferred MIME name)
-Alias: hebrew
-Alias: csISOLatinHebrew
-
-Name: ISO_8859-8-E [RFC1556,Nussbacher]
-MIBenum: 84
-Source: RFC1556
-Alias: csISO88598E
-Alias: ISO-8859-8-E (preferred MIME name)
-
-Name: ISO_8859-8-I [RFC1556,Nussbacher]
-MIBenum: 85
-Source: RFC1556
-Alias: csISO88598I
-Alias: ISO-8859-8-I (preferred MIME name)
-
-Name: CSN_369103 [RFC1345,KXS2]
-MIBenum: 86
-Source: ECMA registry
-Alias: iso-ir-139
-Alias: csISO139CSN369103
-
-Name: JUS_I.B1.002 [RFC1345,KXS2]
-MIBenum: 87
-Source: ECMA registry
-Alias: iso-ir-141
-Alias: ISO646-YU
-Alias: js
-Alias: yu
-Alias: csISO141JUSIB1002
-
-Name: ISO_6937-2-add [RFC1345,KXS2]
-MIBenum: 14
-Source: ECMA registry and ISO 6937-2:1983
-Alias: iso-ir-142
-Alias: csISOTextComm
-
-Name: IEC_P27-1 [RFC1345,KXS2]
-MIBenum: 88
-Source: ECMA registry
-Alias: iso-ir-143
-Alias: csISO143IECP271
-
-Name: ISO_8859-5:1988 [RFC1345,KXS2]
-MIBenum: 8
-Source: ECMA registry
-Alias: iso-ir-144
-Alias: ISO_8859-5
-Alias: ISO-8859-5 (preferred MIME name)
-Alias: cyrillic
-Alias: csISOLatinCyrillic
-
-Name: JUS_I.B1.003-serb [RFC1345,KXS2]
-MIBenum: 89
-Source: ECMA registry
-Alias: iso-ir-146
-Alias: serbian
-Alias: csISO146Serbian
-
-Name: JUS_I.B1.003-mac [RFC1345,KXS2]
-MIBenum: 90
-Source: ECMA registry
-Alias: macedonian
-Alias: iso-ir-147
-Alias: csISO147Macedonian
-
-Name: ISO_8859-9:1989 [RFC1345,KXS2]
-MIBenum: 12
-Source: ECMA registry
-Alias: iso-ir-148
-Alias: ISO_8859-9
-Alias: ISO-8859-9 (preferred MIME name)
-Alias: latin5
-Alias: l5
-Alias: csISOLatin5
-
-Name: greek-ccitt [RFC1345,KXS2]
-MIBenum: 91
-Source: ECMA registry
-Alias: iso-ir-150
-Alias: csISO150
-Alias: csISO150GreekCCITT
-
-Name: NC_NC00-10:81 [RFC1345,KXS2]
-MIBenum: 92
-Source: ECMA registry
-Alias: cuba
-Alias: iso-ir-151
-Alias: ISO646-CU
-Alias: csISO151Cuba
-
-Name: ISO_6937-2-25 [RFC1345,KXS2]
-MIBenum: 93
-Source: ECMA registry
-Alias: iso-ir-152
-Alias: csISO6937Add
-
-Name: GOST_19768-74 [RFC1345,KXS2]
-MIBenum: 94
-Source: ECMA registry
-Alias: ST_SEV_358-88
-Alias: iso-ir-153
-Alias: csISO153GOST1976874
-
-Name: ISO_8859-supp [RFC1345,KXS2]
-MIBenum: 95
-Source: ECMA registry
-Alias: iso-ir-154
-Alias: latin1-2-5
-Alias: csISO8859Supp
-
-Name: ISO_10367-box [RFC1345,KXS2]
-MIBenum: 96
-Source: ECMA registry
-Alias: iso-ir-155
-Alias: csISO10367Box
-
-Name: ISO-8859-10 (preferred MIME name) [RFC1345,KXS2]
-MIBenum: 13
-Source: ECMA registry
-Alias: iso-ir-157
-Alias: l6
-Alias: ISO_8859-10:1992
-Alias: csISOLatin6
-Alias: latin6
-
-Name: latin-lap [RFC1345,KXS2]
-MIBenum: 97
-Source: ECMA registry
-Alias: lap
-Alias: iso-ir-158
-Alias: csISO158Lap
-
-Name: JIS_X0212-1990 [RFC1345,KXS2]
-MIBenum: 98
-Source: ECMA registry
-Alias: x0212
-Alias: iso-ir-159
-Alias: csISO159JISX02121990
-
-Name: DS_2089 [RFC1345,KXS2]
-MIBenum: 99
-Source: Danish Standard, DS 2089, February 1974
-Alias: DS2089
-Alias: ISO646-DK
-Alias: dk
-Alias: csISO646Danish
-
-Name: us-dk [RFC1345,KXS2]
-MIBenum: 100
-Alias: csUSDK
-
-Name: dk-us [RFC1345,KXS2]
-MIBenum: 101
-Alias: csDKUS
-
-Name: JIS_X0201 [RFC1345,KXS2]
-MIBenum: 15
-Source: JIS X 0201-1976. One byte only, this is equivalent to
- JIS/Roman (similar to ASCII) plus eight-bit half-width
- Katakana
-Alias: X0201
-Alias: csHalfWidthKatakana
-
-Name: KSC5636 [RFC1345,KXS2]
-MIBenum: 102
-Alias: ISO646-KR
-Alias: csKSC5636
-
-Name: ISO-10646-UCS-2
-MIBenum: 1000
-Source: the 2-octet Basic Multilingual Plane, aka Unicode
- this needs to specify network byte order: the standard
- does not specify (it is a 16-bit integer space)
-Alias: csUnicode
-
-Name: ISO-10646-UCS-4
-MIBenum: 1001
-Source: the full code space. (same comment about byte order,
- these are 31-bit numbers.
-Alias: csUCS4
-
-Name: DEC-MCS [RFC1345,KXS2]
-MIBenum: 2008
-Source: VAX/VMS User's Manual,
- Order Number: AI-Y517A-TE, April 1986.
-Alias: dec
-Alias: csDECMCS
-
-Name: hp-roman8 [HP-PCL5,RFC1345,KXS2]
-MIBenum: 2004
-Source: LaserJet IIP Printer User's Manual,
- HP part no 33471-90901, Hewlet-Packard, June 1989.
-Alias: roman8
-Alias: r8
-Alias: csHPRoman8
-
-Name: macintosh [RFC1345,KXS2]
-MIBenum: 2027
-Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991
-Alias: mac
-Alias: csMacintosh
-
-Name: IBM037 [RFC1345,KXS2]
-MIBenum: 2028
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp037
-Alias: ebcdic-cp-us
-Alias: ebcdic-cp-ca
-Alias: ebcdic-cp-wt
-Alias: ebcdic-cp-nl
-Alias: csIBM037
-
-Name: IBM038 [RFC1345,KXS2]
-MIBenum: 2029
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-INT
-Alias: cp038
-Alias: csIBM038
-
-Name: IBM273 [RFC1345,KXS2]
-MIBenum: 2030
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP273
-Alias: csIBM273
-
-Name: IBM274 [RFC1345,KXS2]
-MIBenum: 2031
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-BE
-Alias: CP274
-Alias: csIBM274
-
-Name: IBM275 [RFC1345,KXS2]
-MIBenum: 2032
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: EBCDIC-BR
-Alias: cp275
-Alias: csIBM275
-
-Name: IBM277 [RFC1345,KXS2]
-MIBenum: 2033
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: EBCDIC-CP-DK
-Alias: EBCDIC-CP-NO
-Alias: csIBM277
-
-Name: IBM278 [RFC1345,KXS2]
-MIBenum: 2034
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP278
-Alias: ebcdic-cp-fi
-Alias: ebcdic-cp-se
-Alias: csIBM278
-
-Name: IBM280 [RFC1345,KXS2]
-MIBenum: 2035
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP280
-Alias: ebcdic-cp-it
-Alias: csIBM280
-
-Name: IBM281 [RFC1345,KXS2]
-MIBenum: 2036
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-JP-E
-Alias: cp281
-Alias: csIBM281
-
-Name: IBM284 [RFC1345,KXS2]
-MIBenum: 2037
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP284
-Alias: ebcdic-cp-es
-Alias: csIBM284
-
-Name: IBM285 [RFC1345,KXS2]
-MIBenum: 2038
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP285
-Alias: ebcdic-cp-gb
-Alias: csIBM285
-
-Name: IBM290 [RFC1345,KXS2]
-MIBenum: 2039
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: cp290
-Alias: EBCDIC-JP-kana
-Alias: csIBM290
-
-Name: IBM297 [RFC1345,KXS2]
-MIBenum: 2040
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp297
-Alias: ebcdic-cp-fr
-Alias: csIBM297
-
-Name: IBM420 [RFC1345,KXS2]
-MIBenum: 2041
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990,
- IBM NLS RM p 11-11
-Alias: cp420
-Alias: ebcdic-cp-ar1
-Alias: csIBM420
-
-Name: IBM423 [RFC1345,KXS2]
-MIBenum: 2042
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp423
-Alias: ebcdic-cp-gr
-Alias: csIBM423
-
-Name: IBM424 [RFC1345,KXS2]
-MIBenum: 2043
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp424
-Alias: ebcdic-cp-he
-Alias: csIBM424
-
-Name: IBM437 [RFC1345,KXS2]
-MIBenum: 2011
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp437
-Alias: 437
-Alias: csPC8CodePage437
-
-Name: IBM500 [RFC1345,KXS2]
-MIBenum: 2044
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP500
-Alias: ebcdic-cp-be
-Alias: ebcdic-cp-ch
-Alias: csIBM500
-
-Name: IBM775 [HP-PCL5]
-MIBenum: 2087
-Source: HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996
-Alias: cp775
-Alias: csPC775Baltic
-
-Name: IBM850 [RFC1345,KXS2]
-MIBenum: 2009
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp850
-Alias: 850
-Alias: csPC850Multilingual
-
-Name: IBM851 [RFC1345,KXS2]
-MIBenum: 2045
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp851
-Alias: 851
-Alias: csIBM851
-
-Name: IBM852 [RFC1345,KXS2]
-MIBenum: 2010
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp852
-Alias: 852
-Alias: csPCp852
-
-Name: IBM855 [RFC1345,KXS2]
-MIBenum: 2046
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp855
-Alias: 855
-Alias: csIBM855
-
-Name: IBM857 [RFC1345,KXS2]
-MIBenum: 2047
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp857
-Alias: 857
-Alias: csIBM857
-
-Name: IBM860 [RFC1345,KXS2]
-MIBenum: 2048
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp860
-Alias: 860
-Alias: csIBM860
-
-Name: IBM861 [RFC1345,KXS2]
-MIBenum: 2049
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp861
-Alias: 861
-Alias: cp-is
-Alias: csIBM861
-
-Name: IBM862 [RFC1345,KXS2]
-MIBenum: 2013
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp862
-Alias: 862
-Alias: csPC862LatinHebrew
-
-Name: IBM863 [RFC1345,KXS2]
-MIBenum: 2050
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp863
-Alias: 863
-Alias: csIBM863
-
-Name: IBM864 [RFC1345,KXS2]
-MIBenum: 2051
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp864
-Alias: csIBM864
-
-Name: IBM865 [RFC1345,KXS2]
-MIBenum: 2052
-Source: IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987)
-Alias: cp865
-Alias: 865
-Alias: csIBM865
-
-Name: IBM866 [Pond]
-MIBenum: 2086
-Source: IBM NLDG Volume 2 (SE09-8002-03) August 1994
-Alias: cp866
-Alias: 866
-Alias: csIBM866
-
-Name: IBM868 [RFC1345,KXS2]
-MIBenum: 2053
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP868
-Alias: cp-ar
-Alias: csIBM868
-
-Name: IBM869 [RFC1345,KXS2]
-MIBenum: 2054
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp869
-Alias: 869
-Alias: cp-gr
-Alias: csIBM869
-
-Name: IBM870 [RFC1345,KXS2]
-MIBenum: 2055
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP870
-Alias: ebcdic-cp-roece
-Alias: ebcdic-cp-yu
-Alias: csIBM870
-
-Name: IBM871 [RFC1345,KXS2]
-MIBenum: 2056
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP871
-Alias: ebcdic-cp-is
-Alias: csIBM871
-
-Name: IBM880 [RFC1345,KXS2]
-MIBenum: 2057
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp880
-Alias: EBCDIC-Cyrillic
-Alias: csIBM880
-
-Name: IBM891 [RFC1345,KXS2]
-MIBenum: 2058
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp891
-Alias: csIBM891
-
-Name: IBM903 [RFC1345,KXS2]
-MIBenum: 2059
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp903
-Alias: csIBM903
-
-Name: IBM904 [RFC1345,KXS2]
-MIBenum: 2060
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp904
-Alias: 904
-Alias: csIBBM904
-
-Name: IBM905 [RFC1345,KXS2]
-MIBenum: 2061
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: CP905
-Alias: ebcdic-cp-tr
-Alias: csIBM905
-
-Name: IBM918 [RFC1345,KXS2]
-MIBenum: 2062
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP918
-Alias: ebcdic-cp-ar2
-Alias: csIBM918
-
-Name: IBM1026 [RFC1345,KXS2]
-MIBenum: 2063
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP1026
-Alias: csIBM1026
-
-Name: EBCDIC-AT-DE [RFC1345,KXS2]
-MIBenum: 2064
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csIBMEBCDICATDE
-
-Name: EBCDIC-AT-DE-A [RFC1345,KXS2]
-MIBenum: 2065
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICATDEA
-
-Name: EBCDIC-CA-FR [RFC1345,KXS2]
-MIBenum: 2066
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICCAFR
-
-Name: EBCDIC-DK-NO [RFC1345,KXS2]
-MIBenum: 2067
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICDKNO
-
-Name: EBCDIC-DK-NO-A [RFC1345,KXS2]
-MIBenum: 2068
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICDKNOA
-
-Name: EBCDIC-FI-SE [RFC1345,KXS2]
-MIBenum: 2069
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFISE
-
-Name: EBCDIC-FI-SE-A [RFC1345,KXS2]
-MIBenum: 2070
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFISEA
-
-Name: EBCDIC-FR [RFC1345,KXS2]
-MIBenum: 2071
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFR
-
-Name: EBCDIC-IT [RFC1345,KXS2]
-MIBenum: 2072
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICIT
-
-Name: EBCDIC-PT [RFC1345,KXS2]
-MIBenum: 2073
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICPT
-
-Name: EBCDIC-ES [RFC1345,KXS2]
-MIBenum: 2074
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICES
-
-Name: EBCDIC-ES-A [RFC1345,KXS2]
-MIBenum: 2075
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICESA
-
-Name: EBCDIC-ES-S [RFC1345,KXS2]
-MIBenum: 2076
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICESS
-
-Name: EBCDIC-UK [RFC1345,KXS2]
-MIBenum: 2077
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICUK
-
-Name: EBCDIC-US [RFC1345,KXS2]
-MIBenum: 2078
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICUS
-
-Name: UNKNOWN-8BIT [RFC1428]
-MIBenum: 2079
-Alias: csUnknown8BiT
-
-Name: MNEMONIC [RFC1345,KXS2]
-MIBenum: 2080
-Source: RFC 1345, also known as "mnemonic+ascii+38"
-Alias: csMnemonic
-
-Name: MNEM [RFC1345,KXS2]
-MIBenum: 2081
-Source: RFC 1345, also known as "mnemonic+ascii+8200"
-Alias: csMnem
-
-Name: VISCII [RFC1456]
-MIBenum: 2082
-Source: RFC 1456
-Alias: csVISCII
-
-Name: VIQR [RFC1456]
-MIBenum: 2083
-Source: RFC 1456
-Alias: csVIQR
-
-Name: KOI8-R (preferred MIME name) [RFC1489]
-MIBenum: 2084
-Source: RFC 1489, based on GOST-19768-74, ISO-6937/8,
- INIS-Cyrillic, ISO-5427.
-Alias: csKOI8R
-
-Name: KOI8-U [RFC2319]
-MIBenum: 2088
-Source: RFC 2319
-
-Name: IBM00858
-MIBenum: 2089
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00858) [Mahdi]
-Alias: CCSID00858
-Alias: CP00858
-Alias: PC-Multilingual-850+euro
-
-Name: IBM00924
-MIBenum: 2090
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00924) [Mahdi]
-Alias: CCSID00924
-Alias: CP00924
-Alias: ebcdic-Latin9--euro
-
-Name: IBM01140
-MIBenum: 2091
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01140) [Mahdi]
-Alias: CCSID01140
-Alias: CP01140
-Alias: ebcdic-us-37+euro
-
-Name: IBM01141
-MIBenum: 2092
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01141) [Mahdi]
-Alias: CCSID01141
-Alias: CP01141
-Alias: ebcdic-de-273+euro
-
-Name: IBM01142
-MIBenum: 2093
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01142) [Mahdi]
-Alias: CCSID01142
-Alias: CP01142
-Alias: ebcdic-dk-277+euro
-Alias: ebcdic-no-277+euro
-
-Name: IBM01143
-MIBenum: 2094
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01143) [Mahdi]
-Alias: CCSID01143
-Alias: CP01143
-Alias: ebcdic-fi-278+euro
-Alias: ebcdic-se-278+euro
-
-Name: IBM01144
-MIBenum: 2095
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01144) [Mahdi]
-Alias: CCSID01144
-Alias: CP01144
-Alias: ebcdic-it-280+euro
-
-Name: IBM01145
-MIBenum: 2096
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01145) [Mahdi]
-Alias: CCSID01145
-Alias: CP01145
-Alias: ebcdic-es-284+euro
-
-Name: IBM01146
-MIBenum: 2097
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01146) [Mahdi]
-Alias: CCSID01146
-Alias: CP01146
-Alias: ebcdic-gb-285+euro
-
-Name: IBM01147
-MIBenum: 2098
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01147) [Mahdi]
-Alias: CCSID01147
-Alias: CP01147
-Alias: ebcdic-fr-297+euro
-
-Name: IBM01148
-MIBenum: 2099
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01148) [Mahdi]
-Alias: CCSID01148
-Alias: CP01148
-Alias: ebcdic-international-500+euro
-
-Name: IBM01149
-MIBenum: 2100
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01149) [Mahdi]
-Alias: CCSID01149
-Alias: CP01149
-Alias: ebcdic-is-871+euro
-
-Name: Big5-HKSCS [Yick]
-MIBenum: 2101
-Source: See (http://www.iana.org/assignments/charset-reg/Big5-HKSCS)
-Alias: None
-
-Name: IBM1047 [Robrigado]
-MIBenum: 2102
-Source: IBM1047 (EBCDIC Latin 1/Open Systems)
-http://www-1.ibm.com/servers/eserver/iseries/software/globalization/pdf/cp01047z.pdf
-Alias: IBM-1047
-
-Name: PTCP154 [Uskov]
-MIBenum: 2103
-Source: See (http://www.iana.org/assignments/charset-reg/PTCP154)
-Alias: csPTCP154
-Alias: PT154
-Alias: CP154
-Alias: Cyrillic-Asian
-
-Name: Amiga-1251
-MIBenum: 2104
-Source: See (http://www.amiga.ultranet.ru/Amiga-1251.html)
-Alias: Ami1251
-Alias: Amiga1251
-Alias: Ami-1251
-(Aliases are provided for historical reasons and should not be used)
- [Malyshev]
-
-Name: KOI7-switched
-MIBenum: 2105
-Source: See <http://www.iana.org/assignments/charset-reg/KOI7-switched>
-Aliases: None
-
-Name: UNICODE-1-1 [RFC1641]
-MIBenum: 1010
-Source: RFC 1641
-Alias: csUnicode11
-
-Name: SCSU
-MIBenum: 1011
-Source: SCSU See (http://www.iana.org/assignments/charset-reg/SCSU) [Scherer]
-Alias: None
-
-Name: UTF-7 [RFC2152]
-MIBenum: 1012
-Source: RFC 2152
-Alias: None
-
-Name: UTF-16BE [RFC2781]
-MIBenum: 1013
-Source: RFC 2781
-Alias: None
-
-Name: UTF-16LE [RFC2781]
-MIBenum: 1014
-Source: RFC 2781
-Alias: None
-
-Name: UTF-16 [RFC2781]
-MIBenum: 1015
-Source: RFC 2781
-Alias: None
-
-Name: CESU-8 [Phipps]
-MIBenum: 1016
-Source: <http://www.unicode.org/unicode/reports/tr26>
-Alias: csCESU-8
-
-Name: UTF-32 [Davis]
-MIBenum: 1017
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: UTF-32BE [Davis]
-MIBenum: 1018
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: UTF-32LE [Davis]
-MIBenum: 1019
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: BOCU-1 [Scherer]
-MIBenum: 1020
-Source: http://www.unicode.org/notes/tn6/
-Alias: csBOCU-1
-
-Name: UNICODE-1-1-UTF-7 [RFC1642]
-MIBenum: 103
-Source: RFC 1642
-Alias: csUnicode11UTF7
-
-Name: UTF-8 [RFC3629]
-MIBenum: 106
-Source: RFC 3629
-Alias: None
-
-Name: ISO-8859-13
-MIBenum: 109
-Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-13)[Tumasonis]
-Alias: None
-
-Name: ISO-8859-14
-MIBenum: 110
-Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-14) [Simonsen]
-Alias: iso-ir-199
-Alias: ISO_8859-14:1998
-Alias: ISO_8859-14
-Alias: latin8
-Alias: iso-celtic
-Alias: l8
-
-Name: ISO-8859-15
-MIBenum: 111
-Source: ISO
- Please see: <http://www.iana.org/assignments/charset-reg/ISO-8859-15>
-Alias: ISO_8859-15
-Alias: Latin-9
-
-Name: ISO-8859-16
-MIBenum: 112
-Source: ISO
-Alias: iso-ir-226
-Alias: ISO_8859-16:2001
-Alias: ISO_8859-16
-Alias: latin10
-Alias: l10
-
-Name: GBK
-MIBenum: 113
-Source: Chinese IT Standardization Technical Committee
- Please see: <http://www.iana.org/assignments/charset-reg/GBK>
-Alias: CP936
-Alias: MS936
-Alias: windows-936
-
-Name: GB18030
-MIBenum: 114
-Source: Chinese IT Standardization Technical Committee
- Please see: <http://www.iana.org/assignments/charset-reg/GB18030>
-Alias: None
-
-Name: OSD_EBCDIC_DF04_15
-MIBenum: 115
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-15>
-Alias: None
-
-Name: OSD_EBCDIC_DF03_IRV
-MIBenum: 116
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF03-IRV>
-Alias: None
-
-Name: OSD_EBCDIC_DF04_1
-MIBenum: 117
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-1>
-Alias: None
-
-Name: JIS_Encoding
-MIBenum: 16
-Source: JIS X 0202-1991. Uses ISO 2022 escape sequences to
- shift code sets as documented in JIS X 0202-1991.
-Alias: csJISEncoding
-
-Name: Shift_JIS (preferred MIME name)
-MIBenum: 17
-Source: This charset is an extension of csHalfWidthKatakana by
- adding graphic characters in JIS X 0208. The CCS's are
- JIS X0201:1997 and JIS X0208:1997. The
- complete definition is shown in Appendix 1 of JIS
- X0208:1997.
- This charset can be used for the top-level media type "text".
-Alias: MS_Kanji
-Alias: csShiftJIS
-
-Name: Extended_UNIX_Code_Packed_Format_for_Japanese
-MIBenum: 18
-Source: Standardized by OSF, UNIX International, and UNIX Systems
- Laboratories Pacific. Uses ISO 2022 rules to select
- code set 0: US-ASCII (a single 7-bit byte set)
- code set 1: JIS X0208-1990 (a double 8-bit byte set)
- restricted to A0-FF in both bytes
- code set 2: Half Width Katakana (a single 7-bit byte set)
- requiring SS2 as the character prefix
- code set 3: JIS X0212-1990 (a double 7-bit byte set)
- restricted to A0-FF in both bytes
- requiring SS3 as the character prefix
-Alias: csEUCPkdFmtJapanese
-Alias: EUC-JP (preferred MIME name)
-
-Name: Extended_UNIX_Code_Fixed_Width_for_Japanese
-MIBenum: 19
-Source: Used in Japan. Each character is 2 octets.
- code set 0: US-ASCII (a single 7-bit byte set)
- 1st byte = 00
- 2nd byte = 20-7E
- code set 1: JIS X0208-1990 (a double 7-bit byte set)
- restricted to A0-FF in both bytes
- code set 2: Half Width Katakana (a single 7-bit byte set)
- 1st byte = 00
- 2nd byte = A0-FF
- code set 3: JIS X0212-1990 (a double 7-bit byte set)
- restricted to A0-FF in
- the first byte
- and 21-7E in the second byte
-Alias: csEUCFixWidJapanese
-
-Name: ISO-10646-UCS-Basic
-MIBenum: 1002
-Source: ASCII subset of Unicode. Basic Latin = collection 1
- See ISO 10646, Appendix A
-Alias: csUnicodeASCII
-
-Name: ISO-10646-Unicode-Latin1
-MIBenum: 1003
-Source: ISO Latin-1 subset of Unicode. Basic Latin and Latin-1
- Supplement = collections 1 and 2. See ISO 10646,
- Appendix A. See RFC 1815.
-Alias: csUnicodeLatin1
-Alias: ISO-10646
-
-Name: ISO-10646-J-1
-Source: ISO 10646 Japanese, see RFC 1815.
-
-Name: ISO-Unicode-IBM-1261
-MIBenum: 1005
-Source: IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261
-Alias: csUnicodeIBM1261
-
-Name: ISO-Unicode-IBM-1268
-MIBenum: 1006
-Source: IBM Latin-4 Extended Presentation Set, GCSGID: 1268
-Alias: csUnicodeIBM1268
-
-Name: ISO-Unicode-IBM-1276
-MIBenum: 1007
-Source: IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276
-Alias: csUnicodeIBM1276
-
-Name: ISO-Unicode-IBM-1264
-MIBenum: 1008
-Source: IBM Arabic Presentation Set, GCSGID: 1264
-Alias: csUnicodeIBM1264
-
-Name: ISO-Unicode-IBM-1265
-MIBenum: 1009
-Source: IBM Hebrew Presentation Set, GCSGID: 1265
-Alias: csUnicodeIBM1265
-
-Name: ISO-8859-1-Windows-3.0-Latin-1 [HP-PCL5]
-MIBenum: 2000
-Source: Extended ISO 8859-1 Latin-1 for Windows 3.0.
- PCL Symbol Set id: 9U
-Alias: csWindows30Latin1
-
-Name: ISO-8859-1-Windows-3.1-Latin-1 [HP-PCL5]
-MIBenum: 2001
-Source: Extended ISO 8859-1 Latin-1 for Windows 3.1.
- PCL Symbol Set id: 19U
-Alias: csWindows31Latin1
-
-Name: ISO-8859-2-Windows-Latin-2 [HP-PCL5]
-MIBenum: 2002
-Source: Extended ISO 8859-2. Latin-2 for Windows 3.1.
- PCL Symbol Set id: 9E
-Alias: csWindows31Latin2
-
-Name: ISO-8859-9-Windows-Latin-5 [HP-PCL5]
-MIBenum: 2003
-Source: Extended ISO 8859-9. Latin-5 for Windows 3.1
- PCL Symbol Set id: 5T
-Alias: csWindows31Latin5
-
-Name: Adobe-Standard-Encoding [Adobe]
-MIBenum: 2005
-Source: PostScript Language Reference Manual
- PCL Symbol Set id: 10J
-Alias: csAdobeStandardEncoding
-
-Name: Ventura-US [HP-PCL5]
-MIBenum: 2006
-Source: Ventura US. ASCII plus characters typically used in
- publishing, like pilcrow, copyright, registered, trade mark,
- section, dagger, and double dagger in the range A0 (hex)
- to FF (hex).
- PCL Symbol Set id: 14J
-Alias: csVenturaUS
-
-Name: Ventura-International [HP-PCL5]
-MIBenum: 2007
-Source: Ventura International. ASCII plus coded characters similar
- to Roman8.
- PCL Symbol Set id: 13J
-Alias: csVenturaInternational
-
-Name: PC8-Danish-Norwegian [HP-PCL5]
-MIBenum: 2012
-Source: PC Danish Norwegian
- 8-bit PC set for Danish Norwegian
- PCL Symbol Set id: 11U
-Alias: csPC8DanishNorwegian
-
-Name: PC8-Turkish [HP-PCL5]
-MIBenum: 2014
-Source: PC Latin Turkish. PCL Symbol Set id: 9T
-Alias: csPC8Turkish
-
-Name: IBM-Symbols [IBM-CIDT]
-MIBenum: 2015
-Source: Presentation Set, CPGID: 259
-Alias: csIBMSymbols
-
-Name: IBM-Thai [IBM-CIDT]
-MIBenum: 2016
-Source: Presentation Set, CPGID: 838
-Alias: csIBMThai
-
-Name: HP-Legal [HP-PCL5]
-MIBenum: 2017
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 1U
-Alias: csHPLegal
-
-Name: HP-Pi-font [HP-PCL5]
-MIBenum: 2018
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 15U
-Alias: csHPPiFont
-
-Name: HP-Math8 [HP-PCL5]
-MIBenum: 2019
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 8M
-Alias: csHPMath8
-
-Name: Adobe-Symbol-Encoding [Adobe]
-MIBenum: 2020
-Source: PostScript Language Reference Manual
- PCL Symbol Set id: 5M
-Alias: csHPPSMath
-
-Name: HP-DeskTop [HP-PCL5]
-MIBenum: 2021
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 7J
-Alias: csHPDesktop
-
-Name: Ventura-Math [HP-PCL5]
-MIBenum: 2022
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 6M
-Alias: csVenturaMath
-
-Name: Microsoft-Publishing [HP-PCL5]
-MIBenum: 2023
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 6J
-Alias: csMicrosoftPublishing
-
-Name: Windows-31J
-MIBenum: 2024
-Source: Windows Japanese. A further extension of Shift_JIS
- to include NEC special characters (Row 13), NEC
- selection of IBM extensions (Rows 89 to 92), and IBM
- extensions (Rows 115 to 119). The CCS's are
- JIS X0201:1997, JIS X0208:1997, and these extensions.
- This charset can be used for the top-level media type "text",
- but it is of limited or specialized use (see RFC2278).
- PCL Symbol Set id: 19K
-Alias: csWindows31J
-
-Name: GB2312 (preferred MIME name)
-MIBenum: 2025
-Source: Chinese for People's Republic of China (PRC) mixed one byte,
- two byte set:
- 20-7E = one byte ASCII
- A1-FE = two byte PRC Kanji
- See GB 2312-80
- PCL Symbol Set Id: 18C
-Alias: csGB2312
-
-Name: Big5 (preferred MIME name)
-MIBenum: 2026
-Source: Chinese for Taiwan Multi-byte set.
- PCL Symbol Set Id: 18T
-Alias: csBig5
-
-Name: windows-1250
-MIBenum: 2250
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1250) [Lazhintseva]
-Alias: None
-
-Name: windows-1251
-MIBenum: 2251
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1251) [Lazhintseva]
-Alias: None
-
-Name: windows-1252
-MIBenum: 2252
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1252) [Wendt]
-Alias: None
-
-Name: windows-1253
-MIBenum: 2253
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1253) [Lazhintseva]
-Alias: None
-
-Name: windows-1254
-MIBenum: 2254
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1254) [Lazhintseva]
-Alias: None
-
-Name: windows-1255
-MIBenum: 2255
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1255) [Lazhintseva]
-Alias: None
-
-Name: windows-1256
-MIBenum: 2256
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1256) [Lazhintseva]
-Alias: None
-
-Name: windows-1257
-MIBenum: 2257
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1257) [Lazhintseva]
-Alias: None
-
-Name: windows-1258
-MIBenum: 2258
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1258) [Lazhintseva]
-Alias: None
-
-Name: TIS-620
-MIBenum: 2259
-Source: Thai Industrial Standards Institute (TISI) [Tantsetthi]
-
-Name: HZ-GB-2312
-MIBenum: 2085
-Source: RFC 1842, RFC 1843 [RFC1842, RFC1843]
-
-
-REFERENCES
-----------
-
-[RFC1345] Simonsen, K., "Character Mnemonics & Character Sets",
- RFC 1345, Rationel Almen Planlaegning, Rationel Almen
- Planlaegning, June 1992.
-
-[RFC1428] Vaudreuil, G., "Transition of Internet Mail from
- Just-Send-8 to 8bit-SMTP/MIME", RFC1428, CNRI, February
- 1993.
-
-[RFC1456] Vietnamese Standardization Working Group, "Conventions for
- Encoding the Vietnamese Language VISCII: VIetnamese
- Standard Code for Information Interchange VIQR: VIetnamese
- Quoted-Readable Specification Revision 1.1", RFC 1456, May
- 1993.
-
-[RFC1468] Murai, J., Crispin, M., and E. van der Poel, "Japanese
- Character Encoding for Internet Messages", RFC 1468,
- Keio University, Panda Programming, June 1993.
-
-[RFC1489] Chernov, A., "Registration of a Cyrillic Character Set",
- RFC1489, RELCOM Development Team, July 1993.
-
-[RFC1554] Ohta, M., and K. Handa, "ISO-2022-JP-2: Multilingual
- Extension of ISO-2022-JP", RFC1554, Tokyo Institute of
- Technology, ETL, December 1993.
-
-[RFC1556] Nussbacher, H., "Handling of Bi-directional Texts in MIME",
- RFC1556, Israeli Inter-University, December 1993.
-
-[RFC1557] Choi, U., Chon, K., and H. Park, "Korean Character Encoding
- for Internet Messages", KAIST, Solvit Chosun Media,
- December 1993.
-
-[RFC1641] Goldsmith, D., and M. Davis, "Using Unicode with MIME",
- RFC1641, Taligent, Inc., July 1994.
-
-[RFC1642] Goldsmith, D., and M. Davis, "UTF-7", RFC1642, Taligent,
- Inc., July 1994.
-
-[RFC1815] Ohta, M., "Character Sets ISO-10646 and ISO-10646-J-1",
- RFC 1815, Tokyo Institute of Technology, July 1995.
-
-
-[Adobe] Adobe Systems Incorporated, PostScript Language Reference
- Manual, second edition, Addison-Wesley Publishing Company,
- Inc., 1990.
-
-[ECMA Registry] ISO-IR: International Register of Escape Sequences
- http://www.itscj.ipsj.or.jp/ISO-IE/ Note: The current
- registration authority is IPSJ/ITSCJ, Japan.
-
-[HP-PCL5] Hewlett-Packard Company, "HP PCL 5 Comparison Guide",
- (P/N 5021-0329) pp B-13, 1996.
-
-[IBM-CIDT] IBM Corporation, "ABOUT TYPE: IBM's Technical Reference
- for Core Interchange Digitized Type", Publication number
- S544-3708-01
-
-[RFC1842] Wei, Y., J. Li, and Y. Jiang, "ASCII Printable
- Characters-Based Chinese Character Encoding for Internet
- Messages", RFC 1842, Harvard University, Rice University,
- University of Maryland, August 1995.
-
-[RFC1843] Lee, F., "HZ - A Data Format for Exchanging Files of
- Arbitrarily Mixed Chinese and ASCII Characters", RFC 1843,
- Stanford University, August 1995.
-
-[RFC2152] Goldsmith, D., M. Davis, "UTF-7: A Mail-Safe Transformation
- Format of Unicode", RFC 2152, Apple Computer, Inc.,
- Taligent Inc., May 1997.
-
-[RFC2279] Yergeau, F., "UTF-8, A Transformation Format of ISO 10646",
- RFC 2279, Alis Technologies, January, 1998.
-
-[RFC2781] Hoffman, P., Yergeau, F., "UTF-16, an encoding of ISO 10646",
- RFC 2781, February 2000.
-
-[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646",
- RFC3629, November 2003.
-
-PEOPLE
-------
-
-[KXS2] Keld Simonsen <Keld.Simonsen(a)dkuug.dk>
-
-[Choi] Woohyong Choi <whchoi(a)cosmos.kaist.ac.kr>
-
-[Davis] Mark Davis, <mark(a)unicode.org>, April 2002.
-
-[Lazhintseva] Katya Lazhintseva, <katyal(a)MICROSOFT.com>, May 1996.
-
-[Mahdi] Tamer Mahdi, <tamer(a)ca.ibm.com>, August 2000.
-
-[Malyshev] Michael Malyshev, <michael_malyshev(a)mail.ru>, January 2004
-
-[Murai] Jun Murai <jun(a)wide.ad.jp>
-
-[Nussbacher] Hank Nussbacher, <hank(a)vm.tau.ac.il>
-
-[Ohta] Masataka Ohta, <mohta(a)cc.titech.ac.jp>, July 1995.
-
-[Phipps] Toby Phipps, <tphipps(a)peoplesoft.com>, March 2002.
-
-[Pond] Rick Pond, <rickpond(a)vnet.ibm.com>, March 1997.
-
-[Robrigado] Reuel Robrigado, <reuelr(a)ca.ibm.com>, September 2002.
-
-[Scherer] Markus Scherer, <markus.scherer(a)jtcsv.com>, August 2000,
- September 2002.
-
-[Simonsen] Keld Simonsen, <Keld.Simonsen(a)rap.dk>, August 2000.
-
-[Tantsetthi] Trin Tantsetthi, <trin(a)mozart.inet.co.th>, September 1998.
-
-[Tumasonis] Vladas Tumasonis, <vladas.tumasonis(a)maf.vu.lt>, August 2000.
-
-[Uskov] Alexander Uskov, <auskov(a)idc.kz>, September 2002.
-
-[Wendt] Chris Wendt, <christw(a)microsoft.com>, December 1999.
-
-[Yick] Nicky Yick, <cliac(a)itsd.gcn.gov.hk>, October 2000.
-
-[]
-
-
-
-
-
-
-
diff --git a/aliases/makealiases.c b/aliases/makealiases.c
deleted file mode 100644
index 370a234..0000000
--- a/aliases/makealiases.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- * IANA charset data to Iconv Aliases file convertor
- *
- * Version history:
- *
- * 0.01 - Initial version
- * 0.02 - Added "utf8" alias seen in the wild
- */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct extra {
- const char *canon;
- const char *aliases;
-} extras[] = {
- { "ISO-8859-1", "8859_1 ISO8859-1" },
- { "ISO-8859-2", "8859_2 ISO8859-2" },
- { "ISO-8859-3", "8859_3 ISO8859-3" },
- { "ISO-8859-4", "8859_4 ISO8859-4" },
- { "ISO-8859-5", "8859_5 ISO8859-5" },
- { "ISO-8859-7", "8859_7 ISO8859-7" },
- { "ISO-8859-8", "8859_8 ISO8859-8" },
- { "ISO-8859-9", "8859_9 ISO8859-9" },
- { "ISO-8859-10", "8859_10 ISO8859-10" },
- { "ISO-8859-13", "8859_13 ISO8859-13" },
- { "ISO-8859-14", "8859_14 ISO8859-14" },
- { "ISO-8859-15", "8859_15 ISO8859-15" },
- { "Shift_JIS", "X-SJIS Shift-JIS" },
- { "EUC-JP", "EUCJP" },
- { "EUC-KR", "EUCKR" },
- { "UTF-8", "UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8 utf8" },
- { "ISO-10646-UCS-4", "UCS-4 UCS4" },
- { "ISO-10646-UCS-2", "UCS-2 UCS2" },
- { "GB2312", "EUC-CN EUCCN CN-GB" },
- { "Big5", "BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE x-x-big5" },
- { "macintosh", "MACROMAN MAC-ROMAN X-MAC-ROMAN" },
- { "windows-1250", "CP1250 MS-EE" },
- { "windows-1251", "CP1251 MS-CYRL" },
- { "windows-1252", "CP1252 MS-ANSI" },
- { "windows-1253", "CP1253 MS-GREEK" },
- { "windows-1254", "CP1254 MS-TURK" },
- { "windows-1256", "CP1256 MS-ARAB" },
- { "windows-1257", "CP1257 WINBALTRIM" },
-};
-#define EXTRAS_SIZE (sizeof(extras) / sizeof(extras[0]))
-
-/*
- * Make aliases file from IANA charset data.
- * The canonical name of an encoding is that which follows the "Name:" tag
- * in the input file. There is an exception, however, for those encodings
- * which have an alias which is denoted as the "preferred MIME name". For
- * these encodings, the preferred MIME name is taken as the canonical form.
- */
-
-#define TOP argv[1]
-#define SETS argv[2]
-#define BOTTOM argv[3]
-#define ALIASES argv[4]
-
-int main(int argc, const char **argv)
-{
- FILE *in, *out;
- char buf[200], name[64];
- short mibenum;
- char *s, *n, *aliases, *temp;
- int i;
- int namelen;
-
- in = fopen(TOP, "r");
- if (!in)
- return 1;
-
- out = fopen(ALIASES, "w");
- if (!out)
- return 1;
-
- while (fgets(buf, sizeof buf, in)) {
- fputs(buf, out);
- }
-
- fclose(in);
-
- in = fopen(SETS, "r");
- if (!in) {
- fclose(out);
- return 1;
- }
-
- fgets(buf, sizeof buf, in);
-
- while (1) {
- /* find start of record */
- if (strncmp(buf, "Name:", 5) != 0) {
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- }
- }
- if(strncmp(buf, "Name:", 5) != 0)
- break;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf+5;
- /* skip whitespace */
- while (isspace(*s))
- s++;
- /* copy name to buffer */
- n = name;
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
-
- /* get mibenum */
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- if (strncmp(buf, "MIBenum:", 8) == 0)
- break;
- }
- if (strncmp(buf, "MIBenum:", 8) != 0)
- continue;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf+8;
- while (isspace(*s))
- s++;
- mibenum = atoi(s);
-
- aliases = malloc(1);
- if (!aliases)
- break;
- *aliases = '\0';
-
- /* parse aliases */
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- if (strncmp(buf, "Alias:", 6) != 0)
- continue;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf + 6;
- while (isspace(*s))
- s++;
-
- if (strncmp(s, "None", 4) == 0)
- /* ignore this */
- continue;
-
- if (strstr(s, "preferred MIME name") != 0) {
- temp = realloc(aliases,
- strlen(aliases) + 1 +
- strlen(name) + 1);
- if (!temp)
- goto end;
- aliases = temp;
- sprintf(aliases, "%s%s%s", aliases,
- aliases[0] == '\0' ? "" : " ", name);
- n = name;
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
- }
- else {
- n = s;
- while (*n) {
- if (isspace(*n))
- break;
- n++;
- }
- temp = realloc(aliases,
- strlen(aliases) + 1 + (n - s) + 1);
- if (!temp)
- goto end;
- aliases = temp;
- n = aliases + strlen(aliases);
- if (aliases[0] != '\0')
- *n++ = ' ';
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
- }
- }
-
- fprintf(out, "%s\t", name);
-
- /* Rounded up to tab stop */
- namelen = (strlen(name) + 8) & ~(8 - 1);
- while (namelen < 3 * 8) {
- fputc('\t', out);
- namelen += 8;
- }
-
- fprintf(out, "%d", mibenum);
-
- if (aliases[0] != '\0')
- fprintf(out, "\t\t%s", aliases);
- for (i = 0; i != EXTRAS_SIZE; i++) {
- if (strcmp(name, extras[i].canon) == 0) {
- fprintf(out, "%s%s",
- aliases[0] == '\0' ? "\t\t" : " ",
- extras[i].aliases);
- break;
- }
- }
- fprintf(out, "\n");
-
- free(aliases);
- }
-
-end:
- fclose(in);
-
- in = fopen(BOTTOM, "r");
- if (!in) {
- fclose(out);
- return 1;
- }
-
- while (fgets(buf, sizeof buf, in))
- fputs(buf, out);
-
- fclose(in);
- fclose(out);
-
- return 0;
-}
-
diff --git a/riscos/!Boot/Resources/!Unicode/Files/Aliases b/riscos/!Boot/Resources/!Unicode/Files/Aliases
new file mode 100644
index 0000000..8978ede
--- /dev/null
+++ b/riscos/!Boot/Resources/!Unicode/Files/Aliases
@@ -0,0 +1,303 @@
+# > Unicode:Files.Aliases
+# Mapping of character set encoding names to their canonical form
+#
+# Lines starting with a '#' are comments, blank lines are ignored.
+#
+# Based on http://www.iana.org/assignments/character-sets and
+# http://www.iana.org/assignments/ianacharset-mib
+#
+# Canonical Form MIBenum Aliases...
+#
+US-ASCII 3 iso-ir-6 ANSI_X3.4-1986 ISO_646.irv:1991 ASCII ISO646-US ANSI_X3.4-1968 us IBM367 cp367 csASCII
+ISO-10646-UTF-1 27 csISO10646UTF1
+ISO_646.basic:1983 28 ref csISO646basic1983
+INVARIANT 29 csINVARIANT
+ISO_646.irv:1983 30 iso-ir-2 irv csISO2IntlRefVersion
+BS_4730 20 iso-ir-4 ISO646-GB gb uk csISO4UnitedKingdom
+NATS-SEFI 31 iso-ir-8-1 csNATSSEFI
+NATS-SEFI-ADD 32 iso-ir-8-2 csNATSSEFIADD
+NATS-DANO 33 iso-ir-9-1 csNATSDANO
+NATS-DANO-ADD 34 iso-ir-9-2 csNATSDANOADD
+SEN_850200_B 35 iso-ir-10 FI ISO646-FI ISO646-SE se csISO10Swedish
+SEN_850200_C 21 iso-ir-11 ISO646-SE2 se2 csISO11SwedishForNames
+KS_C_5601-1987 36 iso-ir-149 KS_C_5601-1989 KSC_5601 korean csKSC56011987
+ISO-2022-KR 37 csISO2022KR
+EUC-KR 38 csEUCKR EUCKR
+ISO-2022-JP 39 csISO2022JP
+ISO-2022-JP-2 40 csISO2022JP2
+ISO-2022-CN 104
+ISO-2022-CN-EXT 105
+JIS_C6220-1969-jp 41 JIS_C6220-1969 iso-ir-13 katakana x0201-7 csISO13JISC6220jp
+JIS_C6220-1969-ro 42 iso-ir-14 jp ISO646-JP csISO14JISC6220ro
+IT 22 iso-ir-15 ISO646-IT csISO15Italian
+PT 43 iso-ir-16 ISO646-PT csISO16Portuguese
+ES 23 iso-ir-17 ISO646-ES csISO17Spanish
+greek7-old 44 iso-ir-18 csISO18Greek7Old
+latin-greek 45 iso-ir-19 csISO19LatinGreek
+DIN_66003 24 iso-ir-21 de ISO646-DE csISO21German
+NF_Z_62-010_(1973) 46 iso-ir-25 ISO646-FR1 csISO25French
+Latin-greek-1 47 iso-ir-27 csISO27LatinGreek1
+ISO_5427 48 iso-ir-37 csISO5427Cyrillic
+JIS_C6226-1978 49 iso-ir-42 csISO42JISC62261978
+BS_viewdata 50 iso-ir-47 csISO47BSViewdata
+INIS 51 iso-ir-49 csISO49INIS
+INIS-8 52 iso-ir-50 csISO50INIS8
+INIS-cyrillic 53 iso-ir-51 csISO51INISCyrillic
+ISO_5427:1981 54 iso-ir-54 ISO5427Cyrillic1981
+ISO_5428:1980 55 iso-ir-55 csISO5428Greek
+GB_1988-80 56 iso-ir-57 cn ISO646-CN csISO57GB1988
+GB_2312-80 57 iso-ir-58 chinese csISO58GB231280
+NS_4551-1 25 iso-ir-60 ISO646-NO no csISO60DanishNorwegian csISO60Norwegian1
+NS_4551-2 58 ISO646-NO2 iso-ir-61 no2 csISO61Norwegian2
+NF_Z_62-010 26 iso-ir-69 ISO646-FR fr csISO69French
+videotex-suppl 59 iso-ir-70 csISO70VideotexSupp1
+PT2 60 iso-ir-84 ISO646-PT2 csISO84Portuguese2
+ES2 61 iso-ir-85 ISO646-ES2 csISO85Spanish2
+MSZ_7795.3 62 iso-ir-86 ISO646-HU hu csISO86Hungarian
+JIS_C6226-1983 63 iso-ir-87 x0208 JIS_X0208-1983 csISO87JISX0208
+greek7 64 iso-ir-88 csISO88Greek7
+ASMO_449 65 ISO_9036 arabic7 iso-ir-89 csISO89ASMO449
+iso-ir-90 66 csISO90
+JIS_C6229-1984-a 67 iso-ir-91 jp-ocr-a csISO91JISC62291984a
+JIS_C6229-1984-b 68 iso-ir-92 ISO646-JP-OCR-B jp-ocr-b csISO92JISC62991984b
+JIS_C6229-1984-b-add 69 iso-ir-93 jp-ocr-b-add csISO93JIS62291984badd
+JIS_C6229-1984-hand 70 iso-ir-94 jp-ocr-hand csISO94JIS62291984hand
+JIS_C6229-1984-hand-add 71 iso-ir-95 jp-ocr-hand-add csISO95JIS62291984handadd
+JIS_C6229-1984-kana 72 iso-ir-96 csISO96JISC62291984kana
+ISO_2033-1983 73 iso-ir-98 e13b csISO2033
+ANSI_X3.110-1983 74 iso-ir-99 CSA_T500-1983 NAPLPS csISO99NAPLPS
+ISO-8859-1 4 iso-ir-100 ISO_8859-1 ISO_8859-1:1987 latin1 l1 IBM819 CP819 csISOLatin1 8859_1 ISO8859-1
+ISO-8859-2 5 iso-ir-101 ISO_8859-2 ISO_8859-2:1987 latin2 l2 csISOLatin2 8859_2 ISO8859-2
+T.61-7bit 75 iso-ir-102 csISO102T617bit
+T.61-8bit 76 T.61 iso-ir-103 csISO103T618bit
+ISO-8859-3 6 iso-ir-109 ISO_8859-3 ISO_8859-3:1988 latin3 l3 csISOLatin3 8859_3 ISO8859-3
+ISO-8859-4 7 iso-ir-110 ISO_8859-4 ISO_8859-4:1988 latin4 l4 csISOLatin4 8859_4 ISO8859-4
+ECMA-cyrillic 77 iso-ir-111 KOI8-E csISO111ECMACyrillic
+CSA_Z243.4-1985-1 78 iso-ir-121 ISO646-CA csa7-1 ca csISO121Canadian1
+CSA_Z243.4-1985-2 79 iso-ir-122 ISO646-CA2 csa7-2 csISO122Canadian2
+CSA_Z243.4-1985-gr 80 iso-ir-123 csISO123CSAZ24341985gr
+ISO-8859-6 9 iso-ir-127 ISO_8859-6 ISO_8859-6:1987 ECMA-114 ASMO-708 arabic csISOLatinArabic
+ISO-8859-6-E 81 csISO88596E ISO_8859-6-E
+ISO-8859-6-I 82 csISO88596I ISO_8859-6-I
+ISO-8859-7 10 iso-ir-126 ISO_8859-7 ISO_8859-7:1987 ELOT_928 ECMA-118 greek greek8 csISOLatinGreek 8859_7 ISO8859-7
+T.101-G2 83 iso-ir-128 csISO128T101G2
+ISO-8859-8 11 iso-ir-138 ISO_8859-8 ISO_8859-8:1988 hebrew csISOLatinHebrew 8859_8 ISO8859-8
+ISO-8859-8-E 84 csISO88598E ISO_8859-8-E
+ISO-8859-8-I 85 csISO88598I ISO_8859-8-I
+CSN_369103 86 iso-ir-139 csISO139CSN369103
+JUS_I.B1.002 87 iso-ir-141 ISO646-YU js yu csISO141JUSIB1002
+ISO_6937-2-add 14 iso-ir-142 csISOTextComm
+IEC_P27-1 88 iso-ir-143 csISO143IECP271
+ISO-8859-5 8 iso-ir-144 ISO_8859-5 ISO_8859-5:1988 cyrillic csISOLatinCyrillic 8859_5 ISO8859-5
+JUS_I.B1.003-serb 89 iso-ir-146 serbian csISO146Serbian
+JUS_I.B1.003-mac 90 macedonian iso-ir-147 csISO147Macedonian
+ISO-8859-9 12 iso-ir-148 ISO_8859-9 ISO_8859-9:1989 latin5 l5 csISOLatin5 8859_9 ISO8859-9
+greek-ccitt 91 iso-ir-150 csISO150 csISO150GreekCCITT
+NC_NC00-10:81 92 cuba iso-ir-151 ISO646-CU csISO151Cuba
+ISO_6937-2-25 93 iso-ir-152 csISO6937Add
+GOST_19768-74 94 ST_SEV_358-88 iso-ir-153 csISO153GOST1976874
+ISO_8859-supp 95 iso-ir-154 latin1-2-5 csISO8859Supp
+ISO_10367-box 96 iso-ir-155 csISO10367Box
+ISO-8859-10 13 iso-ir-157 l6 ISO_8859-10:1992 csISOLatin6 latin6 8859_10 ISO8859-10
+latin-lap 97 lap iso-ir-158 csISO158Lap
+JIS_X0212-1990 98 x0212 iso-ir-159 csISO159JISX02121990
+DS_2089 99 DS2089 ISO646-DK dk csISO646Danish
+us-dk 100 csUSDK
+dk-us 101 csDKUS
+JIS_X0201 15 X0201 csHalfWidthKatakana
+KSC5636 102 ISO646-KR csKSC5636
+ISO-10646-UCS-2 1000 csUnicode UCS-2 UCS2
+ISO-10646-UCS-4 1001 csUCS4 UCS-4 UCS4
+DEC-MCS 2008 dec csDECMCS
+hp-roman8 2004 roman8 r8 csHPRoman8
+macintosh 2027 mac csMacintosh MACROMAN MAC-ROMAN X-MAC-ROMAN
+IBM037 2028 cp037 ebcdic-cp-us ebcdic-cp-ca ebcdic-cp-wt ebcdic-cp-nl csIBM037
+IBM038 2029 EBCDIC-INT cp038 csIBM038
+IBM273 2030 CP273 csIBM273
+IBM274 2031 EBCDIC-BE CP274 csIBM274
+IBM275 2032 EBCDIC-BR cp275 csIBM275
+IBM277 2033 EBCDIC-CP-DK EBCDIC-CP-NO csIBM277
+IBM278 2034 CP278 ebcdic-cp-fi ebcdic-cp-se csIBM278
+IBM280 2035 CP280 ebcdic-cp-it csIBM280
+IBM281 2036 EBCDIC-JP-E cp281 csIBM281
+IBM284 2037 CP284 ebcdic-cp-es csIBM284
+IBM285 2038 CP285 ebcdic-cp-gb csIBM285
+IBM290 2039 cp290 EBCDIC-JP-kana csIBM290
+IBM297 2040 cp297 ebcdic-cp-fr csIBM297
+IBM420 2041 cp420 ebcdic-cp-ar1 csIBM420
+IBM423 2042 cp423 ebcdic-cp-gr csIBM423
+IBM424 2043 cp424 ebcdic-cp-he csIBM424
+IBM437 2011 cp437 437 csPC8CodePage437
+IBM500 2044 CP500 ebcdic-cp-be ebcdic-cp-ch csIBM500
+IBM775 2087 cp775 csPC775Baltic
+IBM850 2009 cp850 850 csPC850Multilingual
+IBM851 2045 cp851 851 csIBM851
+IBM852 2010 cp852 852 csPCp852
+IBM855 2046 cp855 855 csIBM855
+IBM857 2047 cp857 857 csIBM857
+IBM860 2048 cp860 860 csIBM860
+IBM861 2049 cp861 861 cp-is csIBM861
+IBM862 2013 cp862 862 csPC862LatinHebrew
+IBM863 2050 cp863 863 csIBM863
+IBM864 2051 cp864 csIBM864
+IBM865 2052 cp865 865 csIBM865
+IBM866 2086 cp866 866 csIBM866
+IBM868 2053 CP868 cp-ar csIBM868
+IBM869 2054 cp869 869 cp-gr csIBM869
+IBM870 2055 CP870 ebcdic-cp-roece ebcdic-cp-yu csIBM870
+IBM871 2056 CP871 ebcdic-cp-is csIBM871
+IBM880 2057 cp880 EBCDIC-Cyrillic csIBM880
+IBM891 2058 cp891 csIBM891
+IBM903 2059 cp903 csIBM903
+IBM904 2060 cp904 904 csIBBM904
+IBM905 2061 CP905 ebcdic-cp-tr csIBM905
+IBM918 2062 CP918 ebcdic-cp-ar2 csIBM918
+IBM1026 2063 CP1026 csIBM1026
+EBCDIC-AT-DE 2064 csIBMEBCDICATDE
+EBCDIC-AT-DE-A 2065 csEBCDICATDEA
+EBCDIC-CA-FR 2066 csEBCDICCAFR
+EBCDIC-DK-NO 2067 csEBCDICDKNO
+EBCDIC-DK-NO-A 2068 csEBCDICDKNOA
+EBCDIC-FI-SE 2069 csEBCDICFISE
+EBCDIC-FI-SE-A 2070 csEBCDICFISEA
+EBCDIC-FR 2071 csEBCDICFR
+EBCDIC-IT 2072 csEBCDICIT
+EBCDIC-PT 2073 csEBCDICPT
+EBCDIC-ES 2074 csEBCDICES
+EBCDIC-ES-A 2075 csEBCDICESA
+EBCDIC-ES-S 2076 csEBCDICESS
+EBCDIC-UK 2077 csEBCDICUK
+EBCDIC-US 2078 csEBCDICUS
+UNKNOWN-8BIT 2079 csUnknown8BiT
+MNEMONIC 2080 csMnemonic
+MNEM 2081 csMnem
+VISCII 2082 csVISCII
+VIQR 2083 csVIQR
+KOI8-R 2084 csKOI8R
+KOI8-U 2088
+IBM00858 2089 CCSID00858 CP00858 PC-Multilingual-850+euro
+IBM00924 2090 CCSID00924 CP00924 ebcdic-Latin9--euro
+IBM01140 2091 CCSID01140 CP01140 ebcdic-us-37+euro
+IBM01141 2092 CCSID01141 CP01141 ebcdic-de-273+euro
+IBM01142 2093 CCSID01142 CP01142 ebcdic-dk-277+euro ebcdic-no-277+euro
+IBM01143 2094 CCSID01143 CP01143 ebcdic-fi-278+euro ebcdic-se-278+euro
+IBM01144 2095 CCSID01144 CP01144 ebcdic-it-280+euro
+IBM01145 2096 CCSID01145 CP01145 ebcdic-es-284+euro
+IBM01146 2097 CCSID01146 CP01146 ebcdic-gb-285+euro
+IBM01147 2098 CCSID01147 CP01147 ebcdic-fr-297+euro
+IBM01148 2099 CCSID01148 CP01148 ebcdic-international-500+euro
+IBM01149 2100 CCSID01149 CP01149 ebcdic-is-871+euro
+Big5-HKSCS 2101
+IBM1047 2102 IBM-1047
+PTCP154 2103 csPTCP154 PT154 CP154 Cyrillic-Asian
+Amiga-1251 2104 Ami1251 Amiga1251 Ami-1251
+KOI7-switched 2105
+UNICODE-1-1 1010 csUnicode11
+SCSU 1011
+UTF-7 1012
+UTF-16BE 1013
+UTF-16LE 1014
+UTF-16 1015
+CESU-8 1016 csCESU-8
+UTF-32 1017
+UTF-32BE 1018
+UTF-32LE 1019
+BOCU-1 1020 csBOCU-1
+UNICODE-1-1-UTF-7 103 csUnicode11UTF7
+UTF-8 106 UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8 utf8
+ISO-8859-13 109 8859_13 ISO8859-13
+ISO-8859-14 110 iso-ir-199 ISO_8859-14:1998 ISO_8859-14 latin8 iso-celtic l8 8859_14 ISO8859-14
+ISO-8859-15 111 ISO_8859-15 Latin-9 8859_15 ISO8859-15
+ISO-8859-16 112 iso-ir-226 ISO_8859-16:2001 ISO_8859-16 latin10 l10
+GBK 113 CP936 MS936 windows-936
+GB18030 114
+OSD_EBCDIC_DF04_15 115
+OSD_EBCDIC_DF03_IRV 116
+OSD_EBCDIC_DF04_1 117
+JIS_Encoding 16 csJISEncoding
+Shift_JIS 17 MS_Kanji csShiftJIS X-SJIS Shift-JIS
+EUC-JP 18 csEUCPkdFmtJapanese Extended_UNIX_Code_Packed_Format_for_Japanese EUCJP
+Extended_UNIX_Code_Fixed_Width_for_Japanese 19 csEUCFixWidJapanese
+ISO-10646-UCS-Basic 1002 csUnicodeASCII
+ISO-10646-Unicode-Latin1 1003 csUnicodeLatin1 ISO-10646
+ISO-Unicode-IBM-1261 1005 csUnicodeIBM1261
+ISO-Unicode-IBM-1268 1006 csUnicodeIBM1268
+ISO-Unicode-IBM-1276 1007 csUnicodeIBM1276
+ISO-Unicode-IBM-1264 1008 csUnicodeIBM1264
+ISO-Unicode-IBM-1265 1009 csUnicodeIBM1265
+ISO-8859-1-Windows-3.0-Latin-1 2000 csWindows30Latin1
+ISO-8859-1-Windows-3.1-Latin-1 2001 csWindows31Latin1
+ISO-8859-2-Windows-Latin-2 2002 csWindows31Latin2
+ISO-8859-9-Windows-Latin-5 2003 csWindows31Latin5
+Adobe-Standard-Encoding 2005 csAdobeStandardEncoding
+Ventura-US 2006 csVenturaUS
+Ventura-International 2007 csVenturaInternational
+PC8-Danish-Norwegian 2012 csPC8DanishNorwegian
+PC8-Turkish 2014 csPC8Turkish
+IBM-Symbols 2015 csIBMSymbols
+IBM-Thai 2016 csIBMThai
+HP-Legal 2017 csHPLegal
+HP-Pi-font 2018 csHPPiFont
+HP-Math8 2019 csHPMath8
+Adobe-Symbol-Encoding 2020 csHPPSMath
+HP-DeskTop 2021 csHPDesktop
+Ventura-Math 2022 csVenturaMath
+Microsoft-Publishing 2023 csMicrosoftPublishing
+Windows-31J 2024 csWindows31J
+GB2312 2025 csGB2312 EUC-CN EUCCN CN-GB
+Big5 2026 csBig5 BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE x-x-big5
+windows-1250 2250 CP1250 MS-EE
+windows-1251 2251 CP1251 MS-CYRL
+windows-1252 2252 CP1252 MS-ANSI
+windows-1253 2253 CP1253 MS-GREEK
+windows-1254 2254 CP1254 MS-TURK
+windows-1255 2255
+windows-1256 2256 CP1256 MS-ARAB
+windows-1257 2257 CP1257 WINBALTRIM
+windows-1258 2258
+TIS-620 2259
+HZ-GB-2312 2085
+
+# Additional encodings not defined by IANA
+
+# Arbitrary allocations
+#CP737 3001
+#CP853 3002
+#CP856 3003
+CP874 3004 WINDOWS-874
+#CP922 3005
+#CP1046 3006
+#CP1124 3007
+#CP1125 3008 WINDOWS-1125
+#CP1129 3009
+#CP1133 3010 IBM-CP1133
+#CP1161 3011 IBM-1161 IBM1161 CSIBM1161
+#CP1162 3012 IBM-1162 IBM1162 CSIBM1162
+#CP1163 3013 IBM-1163 IBM1163 CSIBM1163
+#GEORGIAN-ACADEMY 3014
+#GEORGIAN-PS 3015
+#KOI8-RU 3016
+#KOI8-T 3017
+#MACARABIC 3018 X-MAC-ARABIC MAC-ARABIC
+#MACCROATIAN 3019 X-MAC-CROATIAN MAC-CROATIAN
+#MACGREEK 3020 X-MAC-GREEK MAC-GREEK
+#MACHEBREW 3021 X-MAC-HEBREW MAC-HEBREW
+#MACICELAND 3022 X-MAC-ICELAND MAC-ICELAND
+#MACROMANIA 3023 X-MAC-ROMANIA MAC-ROMANIA
+#MACTHAI 3024 X-MAC-THAI MAC-THAI
+#MACTURKISH 3025 X-MAC-TURKISH MAC-TURKISH
+#MULELAO-1 3026
+CP949 3027 WINDOWS-949
+
+# From Unicode Lib
+ISO-IR-182 4000
+ISO-IR-197 4002
+ISO-2022-JP-1 4008
+MACCYRILLIC 4009 X-MAC-CYRILLIC MAC-CYRILLIC
+MACUKRAINE 4010 X-MAC-UKRAINIAN MAC-UKRAINIAN
+MACCENTRALEUROPE 4011 X-MAC-CENTRALEURROMAN MAC-CENTRALEURROMAN
+JOHAB 4012
+ISO-8859-11 4014 iso-ir-166 ISO_8859-11 ISO8859-11 8859_11
+X-CURRENT 4999 X-SYSTEM
+X-ACORN-LATIN1 5001
+X-ACORN-FUZZY 5002
-----------------------------------------------------------------------
Summary of changes:
Makefile | 8 +-
aliases/Makefile | 23 -
aliases/data/aliases-bottom | 44 -
aliases/data/aliases-top | 10 -
aliases/data/character-sets | 1868 --------------------
aliases/makealiases.c | 243 ---
.../!Boot/Resources/!Unicode/Files}/Aliases | 3 +-
unicode/.gitignore | 2 +
8 files changed, 7 insertions(+), 2194 deletions(-)
delete mode 100644 aliases/Makefile
delete mode 100644 aliases/data/aliases-bottom
delete mode 100644 aliases/data/aliases-top
delete mode 100644 aliases/data/character-sets
delete mode 100644 aliases/makealiases.c
copy {test/data => riscos/!Boot/Resources/!Unicode/Files}/Aliases (99%)
create mode 100644 unicode/.gitignore
diff --git a/Makefile b/Makefile
index 7943f72..b80c433 100644
--- a/Makefile
+++ b/Makefile
@@ -45,11 +45,9 @@ ifeq ($(COMPONENT_TYPE),riscos-module)
# TODO: Make this sensible. Preferably by making use of the install target.
riscos-dist: all
- $(Q)svn export -q riscos riscos-dist
- $(Q)$(CP) $(CPFLAGS) riscos/!Boot/Resources/!Unicode/Files/Aliases \
- riscos-dist/!Boot/Resources/!Unicode/Files/
+ $(Q)$(CP) $(CPFLAGS) -r riscos riscos-dist
+ $(Q)$(MKDIR) -p riscos-dist/!System/310/Modules
$(Q)$(CP) $(CPFLAGS) $(BUILDDIR)/iconv,ffa riscos-dist/!System/310/Modules/Iconv,ffa
- $(Q)svn export -q doc riscos-dist/doc
$(Q)$(RM) $(RMFLAGS) -r riscos-dist/doc/Standards
$(Q)$(CP) $(CPFLAGS) include/iconv/iconv.h riscos-dist/stubs/
$(Q)(cd riscos-dist ; $(GCCSDK_INSTALL_CROSSBIN)/zip -9r, ../iconv.zip *)
@@ -58,7 +56,7 @@ ifeq ($(COMPONENT_TYPE),riscos-module)
$(Q)$(MV) $(MVFLAGS) riscos-dist/!System riscos-dist/System
$(Q)$(RM) $(RMFLAGS) -r riscos-dist/doc riscos-dist/stubs
$(Q)$(RM) $(RMFLAGS) riscos-dist/ReadMe
- $(Q)svn export -q riscpkg/RiscPkg riscos-dist/RiscPkg
+ $(Q)$(CP) $(CPFLAGS) -r riscpkg/RiscPkg riscos-dist/
$(Q)$(CP) $(CPFLAGS) COPYING riscos-dist/RiscPkg/Copyright
$(Q)(cd riscos-dist ; $(GCCSDK_INSTALL_CROSSBIN)/zip -9r, ../iconv-pkg.zip *)
$(Q)$(RM) $(RMFLAGS) -r riscos-dist
diff --git a/aliases/Makefile b/aliases/Makefile
deleted file mode 100644
index ab0ebae..0000000
--- a/aliases/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-makealiases_SRCS := makealiases.c
-
-aliases_DATA := aliases-top character-sets aliases-bottom
-
-aliases := $(CURDIR)/riscos/!Boot/Resources/!Unicode/Files/Aliases
-
-makealiases := $(addprefix $(BUILDDIR)/, \
- $(subst /,_,$(addprefix $(DIR),makealiases)))
-
-DISTCLEAN_ITEMS := $(DISTCLEAN_ITEMS) $(aliases)
-
-# Target for building aliases file
-$(aliases): $(makealiases) $(addprefix $(DIR)data/, $(aliases_DATA))
- $(VQ)$(ECHO) $(ECHOFLAGS) " ALIASES: $@"
- $(Q)$(makealiases) $(wordlist 2,$(words $^),$^) $@
-
-# Target for building makealiases binary
-$(makealiases): $(addprefix $(DIR), $(makealiases_SRCS))
- $(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $^
-
-POST_TARGETS := $(POST_TARGETS) $(aliases)
-
-include $(NSBUILD)/Makefile.subdir
diff --git a/aliases/data/aliases-bottom b/aliases/data/aliases-bottom
deleted file mode 100644
index 5f58d9d..0000000
--- a/aliases/data/aliases-bottom
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Additional encodings not defined by IANA
-
-# Arbitrary allocations
-#CP737 3001
-#CP853 3002
-#CP856 3003
-CP874 3004 WINDOWS-874
-#CP922 3005
-#CP1046 3006
-#CP1124 3007
-#CP1125 3008 WINDOWS-1125
-#CP1129 3009
-#CP1133 3010 IBM-CP1133
-#CP1161 3011 IBM-1161 IBM1161 CSIBM1161
-#CP1162 3012 IBM-1162 IBM1162 CSIBM1162
-#CP1163 3013 IBM-1163 IBM1163 CSIBM1163
-#GEORGIAN-ACADEMY 3014
-#GEORGIAN-PS 3015
-#KOI8-RU 3016
-#KOI8-T 3017
-#MACARABIC 3018 X-MAC-ARABIC MAC-ARABIC
-#MACCROATIAN 3019 X-MAC-CROATIAN MAC-CROATIAN
-#MACGREEK 3020 X-MAC-GREEK MAC-GREEK
-#MACHEBREW 3021 X-MAC-HEBREW MAC-HEBREW
-#MACICELAND 3022 X-MAC-ICELAND MAC-ICELAND
-#MACROMANIA 3023 X-MAC-ROMANIA MAC-ROMANIA
-#MACTHAI 3024 X-MAC-THAI MAC-THAI
-#MACTURKISH 3025 X-MAC-TURKISH MAC-TURKISH
-#MULELAO-1 3026
-CP949 3027 WINDOWS-949
-
-# From Unicode Lib
-ISO-IR-182 4000
-ISO-IR-197 4002
-ISO-2022-JP-1 4008
-MACCYRILLIC 4009 X-MAC-CYRILLIC MAC-CYRILLIC
-MACUKRAINE 4010 X-MAC-UKRAINIAN MAC-UKRAINIAN
-MACCENTRALEUROPE 4011 X-MAC-CENTRALEURROMAN MAC-CENTRALEURROMAN
-JOHAB 4012
-ISO-8859-11 4014 iso-ir-166 ISO_8859-11 ISO8859-11 8859_11
-X-CURRENT 4999 X-SYSTEM
-X-ACORN-LATIN1 5001
-X-ACORN-FUZZY 5002
diff --git a/aliases/data/aliases-top b/aliases/data/aliases-top
deleted file mode 100644
index 84bf99c..0000000
--- a/aliases/data/aliases-top
+++ /dev/null
@@ -1,10 +0,0 @@
-# > Unicode:Files.Aliases
-# Mapping of character set encoding names to their canonical form
-#
-# Lines starting with a '#' are comments, blank lines are ignored.
-#
-# Based on http://www.iana.org/assignments/character-sets and
-# http://www.iana.org/assignments/ianacharset-mib
-#
-# Canonical Form MIBenum Aliases...
-#
diff --git a/aliases/data/character-sets b/aliases/data/character-sets
deleted file mode 100644
index 8cda52d..0000000
--- a/aliases/data/character-sets
+++ /dev/null
@@ -1,1868 +0,0 @@
-
-===================================================================
-CHARACTER SETS
-
-(last updated 28 January 2005)
-
-These are the official names for character sets that may be used in
-the Internet and may be referred to in Internet documentation. These
-names are expressed in ANSI_X3.4-1968 which is commonly called
-US-ASCII or simply ASCII. The character set most commonly use in the
-Internet and used especially in protocol standards is US-ASCII, this
-is strongly encouraged. The use of the name US-ASCII is also
-encouraged.
-
-The character set names may be up to 40 characters taken from the
-printable characters of US-ASCII. However, no distinction is made
-between use of upper and lower case letters.
-
-The MIBenum value is a unique value for use in MIBs to identify coded
-character sets.
-
-The value space for MIBenum values has been divided into three
-regions. The first region (3-999) consists of coded character sets
-that have been standardized by some standard setting organization.
-This region is intended for standards that do not have subset
-implementations. The second region (1000-1999) is for the Unicode and
-ISO/IEC 10646 coded character sets together with a specification of a
-(set of) sub-repertoires that may occur. The third region (>1999) is
-intended for vendor specific coded character sets.
-
- Assigned MIB enum Numbers
- -------------------------
- 0-2 Reserved
- 3-999 Set By Standards Organizations
- 1000-1999 Unicode / 10646
- 2000-2999 Vendor
-
-The aliases that start with "cs" have been added for use with the
-IANA-CHARSET-MIB as originally defined in RFC3808, and as currently
-maintained by IANA at http://www/iana.org/assignments/ianacharset-mib.
-Note that the ianacharset-mib needs to be kept in sync with this
-registry. These aliases that start with "cs" contain the standard
-numbers along with suggestive names in order to facilitate applications
-that want to display the names in user interfaces. The "cs" stands
-for character set and is provided for applications that need a lower
-case first letter but want to use mixed case thereafter that cannot
-contain any special characters, such as underbar ("_") and dash ("-").
-
-If the character set is from an ISO standard, its cs alias is the ISO
-standard number or name. If the character set is not from an ISO
-standard, but is registered with ISO (IPSJ/ITSCJ is the current ISO
-Registration Authority), the ISO Registry number is specified as
-ISOnnn followed by letters suggestive of the name or standards number
-of the code set. When a national or international standard is
-revised, the year of revision is added to the cs alias of the new
-character set entry in the IANA Registry in order to distinguish the
-revised character set from the original character set.
-
-
-Character Set Reference
-------------- ---------
-
-Name: ANSI_X3.4-1968 [RFC1345,KXS2]
-MIBenum: 3
-Source: ECMA registry
-Alias: iso-ir-6
-Alias: ANSI_X3.4-1986
-Alias: ISO_646.irv:1991
-Alias: ASCII
-Alias: ISO646-US
-Alias: US-ASCII (preferred MIME name)
-Alias: us
-Alias: IBM367
-Alias: cp367
-Alias: csASCII
-
-Name: ISO-10646-UTF-1
-MIBenum: 27
-Source: Universal Transfer Format (1), this is the multibyte
- encoding, that subsets ASCII-7. It does not have byte
- ordering issues.
-Alias: csISO10646UTF1
-
-Name: ISO_646.basic:1983 [RFC1345,KXS2]
-MIBenum: 28
-Source: ECMA registry
-Alias: ref
-Alias: csISO646basic1983
-
-Name: INVARIANT [RFC1345,KXS2]
-MIBenum: 29
-Alias: csINVARIANT
-
-Name: ISO_646.irv:1983 [RFC1345,KXS2]
-MIBenum: 30
-Source: ECMA registry
-Alias: iso-ir-2
-Alias: irv
-Alias: csISO2IntlRefVersion
-
-Name: BS_4730 [RFC1345,KXS2]
-MIBenum: 20
-Source: ECMA registry
-Alias: iso-ir-4
-Alias: ISO646-GB
-Alias: gb
-Alias: uk
-Alias: csISO4UnitedKingdom
-
-Name: NATS-SEFI [RFC1345,KXS2]
-MIBenum: 31
-Source: ECMA registry
-Alias: iso-ir-8-1
-Alias: csNATSSEFI
-
-Name: NATS-SEFI-ADD [RFC1345,KXS2]
-MIBenum: 32
-Source: ECMA registry
-Alias: iso-ir-8-2
-Alias: csNATSSEFIADD
-
-Name: NATS-DANO [RFC1345,KXS2]
-MIBenum: 33
-Source: ECMA registry
-Alias: iso-ir-9-1
-Alias: csNATSDANO
-
-Name: NATS-DANO-ADD [RFC1345,KXS2]
-MIBenum: 34
-Source: ECMA registry
-Alias: iso-ir-9-2
-Alias: csNATSDANOADD
-
-Name: SEN_850200_B [RFC1345,KXS2]
-MIBenum: 35
-Source: ECMA registry
-Alias: iso-ir-10
-Alias: FI
-Alias: ISO646-FI
-Alias: ISO646-SE
-Alias: se
-Alias: csISO10Swedish
-
-Name: SEN_850200_C [RFC1345,KXS2]
-MIBenum: 21
-Source: ECMA registry
-Alias: iso-ir-11
-Alias: ISO646-SE2
-Alias: se2
-Alias: csISO11SwedishForNames
-
-Name: KS_C_5601-1987 [RFC1345,KXS2]
-MIBenum: 36
-Source: ECMA registry
-Alias: iso-ir-149
-Alias: KS_C_5601-1989
-Alias: KSC_5601
-Alias: korean
-Alias: csKSC56011987
-
-Name: ISO-2022-KR (preferred MIME name) [RFC1557,Choi]
-MIBenum: 37
-Source: RFC-1557 (see also KS_C_5601-1987)
-Alias: csISO2022KR
-
-Name: EUC-KR (preferred MIME name) [RFC1557,Choi]
-MIBenum: 38
-Source: RFC-1557 (see also KS_C_5861-1992)
-Alias: csEUCKR
-
-Name: ISO-2022-JP (preferred MIME name) [RFC1468,Murai]
-MIBenum: 39
-Source: RFC-1468 (see also RFC-2237)
-Alias: csISO2022JP
-
-Name: ISO-2022-JP-2 (preferred MIME name) [RFC1554,Ohta]
-MIBenum: 40
-Source: RFC-1554
-Alias: csISO2022JP2
-
-Name: ISO-2022-CN [RFC1922]
-MIBenum: 104
-Source: RFC-1922
-
-Name: ISO-2022-CN-EXT [RFC1922]
-MIBenum: 105
-Source: RFC-1922
-
-Name: JIS_C6220-1969-jp [RFC1345,KXS2]
-MIBenum: 41
-Source: ECMA registry
-Alias: JIS_C6220-1969
-Alias: iso-ir-13
-Alias: katakana
-Alias: x0201-7
-Alias: csISO13JISC6220jp
-
-Name: JIS_C6220-1969-ro [RFC1345,KXS2]
-MIBenum: 42
-Source: ECMA registry
-Alias: iso-ir-14
-Alias: jp
-Alias: ISO646-JP
-Alias: csISO14JISC6220ro
-
-Name: IT [RFC1345,KXS2]
-MIBenum: 22
-Source: ECMA registry
-Alias: iso-ir-15
-Alias: ISO646-IT
-Alias: csISO15Italian
-
-Name: PT [RFC1345,KXS2]
-MIBenum: 43
-Source: ECMA registry
-Alias: iso-ir-16
-Alias: ISO646-PT
-Alias: csISO16Portuguese
-
-Name: ES [RFC1345,KXS2]
-MIBenum: 23
-Source: ECMA registry
-Alias: iso-ir-17
-Alias: ISO646-ES
-Alias: csISO17Spanish
-
-Name: greek7-old [RFC1345,KXS2]
-MIBenum: 44
-Source: ECMA registry
-Alias: iso-ir-18
-Alias: csISO18Greek7Old
-
-Name: latin-greek [RFC1345,KXS2]
-MIBenum: 45
-Source: ECMA registry
-Alias: iso-ir-19
-Alias: csISO19LatinGreek
-
-Name: DIN_66003 [RFC1345,KXS2]
-MIBenum: 24
-Source: ECMA registry
-Alias: iso-ir-21
-Alias: de
-Alias: ISO646-DE
-Alias: csISO21German
-
-Name: NF_Z_62-010_(1973) [RFC1345,KXS2]
-MIBenum: 46
-Source: ECMA registry
-Alias: iso-ir-25
-Alias: ISO646-FR1
-Alias: csISO25French
-
-Name: Latin-greek-1 [RFC1345,KXS2]
-MIBenum: 47
-Source: ECMA registry
-Alias: iso-ir-27
-Alias: csISO27LatinGreek1
-
-Name: ISO_5427 [RFC1345,KXS2]
-MIBenum: 48
-Source: ECMA registry
-Alias: iso-ir-37
-Alias: csISO5427Cyrillic
-
-Name: JIS_C6226-1978 [RFC1345,KXS2]
-MIBenum: 49
-Source: ECMA registry
-Alias: iso-ir-42
-Alias: csISO42JISC62261978
-
-Name: BS_viewdata [RFC1345,KXS2]
-MIBenum: 50
-Source: ECMA registry
-Alias: iso-ir-47
-Alias: csISO47BSViewdata
-
-Name: INIS [RFC1345,KXS2]
-MIBenum: 51
-Source: ECMA registry
-Alias: iso-ir-49
-Alias: csISO49INIS
-
-Name: INIS-8 [RFC1345,KXS2]
-MIBenum: 52
-Source: ECMA registry
-Alias: iso-ir-50
-Alias: csISO50INIS8
-
-Name: INIS-cyrillic [RFC1345,KXS2]
-MIBenum: 53
-Source: ECMA registry
-Alias: iso-ir-51
-Alias: csISO51INISCyrillic
-
-Name: ISO_5427:1981 [RFC1345,KXS2]
-MIBenum: 54
-Source: ECMA registry
-Alias: iso-ir-54
-Alias: ISO5427Cyrillic1981
-
-Name: ISO_5428:1980 [RFC1345,KXS2]
-MIBenum: 55
-Source: ECMA registry
-Alias: iso-ir-55
-Alias: csISO5428Greek
-
-Name: GB_1988-80 [RFC1345,KXS2]
-MIBenum: 56
-Source: ECMA registry
-Alias: iso-ir-57
-Alias: cn
-Alias: ISO646-CN
-Alias: csISO57GB1988
-
-Name: GB_2312-80 [RFC1345,KXS2]
-MIBenum: 57
-Source: ECMA registry
-Alias: iso-ir-58
-Alias: chinese
-Alias: csISO58GB231280
-
-Name: NS_4551-1 [RFC1345,KXS2]
-MIBenum: 25
-Source: ECMA registry
-Alias: iso-ir-60
-Alias: ISO646-NO
-Alias: no
-Alias: csISO60DanishNorwegian
-Alias: csISO60Norwegian1
-
-Name: NS_4551-2 [RFC1345,KXS2]
-MIBenum: 58
-Source: ECMA registry
-Alias: ISO646-NO2
-Alias: iso-ir-61
-Alias: no2
-Alias: csISO61Norwegian2
-
-Name: NF_Z_62-010 [RFC1345,KXS2]
-MIBenum: 26
-Source: ECMA registry
-Alias: iso-ir-69
-Alias: ISO646-FR
-Alias: fr
-Alias: csISO69French
-
-Name: videotex-suppl [RFC1345,KXS2]
-MIBenum: 59
-Source: ECMA registry
-Alias: iso-ir-70
-Alias: csISO70VideotexSupp1
-
-Name: PT2 [RFC1345,KXS2]
-MIBenum: 60
-Source: ECMA registry
-Alias: iso-ir-84
-Alias: ISO646-PT2
-Alias: csISO84Portuguese2
-
-Name: ES2 [RFC1345,KXS2]
-MIBenum: 61
-Source: ECMA registry
-Alias: iso-ir-85
-Alias: ISO646-ES2
-Alias: csISO85Spanish2
-
-Name: MSZ_7795.3 [RFC1345,KXS2]
-MIBenum: 62
-Source: ECMA registry
-Alias: iso-ir-86
-Alias: ISO646-HU
-Alias: hu
-Alias: csISO86Hungarian
-
-Name: JIS_C6226-1983 [RFC1345,KXS2]
-MIBenum: 63
-Source: ECMA registry
-Alias: iso-ir-87
-Alias: x0208
-Alias: JIS_X0208-1983
-Alias: csISO87JISX0208
-
-Name: greek7 [RFC1345,KXS2]
-MIBenum: 64
-Source: ECMA registry
-Alias: iso-ir-88
-Alias: csISO88Greek7
-
-Name: ASMO_449 [RFC1345,KXS2]
-MIBenum: 65
-Source: ECMA registry
-Alias: ISO_9036
-Alias: arabic7
-Alias: iso-ir-89
-Alias: csISO89ASMO449
-
-Name: iso-ir-90 [RFC1345,KXS2]
-MIBenum: 66
-Source: ECMA registry
-Alias: csISO90
-
-Name: JIS_C6229-1984-a [RFC1345,KXS2]
-MIBenum: 67
-Source: ECMA registry
-Alias: iso-ir-91
-Alias: jp-ocr-a
-Alias: csISO91JISC62291984a
-
-Name: JIS_C6229-1984-b [RFC1345,KXS2]
-MIBenum: 68
-Source: ECMA registry
-Alias: iso-ir-92
-Alias: ISO646-JP-OCR-B
-Alias: jp-ocr-b
-Alias: csISO92JISC62991984b
-
-Name: JIS_C6229-1984-b-add [RFC1345,KXS2]
-MIBenum: 69
-Source: ECMA registry
-Alias: iso-ir-93
-Alias: jp-ocr-b-add
-Alias: csISO93JIS62291984badd
-
-Name: JIS_C6229-1984-hand [RFC1345,KXS2]
-MIBenum: 70
-Source: ECMA registry
-Alias: iso-ir-94
-Alias: jp-ocr-hand
-Alias: csISO94JIS62291984hand
-
-Name: JIS_C6229-1984-hand-add [RFC1345,KXS2]
-MIBenum: 71
-Source: ECMA registry
-Alias: iso-ir-95
-Alias: jp-ocr-hand-add
-Alias: csISO95JIS62291984handadd
-
-Name: JIS_C6229-1984-kana [RFC1345,KXS2]
-MIBenum: 72
-Source: ECMA registry
-Alias: iso-ir-96
-Alias: csISO96JISC62291984kana
-
-Name: ISO_2033-1983 [RFC1345,KXS2]
-MIBenum: 73
-Source: ECMA registry
-Alias: iso-ir-98
-Alias: e13b
-Alias: csISO2033
-
-Name: ANSI_X3.110-1983 [RFC1345,KXS2]
-MIBenum: 74
-Source: ECMA registry
-Alias: iso-ir-99
-Alias: CSA_T500-1983
-Alias: NAPLPS
-Alias: csISO99NAPLPS
-
-Name: ISO_8859-1:1987 [RFC1345,KXS2]
-MIBenum: 4
-Source: ECMA registry
-Alias: iso-ir-100
-Alias: ISO_8859-1
-Alias: ISO-8859-1 (preferred MIME name)
-Alias: latin1
-Alias: l1
-Alias: IBM819
-Alias: CP819
-Alias: csISOLatin1
-
-Name: ISO_8859-2:1987 [RFC1345,KXS2]
-MIBenum: 5
-Source: ECMA registry
-Alias: iso-ir-101
-Alias: ISO_8859-2
-Alias: ISO-8859-2 (preferred MIME name)
-Alias: latin2
-Alias: l2
-Alias: csISOLatin2
-
-Name: T.61-7bit [RFC1345,KXS2]
-MIBenum: 75
-Source: ECMA registry
-Alias: iso-ir-102
-Alias: csISO102T617bit
-
-Name: T.61-8bit [RFC1345,KXS2]
-MIBenum: 76
-Alias: T.61
-Source: ECMA registry
-Alias: iso-ir-103
-Alias: csISO103T618bit
-
-Name: ISO_8859-3:1988 [RFC1345,KXS2]
-MIBenum: 6
-Source: ECMA registry
-Alias: iso-ir-109
-Alias: ISO_8859-3
-Alias: ISO-8859-3 (preferred MIME name)
-Alias: latin3
-Alias: l3
-Alias: csISOLatin3
-
-Name: ISO_8859-4:1988 [RFC1345,KXS2]
-MIBenum: 7
-Source: ECMA registry
-Alias: iso-ir-110
-Alias: ISO_8859-4
-Alias: ISO-8859-4 (preferred MIME name)
-Alias: latin4
-Alias: l4
-Alias: csISOLatin4
-
-Name: ECMA-cyrillic
-MIBenum: 77
-Source: ISO registry (formerly ECMA registry)
- http://www.itscj.ipsj.jp/ISO-IR/111.pdf
-Alias: iso-ir-111
-Alias: KOI8-E
-Alias: csISO111ECMACyrillic
-
-Name: CSA_Z243.4-1985-1 [RFC1345,KXS2]
-MIBenum: 78
-Source: ECMA registry
-Alias: iso-ir-121
-Alias: ISO646-CA
-Alias: csa7-1
-Alias: ca
-Alias: csISO121Canadian1
-
-Name: CSA_Z243.4-1985-2 [RFC1345,KXS2]
-MIBenum: 79
-Source: ECMA registry
-Alias: iso-ir-122
-Alias: ISO646-CA2
-Alias: csa7-2
-Alias: csISO122Canadian2
-
-Name: CSA_Z243.4-1985-gr [RFC1345,KXS2]
-MIBenum: 80
-Source: ECMA registry
-Alias: iso-ir-123
-Alias: csISO123CSAZ24341985gr
-
-Name: ISO_8859-6:1987 [RFC1345,KXS2]
-MIBenum: 9
-Source: ECMA registry
-Alias: iso-ir-127
-Alias: ISO_8859-6
-Alias: ISO-8859-6 (preferred MIME name)
-Alias: ECMA-114
-Alias: ASMO-708
-Alias: arabic
-Alias: csISOLatinArabic
-
-Name: ISO_8859-6-E [RFC1556,IANA]
-MIBenum: 81
-Source: RFC1556
-Alias: csISO88596E
-Alias: ISO-8859-6-E (preferred MIME name)
-
-Name: ISO_8859-6-I [RFC1556,IANA]
-MIBenum: 82
-Source: RFC1556
-Alias: csISO88596I
-Alias: ISO-8859-6-I (preferred MIME name)
-
-Name: ISO_8859-7:1987 [RFC1947,RFC1345,KXS2]
-MIBenum: 10
-Source: ECMA registry
-Alias: iso-ir-126
-Alias: ISO_8859-7
-Alias: ISO-8859-7 (preferred MIME name)
-Alias: ELOT_928
-Alias: ECMA-118
-Alias: greek
-Alias: greek8
-Alias: csISOLatinGreek
-
-Name: T.101-G2 [RFC1345,KXS2]
-MIBenum: 83
-Source: ECMA registry
-Alias: iso-ir-128
-Alias: csISO128T101G2
-
-Name: ISO_8859-8:1988 [RFC1345,KXS2]
-MIBenum: 11
-Source: ECMA registry
-Alias: iso-ir-138
-Alias: ISO_8859-8
-Alias: ISO-8859-8 (preferred MIME name)
-Alias: hebrew
-Alias: csISOLatinHebrew
-
-Name: ISO_8859-8-E [RFC1556,Nussbacher]
-MIBenum: 84
-Source: RFC1556
-Alias: csISO88598E
-Alias: ISO-8859-8-E (preferred MIME name)
-
-Name: ISO_8859-8-I [RFC1556,Nussbacher]
-MIBenum: 85
-Source: RFC1556
-Alias: csISO88598I
-Alias: ISO-8859-8-I (preferred MIME name)
-
-Name: CSN_369103 [RFC1345,KXS2]
-MIBenum: 86
-Source: ECMA registry
-Alias: iso-ir-139
-Alias: csISO139CSN369103
-
-Name: JUS_I.B1.002 [RFC1345,KXS2]
-MIBenum: 87
-Source: ECMA registry
-Alias: iso-ir-141
-Alias: ISO646-YU
-Alias: js
-Alias: yu
-Alias: csISO141JUSIB1002
-
-Name: ISO_6937-2-add [RFC1345,KXS2]
-MIBenum: 14
-Source: ECMA registry and ISO 6937-2:1983
-Alias: iso-ir-142
-Alias: csISOTextComm
-
-Name: IEC_P27-1 [RFC1345,KXS2]
-MIBenum: 88
-Source: ECMA registry
-Alias: iso-ir-143
-Alias: csISO143IECP271
-
-Name: ISO_8859-5:1988 [RFC1345,KXS2]
-MIBenum: 8
-Source: ECMA registry
-Alias: iso-ir-144
-Alias: ISO_8859-5
-Alias: ISO-8859-5 (preferred MIME name)
-Alias: cyrillic
-Alias: csISOLatinCyrillic
-
-Name: JUS_I.B1.003-serb [RFC1345,KXS2]
-MIBenum: 89
-Source: ECMA registry
-Alias: iso-ir-146
-Alias: serbian
-Alias: csISO146Serbian
-
-Name: JUS_I.B1.003-mac [RFC1345,KXS2]
-MIBenum: 90
-Source: ECMA registry
-Alias: macedonian
-Alias: iso-ir-147
-Alias: csISO147Macedonian
-
-Name: ISO_8859-9:1989 [RFC1345,KXS2]
-MIBenum: 12
-Source: ECMA registry
-Alias: iso-ir-148
-Alias: ISO_8859-9
-Alias: ISO-8859-9 (preferred MIME name)
-Alias: latin5
-Alias: l5
-Alias: csISOLatin5
-
-Name: greek-ccitt [RFC1345,KXS2]
-MIBenum: 91
-Source: ECMA registry
-Alias: iso-ir-150
-Alias: csISO150
-Alias: csISO150GreekCCITT
-
-Name: NC_NC00-10:81 [RFC1345,KXS2]
-MIBenum: 92
-Source: ECMA registry
-Alias: cuba
-Alias: iso-ir-151
-Alias: ISO646-CU
-Alias: csISO151Cuba
-
-Name: ISO_6937-2-25 [RFC1345,KXS2]
-MIBenum: 93
-Source: ECMA registry
-Alias: iso-ir-152
-Alias: csISO6937Add
-
-Name: GOST_19768-74 [RFC1345,KXS2]
-MIBenum: 94
-Source: ECMA registry
-Alias: ST_SEV_358-88
-Alias: iso-ir-153
-Alias: csISO153GOST1976874
-
-Name: ISO_8859-supp [RFC1345,KXS2]
-MIBenum: 95
-Source: ECMA registry
-Alias: iso-ir-154
-Alias: latin1-2-5
-Alias: csISO8859Supp
-
-Name: ISO_10367-box [RFC1345,KXS2]
-MIBenum: 96
-Source: ECMA registry
-Alias: iso-ir-155
-Alias: csISO10367Box
-
-Name: ISO-8859-10 (preferred MIME name) [RFC1345,KXS2]
-MIBenum: 13
-Source: ECMA registry
-Alias: iso-ir-157
-Alias: l6
-Alias: ISO_8859-10:1992
-Alias: csISOLatin6
-Alias: latin6
-
-Name: latin-lap [RFC1345,KXS2]
-MIBenum: 97
-Source: ECMA registry
-Alias: lap
-Alias: iso-ir-158
-Alias: csISO158Lap
-
-Name: JIS_X0212-1990 [RFC1345,KXS2]
-MIBenum: 98
-Source: ECMA registry
-Alias: x0212
-Alias: iso-ir-159
-Alias: csISO159JISX02121990
-
-Name: DS_2089 [RFC1345,KXS2]
-MIBenum: 99
-Source: Danish Standard, DS 2089, February 1974
-Alias: DS2089
-Alias: ISO646-DK
-Alias: dk
-Alias: csISO646Danish
-
-Name: us-dk [RFC1345,KXS2]
-MIBenum: 100
-Alias: csUSDK
-
-Name: dk-us [RFC1345,KXS2]
-MIBenum: 101
-Alias: csDKUS
-
-Name: JIS_X0201 [RFC1345,KXS2]
-MIBenum: 15
-Source: JIS X 0201-1976. One byte only, this is equivalent to
- JIS/Roman (similar to ASCII) plus eight-bit half-width
- Katakana
-Alias: X0201
-Alias: csHalfWidthKatakana
-
-Name: KSC5636 [RFC1345,KXS2]
-MIBenum: 102
-Alias: ISO646-KR
-Alias: csKSC5636
-
-Name: ISO-10646-UCS-2
-MIBenum: 1000
-Source: the 2-octet Basic Multilingual Plane, aka Unicode
- this needs to specify network byte order: the standard
- does not specify (it is a 16-bit integer space)
-Alias: csUnicode
-
-Name: ISO-10646-UCS-4
-MIBenum: 1001
-Source: the full code space. (same comment about byte order,
- these are 31-bit numbers.
-Alias: csUCS4
-
-Name: DEC-MCS [RFC1345,KXS2]
-MIBenum: 2008
-Source: VAX/VMS User's Manual,
- Order Number: AI-Y517A-TE, April 1986.
-Alias: dec
-Alias: csDECMCS
-
-Name: hp-roman8 [HP-PCL5,RFC1345,KXS2]
-MIBenum: 2004
-Source: LaserJet IIP Printer User's Manual,
- HP part no 33471-90901, Hewlet-Packard, June 1989.
-Alias: roman8
-Alias: r8
-Alias: csHPRoman8
-
-Name: macintosh [RFC1345,KXS2]
-MIBenum: 2027
-Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991
-Alias: mac
-Alias: csMacintosh
-
-Name: IBM037 [RFC1345,KXS2]
-MIBenum: 2028
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp037
-Alias: ebcdic-cp-us
-Alias: ebcdic-cp-ca
-Alias: ebcdic-cp-wt
-Alias: ebcdic-cp-nl
-Alias: csIBM037
-
-Name: IBM038 [RFC1345,KXS2]
-MIBenum: 2029
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-INT
-Alias: cp038
-Alias: csIBM038
-
-Name: IBM273 [RFC1345,KXS2]
-MIBenum: 2030
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP273
-Alias: csIBM273
-
-Name: IBM274 [RFC1345,KXS2]
-MIBenum: 2031
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-BE
-Alias: CP274
-Alias: csIBM274
-
-Name: IBM275 [RFC1345,KXS2]
-MIBenum: 2032
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: EBCDIC-BR
-Alias: cp275
-Alias: csIBM275
-
-Name: IBM277 [RFC1345,KXS2]
-MIBenum: 2033
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: EBCDIC-CP-DK
-Alias: EBCDIC-CP-NO
-Alias: csIBM277
-
-Name: IBM278 [RFC1345,KXS2]
-MIBenum: 2034
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP278
-Alias: ebcdic-cp-fi
-Alias: ebcdic-cp-se
-Alias: csIBM278
-
-Name: IBM280 [RFC1345,KXS2]
-MIBenum: 2035
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP280
-Alias: ebcdic-cp-it
-Alias: csIBM280
-
-Name: IBM281 [RFC1345,KXS2]
-MIBenum: 2036
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: EBCDIC-JP-E
-Alias: cp281
-Alias: csIBM281
-
-Name: IBM284 [RFC1345,KXS2]
-MIBenum: 2037
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP284
-Alias: ebcdic-cp-es
-Alias: csIBM284
-
-Name: IBM285 [RFC1345,KXS2]
-MIBenum: 2038
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP285
-Alias: ebcdic-cp-gb
-Alias: csIBM285
-
-Name: IBM290 [RFC1345,KXS2]
-MIBenum: 2039
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: cp290
-Alias: EBCDIC-JP-kana
-Alias: csIBM290
-
-Name: IBM297 [RFC1345,KXS2]
-MIBenum: 2040
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp297
-Alias: ebcdic-cp-fr
-Alias: csIBM297
-
-Name: IBM420 [RFC1345,KXS2]
-MIBenum: 2041
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990,
- IBM NLS RM p 11-11
-Alias: cp420
-Alias: ebcdic-cp-ar1
-Alias: csIBM420
-
-Name: IBM423 [RFC1345,KXS2]
-MIBenum: 2042
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp423
-Alias: ebcdic-cp-gr
-Alias: csIBM423
-
-Name: IBM424 [RFC1345,KXS2]
-MIBenum: 2043
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp424
-Alias: ebcdic-cp-he
-Alias: csIBM424
-
-Name: IBM437 [RFC1345,KXS2]
-MIBenum: 2011
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp437
-Alias: 437
-Alias: csPC8CodePage437
-
-Name: IBM500 [RFC1345,KXS2]
-MIBenum: 2044
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP500
-Alias: ebcdic-cp-be
-Alias: ebcdic-cp-ch
-Alias: csIBM500
-
-Name: IBM775 [HP-PCL5]
-MIBenum: 2087
-Source: HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996
-Alias: cp775
-Alias: csPC775Baltic
-
-Name: IBM850 [RFC1345,KXS2]
-MIBenum: 2009
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp850
-Alias: 850
-Alias: csPC850Multilingual
-
-Name: IBM851 [RFC1345,KXS2]
-MIBenum: 2045
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp851
-Alias: 851
-Alias: csIBM851
-
-Name: IBM852 [RFC1345,KXS2]
-MIBenum: 2010
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp852
-Alias: 852
-Alias: csPCp852
-
-Name: IBM855 [RFC1345,KXS2]
-MIBenum: 2046
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp855
-Alias: 855
-Alias: csIBM855
-
-Name: IBM857 [RFC1345,KXS2]
-MIBenum: 2047
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp857
-Alias: 857
-Alias: csIBM857
-
-Name: IBM860 [RFC1345,KXS2]
-MIBenum: 2048
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp860
-Alias: 860
-Alias: csIBM860
-
-Name: IBM861 [RFC1345,KXS2]
-MIBenum: 2049
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp861
-Alias: 861
-Alias: cp-is
-Alias: csIBM861
-
-Name: IBM862 [RFC1345,KXS2]
-MIBenum: 2013
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp862
-Alias: 862
-Alias: csPC862LatinHebrew
-
-Name: IBM863 [RFC1345,KXS2]
-MIBenum: 2050
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp863
-Alias: 863
-Alias: csIBM863
-
-Name: IBM864 [RFC1345,KXS2]
-MIBenum: 2051
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp864
-Alias: csIBM864
-
-Name: IBM865 [RFC1345,KXS2]
-MIBenum: 2052
-Source: IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987)
-Alias: cp865
-Alias: 865
-Alias: csIBM865
-
-Name: IBM866 [Pond]
-MIBenum: 2086
-Source: IBM NLDG Volume 2 (SE09-8002-03) August 1994
-Alias: cp866
-Alias: 866
-Alias: csIBM866
-
-Name: IBM868 [RFC1345,KXS2]
-MIBenum: 2053
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP868
-Alias: cp-ar
-Alias: csIBM868
-
-Name: IBM869 [RFC1345,KXS2]
-MIBenum: 2054
-Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991
-Alias: cp869
-Alias: 869
-Alias: cp-gr
-Alias: csIBM869
-
-Name: IBM870 [RFC1345,KXS2]
-MIBenum: 2055
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP870
-Alias: ebcdic-cp-roece
-Alias: ebcdic-cp-yu
-Alias: csIBM870
-
-Name: IBM871 [RFC1345,KXS2]
-MIBenum: 2056
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP871
-Alias: ebcdic-cp-is
-Alias: csIBM871
-
-Name: IBM880 [RFC1345,KXS2]
-MIBenum: 2057
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp880
-Alias: EBCDIC-Cyrillic
-Alias: csIBM880
-
-Name: IBM891 [RFC1345,KXS2]
-MIBenum: 2058
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp891
-Alias: csIBM891
-
-Name: IBM903 [RFC1345,KXS2]
-MIBenum: 2059
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp903
-Alias: csIBM903
-
-Name: IBM904 [RFC1345,KXS2]
-MIBenum: 2060
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: cp904
-Alias: 904
-Alias: csIBBM904
-
-Name: IBM905 [RFC1345,KXS2]
-MIBenum: 2061
-Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
-Alias: CP905
-Alias: ebcdic-cp-tr
-Alias: csIBM905
-
-Name: IBM918 [RFC1345,KXS2]
-MIBenum: 2062
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP918
-Alias: ebcdic-cp-ar2
-Alias: csIBM918
-
-Name: IBM1026 [RFC1345,KXS2]
-MIBenum: 2063
-Source: IBM NLS RM Vol2 SE09-8002-01, March 1990
-Alias: CP1026
-Alias: csIBM1026
-
-Name: EBCDIC-AT-DE [RFC1345,KXS2]
-MIBenum: 2064
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csIBMEBCDICATDE
-
-Name: EBCDIC-AT-DE-A [RFC1345,KXS2]
-MIBenum: 2065
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICATDEA
-
-Name: EBCDIC-CA-FR [RFC1345,KXS2]
-MIBenum: 2066
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICCAFR
-
-Name: EBCDIC-DK-NO [RFC1345,KXS2]
-MIBenum: 2067
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICDKNO
-
-Name: EBCDIC-DK-NO-A [RFC1345,KXS2]
-MIBenum: 2068
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICDKNOA
-
-Name: EBCDIC-FI-SE [RFC1345,KXS2]
-MIBenum: 2069
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFISE
-
-Name: EBCDIC-FI-SE-A [RFC1345,KXS2]
-MIBenum: 2070
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFISEA
-
-Name: EBCDIC-FR [RFC1345,KXS2]
-MIBenum: 2071
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICFR
-
-Name: EBCDIC-IT [RFC1345,KXS2]
-MIBenum: 2072
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICIT
-
-Name: EBCDIC-PT [RFC1345,KXS2]
-MIBenum: 2073
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICPT
-
-Name: EBCDIC-ES [RFC1345,KXS2]
-MIBenum: 2074
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICES
-
-Name: EBCDIC-ES-A [RFC1345,KXS2]
-MIBenum: 2075
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICESA
-
-Name: EBCDIC-ES-S [RFC1345,KXS2]
-MIBenum: 2076
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICESS
-
-Name: EBCDIC-UK [RFC1345,KXS2]
-MIBenum: 2077
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICUK
-
-Name: EBCDIC-US [RFC1345,KXS2]
-MIBenum: 2078
-Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
-Alias: csEBCDICUS
-
-Name: UNKNOWN-8BIT [RFC1428]
-MIBenum: 2079
-Alias: csUnknown8BiT
-
-Name: MNEMONIC [RFC1345,KXS2]
-MIBenum: 2080
-Source: RFC 1345, also known as "mnemonic+ascii+38"
-Alias: csMnemonic
-
-Name: MNEM [RFC1345,KXS2]
-MIBenum: 2081
-Source: RFC 1345, also known as "mnemonic+ascii+8200"
-Alias: csMnem
-
-Name: VISCII [RFC1456]
-MIBenum: 2082
-Source: RFC 1456
-Alias: csVISCII
-
-Name: VIQR [RFC1456]
-MIBenum: 2083
-Source: RFC 1456
-Alias: csVIQR
-
-Name: KOI8-R (preferred MIME name) [RFC1489]
-MIBenum: 2084
-Source: RFC 1489, based on GOST-19768-74, ISO-6937/8,
- INIS-Cyrillic, ISO-5427.
-Alias: csKOI8R
-
-Name: KOI8-U [RFC2319]
-MIBenum: 2088
-Source: RFC 2319
-
-Name: IBM00858
-MIBenum: 2089
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00858) [Mahdi]
-Alias: CCSID00858
-Alias: CP00858
-Alias: PC-Multilingual-850+euro
-
-Name: IBM00924
-MIBenum: 2090
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00924) [Mahdi]
-Alias: CCSID00924
-Alias: CP00924
-Alias: ebcdic-Latin9--euro
-
-Name: IBM01140
-MIBenum: 2091
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01140) [Mahdi]
-Alias: CCSID01140
-Alias: CP01140
-Alias: ebcdic-us-37+euro
-
-Name: IBM01141
-MIBenum: 2092
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01141) [Mahdi]
-Alias: CCSID01141
-Alias: CP01141
-Alias: ebcdic-de-273+euro
-
-Name: IBM01142
-MIBenum: 2093
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01142) [Mahdi]
-Alias: CCSID01142
-Alias: CP01142
-Alias: ebcdic-dk-277+euro
-Alias: ebcdic-no-277+euro
-
-Name: IBM01143
-MIBenum: 2094
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01143) [Mahdi]
-Alias: CCSID01143
-Alias: CP01143
-Alias: ebcdic-fi-278+euro
-Alias: ebcdic-se-278+euro
-
-Name: IBM01144
-MIBenum: 2095
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01144) [Mahdi]
-Alias: CCSID01144
-Alias: CP01144
-Alias: ebcdic-it-280+euro
-
-Name: IBM01145
-MIBenum: 2096
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01145) [Mahdi]
-Alias: CCSID01145
-Alias: CP01145
-Alias: ebcdic-es-284+euro
-
-Name: IBM01146
-MIBenum: 2097
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01146) [Mahdi]
-Alias: CCSID01146
-Alias: CP01146
-Alias: ebcdic-gb-285+euro
-
-Name: IBM01147
-MIBenum: 2098
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01147) [Mahdi]
-Alias: CCSID01147
-Alias: CP01147
-Alias: ebcdic-fr-297+euro
-
-Name: IBM01148
-MIBenum: 2099
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01148) [Mahdi]
-Alias: CCSID01148
-Alias: CP01148
-Alias: ebcdic-international-500+euro
-
-Name: IBM01149
-MIBenum: 2100
-Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01149) [Mahdi]
-Alias: CCSID01149
-Alias: CP01149
-Alias: ebcdic-is-871+euro
-
-Name: Big5-HKSCS [Yick]
-MIBenum: 2101
-Source: See (http://www.iana.org/assignments/charset-reg/Big5-HKSCS)
-Alias: None
-
-Name: IBM1047 [Robrigado]
-MIBenum: 2102
-Source: IBM1047 (EBCDIC Latin 1/Open Systems)
-http://www-1.ibm.com/servers/eserver/iseries/software/globalization/pdf/cp01047z.pdf
-Alias: IBM-1047
-
-Name: PTCP154 [Uskov]
-MIBenum: 2103
-Source: See (http://www.iana.org/assignments/charset-reg/PTCP154)
-Alias: csPTCP154
-Alias: PT154
-Alias: CP154
-Alias: Cyrillic-Asian
-
-Name: Amiga-1251
-MIBenum: 2104
-Source: See (http://www.amiga.ultranet.ru/Amiga-1251.html)
-Alias: Ami1251
-Alias: Amiga1251
-Alias: Ami-1251
-(Aliases are provided for historical reasons and should not be used)
- [Malyshev]
-
-Name: KOI7-switched
-MIBenum: 2105
-Source: See <http://www.iana.org/assignments/charset-reg/KOI7-switched>
-Aliases: None
-
-Name: UNICODE-1-1 [RFC1641]
-MIBenum: 1010
-Source: RFC 1641
-Alias: csUnicode11
-
-Name: SCSU
-MIBenum: 1011
-Source: SCSU See (http://www.iana.org/assignments/charset-reg/SCSU) [Scherer]
-Alias: None
-
-Name: UTF-7 [RFC2152]
-MIBenum: 1012
-Source: RFC 2152
-Alias: None
-
-Name: UTF-16BE [RFC2781]
-MIBenum: 1013
-Source: RFC 2781
-Alias: None
-
-Name: UTF-16LE [RFC2781]
-MIBenum: 1014
-Source: RFC 2781
-Alias: None
-
-Name: UTF-16 [RFC2781]
-MIBenum: 1015
-Source: RFC 2781
-Alias: None
-
-Name: CESU-8 [Phipps]
-MIBenum: 1016
-Source: <http://www.unicode.org/unicode/reports/tr26>
-Alias: csCESU-8
-
-Name: UTF-32 [Davis]
-MIBenum: 1017
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: UTF-32BE [Davis]
-MIBenum: 1018
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: UTF-32LE [Davis]
-MIBenum: 1019
-Source: <http://www.unicode.org/unicode/reports/tr19/>
-Alias: None
-
-Name: BOCU-1 [Scherer]
-MIBenum: 1020
-Source: http://www.unicode.org/notes/tn6/
-Alias: csBOCU-1
-
-Name: UNICODE-1-1-UTF-7 [RFC1642]
-MIBenum: 103
-Source: RFC 1642
-Alias: csUnicode11UTF7
-
-Name: UTF-8 [RFC3629]
-MIBenum: 106
-Source: RFC 3629
-Alias: None
-
-Name: ISO-8859-13
-MIBenum: 109
-Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-13)[Tumasonis]
-Alias: None
-
-Name: ISO-8859-14
-MIBenum: 110
-Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-14) [Simonsen]
-Alias: iso-ir-199
-Alias: ISO_8859-14:1998
-Alias: ISO_8859-14
-Alias: latin8
-Alias: iso-celtic
-Alias: l8
-
-Name: ISO-8859-15
-MIBenum: 111
-Source: ISO
- Please see: <http://www.iana.org/assignments/charset-reg/ISO-8859-15>
-Alias: ISO_8859-15
-Alias: Latin-9
-
-Name: ISO-8859-16
-MIBenum: 112
-Source: ISO
-Alias: iso-ir-226
-Alias: ISO_8859-16:2001
-Alias: ISO_8859-16
-Alias: latin10
-Alias: l10
-
-Name: GBK
-MIBenum: 113
-Source: Chinese IT Standardization Technical Committee
- Please see: <http://www.iana.org/assignments/charset-reg/GBK>
-Alias: CP936
-Alias: MS936
-Alias: windows-936
-
-Name: GB18030
-MIBenum: 114
-Source: Chinese IT Standardization Technical Committee
- Please see: <http://www.iana.org/assignments/charset-reg/GB18030>
-Alias: None
-
-Name: OSD_EBCDIC_DF04_15
-MIBenum: 115
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-15>
-Alias: None
-
-Name: OSD_EBCDIC_DF03_IRV
-MIBenum: 116
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF03-IRV>
-Alias: None
-
-Name: OSD_EBCDIC_DF04_1
-MIBenum: 117
-Source: Fujitsu-Siemens standard mainframe EBCDIC encoding
- Please see: <http://www.iana.org/assignments/charset-reg/OSD-EBCDIC-DF04-1>
-Alias: None
-
-Name: JIS_Encoding
-MIBenum: 16
-Source: JIS X 0202-1991. Uses ISO 2022 escape sequences to
- shift code sets as documented in JIS X 0202-1991.
-Alias: csJISEncoding
-
-Name: Shift_JIS (preferred MIME name)
-MIBenum: 17
-Source: This charset is an extension of csHalfWidthKatakana by
- adding graphic characters in JIS X 0208. The CCS's are
- JIS X0201:1997 and JIS X0208:1997. The
- complete definition is shown in Appendix 1 of JIS
- X0208:1997.
- This charset can be used for the top-level media type "text".
-Alias: MS_Kanji
-Alias: csShiftJIS
-
-Name: Extended_UNIX_Code_Packed_Format_for_Japanese
-MIBenum: 18
-Source: Standardized by OSF, UNIX International, and UNIX Systems
- Laboratories Pacific. Uses ISO 2022 rules to select
- code set 0: US-ASCII (a single 7-bit byte set)
- code set 1: JIS X0208-1990 (a double 8-bit byte set)
- restricted to A0-FF in both bytes
- code set 2: Half Width Katakana (a single 7-bit byte set)
- requiring SS2 as the character prefix
- code set 3: JIS X0212-1990 (a double 7-bit byte set)
- restricted to A0-FF in both bytes
- requiring SS3 as the character prefix
-Alias: csEUCPkdFmtJapanese
-Alias: EUC-JP (preferred MIME name)
-
-Name: Extended_UNIX_Code_Fixed_Width_for_Japanese
-MIBenum: 19
-Source: Used in Japan. Each character is 2 octets.
- code set 0: US-ASCII (a single 7-bit byte set)
- 1st byte = 00
- 2nd byte = 20-7E
- code set 1: JIS X0208-1990 (a double 7-bit byte set)
- restricted to A0-FF in both bytes
- code set 2: Half Width Katakana (a single 7-bit byte set)
- 1st byte = 00
- 2nd byte = A0-FF
- code set 3: JIS X0212-1990 (a double 7-bit byte set)
- restricted to A0-FF in
- the first byte
- and 21-7E in the second byte
-Alias: csEUCFixWidJapanese
-
-Name: ISO-10646-UCS-Basic
-MIBenum: 1002
-Source: ASCII subset of Unicode. Basic Latin = collection 1
- See ISO 10646, Appendix A
-Alias: csUnicodeASCII
-
-Name: ISO-10646-Unicode-Latin1
-MIBenum: 1003
-Source: ISO Latin-1 subset of Unicode. Basic Latin and Latin-1
- Supplement = collections 1 and 2. See ISO 10646,
- Appendix A. See RFC 1815.
-Alias: csUnicodeLatin1
-Alias: ISO-10646
-
-Name: ISO-10646-J-1
-Source: ISO 10646 Japanese, see RFC 1815.
-
-Name: ISO-Unicode-IBM-1261
-MIBenum: 1005
-Source: IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261
-Alias: csUnicodeIBM1261
-
-Name: ISO-Unicode-IBM-1268
-MIBenum: 1006
-Source: IBM Latin-4 Extended Presentation Set, GCSGID: 1268
-Alias: csUnicodeIBM1268
-
-Name: ISO-Unicode-IBM-1276
-MIBenum: 1007
-Source: IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276
-Alias: csUnicodeIBM1276
-
-Name: ISO-Unicode-IBM-1264
-MIBenum: 1008
-Source: IBM Arabic Presentation Set, GCSGID: 1264
-Alias: csUnicodeIBM1264
-
-Name: ISO-Unicode-IBM-1265
-MIBenum: 1009
-Source: IBM Hebrew Presentation Set, GCSGID: 1265
-Alias: csUnicodeIBM1265
-
-Name: ISO-8859-1-Windows-3.0-Latin-1 [HP-PCL5]
-MIBenum: 2000
-Source: Extended ISO 8859-1 Latin-1 for Windows 3.0.
- PCL Symbol Set id: 9U
-Alias: csWindows30Latin1
-
-Name: ISO-8859-1-Windows-3.1-Latin-1 [HP-PCL5]
-MIBenum: 2001
-Source: Extended ISO 8859-1 Latin-1 for Windows 3.1.
- PCL Symbol Set id: 19U
-Alias: csWindows31Latin1
-
-Name: ISO-8859-2-Windows-Latin-2 [HP-PCL5]
-MIBenum: 2002
-Source: Extended ISO 8859-2. Latin-2 for Windows 3.1.
- PCL Symbol Set id: 9E
-Alias: csWindows31Latin2
-
-Name: ISO-8859-9-Windows-Latin-5 [HP-PCL5]
-MIBenum: 2003
-Source: Extended ISO 8859-9. Latin-5 for Windows 3.1
- PCL Symbol Set id: 5T
-Alias: csWindows31Latin5
-
-Name: Adobe-Standard-Encoding [Adobe]
-MIBenum: 2005
-Source: PostScript Language Reference Manual
- PCL Symbol Set id: 10J
-Alias: csAdobeStandardEncoding
-
-Name: Ventura-US [HP-PCL5]
-MIBenum: 2006
-Source: Ventura US. ASCII plus characters typically used in
- publishing, like pilcrow, copyright, registered, trade mark,
- section, dagger, and double dagger in the range A0 (hex)
- to FF (hex).
- PCL Symbol Set id: 14J
-Alias: csVenturaUS
-
-Name: Ventura-International [HP-PCL5]
-MIBenum: 2007
-Source: Ventura International. ASCII plus coded characters similar
- to Roman8.
- PCL Symbol Set id: 13J
-Alias: csVenturaInternational
-
-Name: PC8-Danish-Norwegian [HP-PCL5]
-MIBenum: 2012
-Source: PC Danish Norwegian
- 8-bit PC set for Danish Norwegian
- PCL Symbol Set id: 11U
-Alias: csPC8DanishNorwegian
-
-Name: PC8-Turkish [HP-PCL5]
-MIBenum: 2014
-Source: PC Latin Turkish. PCL Symbol Set id: 9T
-Alias: csPC8Turkish
-
-Name: IBM-Symbols [IBM-CIDT]
-MIBenum: 2015
-Source: Presentation Set, CPGID: 259
-Alias: csIBMSymbols
-
-Name: IBM-Thai [IBM-CIDT]
-MIBenum: 2016
-Source: Presentation Set, CPGID: 838
-Alias: csIBMThai
-
-Name: HP-Legal [HP-PCL5]
-MIBenum: 2017
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 1U
-Alias: csHPLegal
-
-Name: HP-Pi-font [HP-PCL5]
-MIBenum: 2018
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 15U
-Alias: csHPPiFont
-
-Name: HP-Math8 [HP-PCL5]
-MIBenum: 2019
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 8M
-Alias: csHPMath8
-
-Name: Adobe-Symbol-Encoding [Adobe]
-MIBenum: 2020
-Source: PostScript Language Reference Manual
- PCL Symbol Set id: 5M
-Alias: csHPPSMath
-
-Name: HP-DeskTop [HP-PCL5]
-MIBenum: 2021
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 7J
-Alias: csHPDesktop
-
-Name: Ventura-Math [HP-PCL5]
-MIBenum: 2022
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 6M
-Alias: csVenturaMath
-
-Name: Microsoft-Publishing [HP-PCL5]
-MIBenum: 2023
-Source: PCL 5 Comparison Guide, Hewlett-Packard,
- HP part number 5961-0510, October 1992
- PCL Symbol Set id: 6J
-Alias: csMicrosoftPublishing
-
-Name: Windows-31J
-MIBenum: 2024
-Source: Windows Japanese. A further extension of Shift_JIS
- to include NEC special characters (Row 13), NEC
- selection of IBM extensions (Rows 89 to 92), and IBM
- extensions (Rows 115 to 119). The CCS's are
- JIS X0201:1997, JIS X0208:1997, and these extensions.
- This charset can be used for the top-level media type "text",
- but it is of limited or specialized use (see RFC2278).
- PCL Symbol Set id: 19K
-Alias: csWindows31J
-
-Name: GB2312 (preferred MIME name)
-MIBenum: 2025
-Source: Chinese for People's Republic of China (PRC) mixed one byte,
- two byte set:
- 20-7E = one byte ASCII
- A1-FE = two byte PRC Kanji
- See GB 2312-80
- PCL Symbol Set Id: 18C
-Alias: csGB2312
-
-Name: Big5 (preferred MIME name)
-MIBenum: 2026
-Source: Chinese for Taiwan Multi-byte set.
- PCL Symbol Set Id: 18T
-Alias: csBig5
-
-Name: windows-1250
-MIBenum: 2250
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1250) [Lazhintseva]
-Alias: None
-
-Name: windows-1251
-MIBenum: 2251
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1251) [Lazhintseva]
-Alias: None
-
-Name: windows-1252
-MIBenum: 2252
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1252) [Wendt]
-Alias: None
-
-Name: windows-1253
-MIBenum: 2253
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1253) [Lazhintseva]
-Alias: None
-
-Name: windows-1254
-MIBenum: 2254
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1254) [Lazhintseva]
-Alias: None
-
-Name: windows-1255
-MIBenum: 2255
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1255) [Lazhintseva]
-Alias: None
-
-Name: windows-1256
-MIBenum: 2256
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1256) [Lazhintseva]
-Alias: None
-
-Name: windows-1257
-MIBenum: 2257
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1257) [Lazhintseva]
-Alias: None
-
-Name: windows-1258
-MIBenum: 2258
-Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1258) [Lazhintseva]
-Alias: None
-
-Name: TIS-620
-MIBenum: 2259
-Source: Thai Industrial Standards Institute (TISI) [Tantsetthi]
-
-Name: HZ-GB-2312
-MIBenum: 2085
-Source: RFC 1842, RFC 1843 [RFC1842, RFC1843]
-
-
-REFERENCES
-----------
-
-[RFC1345] Simonsen, K., "Character Mnemonics & Character Sets",
- RFC 1345, Rationel Almen Planlaegning, Rationel Almen
- Planlaegning, June 1992.
-
-[RFC1428] Vaudreuil, G., "Transition of Internet Mail from
- Just-Send-8 to 8bit-SMTP/MIME", RFC1428, CNRI, February
- 1993.
-
-[RFC1456] Vietnamese Standardization Working Group, "Conventions for
- Encoding the Vietnamese Language VISCII: VIetnamese
- Standard Code for Information Interchange VIQR: VIetnamese
- Quoted-Readable Specification Revision 1.1", RFC 1456, May
- 1993.
-
-[RFC1468] Murai, J., Crispin, M., and E. van der Poel, "Japanese
- Character Encoding for Internet Messages", RFC 1468,
- Keio University, Panda Programming, June 1993.
-
-[RFC1489] Chernov, A., "Registration of a Cyrillic Character Set",
- RFC1489, RELCOM Development Team, July 1993.
-
-[RFC1554] Ohta, M., and K. Handa, "ISO-2022-JP-2: Multilingual
- Extension of ISO-2022-JP", RFC1554, Tokyo Institute of
- Technology, ETL, December 1993.
-
-[RFC1556] Nussbacher, H., "Handling of Bi-directional Texts in MIME",
- RFC1556, Israeli Inter-University, December 1993.
-
-[RFC1557] Choi, U., Chon, K., and H. Park, "Korean Character Encoding
- for Internet Messages", KAIST, Solvit Chosun Media,
- December 1993.
-
-[RFC1641] Goldsmith, D., and M. Davis, "Using Unicode with MIME",
- RFC1641, Taligent, Inc., July 1994.
-
-[RFC1642] Goldsmith, D., and M. Davis, "UTF-7", RFC1642, Taligent,
- Inc., July 1994.
-
-[RFC1815] Ohta, M., "Character Sets ISO-10646 and ISO-10646-J-1",
- RFC 1815, Tokyo Institute of Technology, July 1995.
-
-
-[Adobe] Adobe Systems Incorporated, PostScript Language Reference
- Manual, second edition, Addison-Wesley Publishing Company,
- Inc., 1990.
-
-[ECMA Registry] ISO-IR: International Register of Escape Sequences
- http://www.itscj.ipsj.or.jp/ISO-IE/ Note: The current
- registration authority is IPSJ/ITSCJ, Japan.
-
-[HP-PCL5] Hewlett-Packard Company, "HP PCL 5 Comparison Guide",
- (P/N 5021-0329) pp B-13, 1996.
-
-[IBM-CIDT] IBM Corporation, "ABOUT TYPE: IBM's Technical Reference
- for Core Interchange Digitized Type", Publication number
- S544-3708-01
-
-[RFC1842] Wei, Y., J. Li, and Y. Jiang, "ASCII Printable
- Characters-Based Chinese Character Encoding for Internet
- Messages", RFC 1842, Harvard University, Rice University,
- University of Maryland, August 1995.
-
-[RFC1843] Lee, F., "HZ - A Data Format for Exchanging Files of
- Arbitrarily Mixed Chinese and ASCII Characters", RFC 1843,
- Stanford University, August 1995.
-
-[RFC2152] Goldsmith, D., M. Davis, "UTF-7: A Mail-Safe Transformation
- Format of Unicode", RFC 2152, Apple Computer, Inc.,
- Taligent Inc., May 1997.
-
-[RFC2279] Yergeau, F., "UTF-8, A Transformation Format of ISO 10646",
- RFC 2279, Alis Technologies, January, 1998.
-
-[RFC2781] Hoffman, P., Yergeau, F., "UTF-16, an encoding of ISO 10646",
- RFC 2781, February 2000.
-
-[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646",
- RFC3629, November 2003.
-
-PEOPLE
-------
-
-[KXS2] Keld Simonsen <Keld.Simonsen(a)dkuug.dk>
-
-[Choi] Woohyong Choi <whchoi(a)cosmos.kaist.ac.kr>
-
-[Davis] Mark Davis, <mark(a)unicode.org>, April 2002.
-
-[Lazhintseva] Katya Lazhintseva, <katyal(a)MICROSOFT.com>, May 1996.
-
-[Mahdi] Tamer Mahdi, <tamer(a)ca.ibm.com>, August 2000.
-
-[Malyshev] Michael Malyshev, <michael_malyshev(a)mail.ru>, January 2004
-
-[Murai] Jun Murai <jun(a)wide.ad.jp>
-
-[Nussbacher] Hank Nussbacher, <hank(a)vm.tau.ac.il>
-
-[Ohta] Masataka Ohta, <mohta(a)cc.titech.ac.jp>, July 1995.
-
-[Phipps] Toby Phipps, <tphipps(a)peoplesoft.com>, March 2002.
-
-[Pond] Rick Pond, <rickpond(a)vnet.ibm.com>, March 1997.
-
-[Robrigado] Reuel Robrigado, <reuelr(a)ca.ibm.com>, September 2002.
-
-[Scherer] Markus Scherer, <markus.scherer(a)jtcsv.com>, August 2000,
- September 2002.
-
-[Simonsen] Keld Simonsen, <Keld.Simonsen(a)rap.dk>, August 2000.
-
-[Tantsetthi] Trin Tantsetthi, <trin(a)mozart.inet.co.th>, September 1998.
-
-[Tumasonis] Vladas Tumasonis, <vladas.tumasonis(a)maf.vu.lt>, August 2000.
-
-[Uskov] Alexander Uskov, <auskov(a)idc.kz>, September 2002.
-
-[Wendt] Chris Wendt, <christw(a)microsoft.com>, December 1999.
-
-[Yick] Nicky Yick, <cliac(a)itsd.gcn.gov.hk>, October 2000.
-
-[]
-
-
-
-
-
-
-
diff --git a/aliases/makealiases.c b/aliases/makealiases.c
deleted file mode 100644
index 370a234..0000000
--- a/aliases/makealiases.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- * IANA charset data to Iconv Aliases file convertor
- *
- * Version history:
- *
- * 0.01 - Initial version
- * 0.02 - Added "utf8" alias seen in the wild
- */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct extra {
- const char *canon;
- const char *aliases;
-} extras[] = {
- { "ISO-8859-1", "8859_1 ISO8859-1" },
- { "ISO-8859-2", "8859_2 ISO8859-2" },
- { "ISO-8859-3", "8859_3 ISO8859-3" },
- { "ISO-8859-4", "8859_4 ISO8859-4" },
- { "ISO-8859-5", "8859_5 ISO8859-5" },
- { "ISO-8859-7", "8859_7 ISO8859-7" },
- { "ISO-8859-8", "8859_8 ISO8859-8" },
- { "ISO-8859-9", "8859_9 ISO8859-9" },
- { "ISO-8859-10", "8859_10 ISO8859-10" },
- { "ISO-8859-13", "8859_13 ISO8859-13" },
- { "ISO-8859-14", "8859_14 ISO8859-14" },
- { "ISO-8859-15", "8859_15 ISO8859-15" },
- { "Shift_JIS", "X-SJIS Shift-JIS" },
- { "EUC-JP", "EUCJP" },
- { "EUC-KR", "EUCKR" },
- { "UTF-8", "UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8 utf8" },
- { "ISO-10646-UCS-4", "UCS-4 UCS4" },
- { "ISO-10646-UCS-2", "UCS-2 UCS2" },
- { "GB2312", "EUC-CN EUCCN CN-GB" },
- { "Big5", "BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE x-x-big5" },
- { "macintosh", "MACROMAN MAC-ROMAN X-MAC-ROMAN" },
- { "windows-1250", "CP1250 MS-EE" },
- { "windows-1251", "CP1251 MS-CYRL" },
- { "windows-1252", "CP1252 MS-ANSI" },
- { "windows-1253", "CP1253 MS-GREEK" },
- { "windows-1254", "CP1254 MS-TURK" },
- { "windows-1256", "CP1256 MS-ARAB" },
- { "windows-1257", "CP1257 WINBALTRIM" },
-};
-#define EXTRAS_SIZE (sizeof(extras) / sizeof(extras[0]))
-
-/*
- * Make aliases file from IANA charset data.
- * The canonical name of an encoding is that which follows the "Name:" tag
- * in the input file. There is an exception, however, for those encodings
- * which have an alias which is denoted as the "preferred MIME name". For
- * these encodings, the preferred MIME name is taken as the canonical form.
- */
-
-#define TOP argv[1]
-#define SETS argv[2]
-#define BOTTOM argv[3]
-#define ALIASES argv[4]
-
-int main(int argc, const char **argv)
-{
- FILE *in, *out;
- char buf[200], name[64];
- short mibenum;
- char *s, *n, *aliases, *temp;
- int i;
- int namelen;
-
- in = fopen(TOP, "r");
- if (!in)
- return 1;
-
- out = fopen(ALIASES, "w");
- if (!out)
- return 1;
-
- while (fgets(buf, sizeof buf, in)) {
- fputs(buf, out);
- }
-
- fclose(in);
-
- in = fopen(SETS, "r");
- if (!in) {
- fclose(out);
- return 1;
- }
-
- fgets(buf, sizeof buf, in);
-
- while (1) {
- /* find start of record */
- if (strncmp(buf, "Name:", 5) != 0) {
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- }
- }
- if(strncmp(buf, "Name:", 5) != 0)
- break;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf+5;
- /* skip whitespace */
- while (isspace(*s))
- s++;
- /* copy name to buffer */
- n = name;
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
-
- /* get mibenum */
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- if (strncmp(buf, "MIBenum:", 8) == 0)
- break;
- }
- if (strncmp(buf, "MIBenum:", 8) != 0)
- continue;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf+8;
- while (isspace(*s))
- s++;
- mibenum = atoi(s);
-
- aliases = malloc(1);
- if (!aliases)
- break;
- *aliases = '\0';
-
- /* parse aliases */
- while(fgets(buf, sizeof buf, in)) {
- if (strncmp(buf, "Name:", 5) == 0)
- break;
- if (strncmp(buf, "Alias:", 6) != 0)
- continue;
-
- buf[strlen(buf) - 1] = '\0';
-
- s = buf + 6;
- while (isspace(*s))
- s++;
-
- if (strncmp(s, "None", 4) == 0)
- /* ignore this */
- continue;
-
- if (strstr(s, "preferred MIME name") != 0) {
- temp = realloc(aliases,
- strlen(aliases) + 1 +
- strlen(name) + 1);
- if (!temp)
- goto end;
- aliases = temp;
- sprintf(aliases, "%s%s%s", aliases,
- aliases[0] == '\0' ? "" : " ", name);
- n = name;
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
- }
- else {
- n = s;
- while (*n) {
- if (isspace(*n))
- break;
- n++;
- }
- temp = realloc(aliases,
- strlen(aliases) + 1 + (n - s) + 1);
- if (!temp)
- goto end;
- aliases = temp;
- n = aliases + strlen(aliases);
- if (aliases[0] != '\0')
- *n++ = ' ';
- while (*s) {
- if (isspace(*s))
- break;
- *n++ = *s++;
- }
- *n = '\0';
- }
- }
-
- fprintf(out, "%s\t", name);
-
- /* Rounded up to tab stop */
- namelen = (strlen(name) + 8) & ~(8 - 1);
- while (namelen < 3 * 8) {
- fputc('\t', out);
- namelen += 8;
- }
-
- fprintf(out, "%d", mibenum);
-
- if (aliases[0] != '\0')
- fprintf(out, "\t\t%s", aliases);
- for (i = 0; i != EXTRAS_SIZE; i++) {
- if (strcmp(name, extras[i].canon) == 0) {
- fprintf(out, "%s%s",
- aliases[0] == '\0' ? "\t\t" : " ",
- extras[i].aliases);
- break;
- }
- }
- fprintf(out, "\n");
-
- free(aliases);
- }
-
-end:
- fclose(in);
-
- in = fopen(BOTTOM, "r");
- if (!in) {
- fclose(out);
- return 1;
- }
-
- while (fgets(buf, sizeof buf, in))
- fputs(buf, out);
-
- fclose(in);
- fclose(out);
-
- return 0;
-}
-
diff --git a/test/data/Aliases b/riscos/!Boot/Resources/!Unicode/Files/Aliases
similarity index 99%
copy from test/data/Aliases
copy to riscos/!Boot/Resources/!Unicode/Files/Aliases
index db61ff1..8978ede 100644
--- a/test/data/Aliases
+++ b/riscos/!Boot/Resources/!Unicode/Files/Aliases
@@ -245,7 +245,7 @@ Ventura-Math 2022 csVenturaMath
Microsoft-Publishing 2023 csMicrosoftPublishing
Windows-31J 2024 csWindows31J
GB2312 2025 csGB2312 EUC-CN EUCCN CN-GB
-Big5 2026 csBig5 BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE
+Big5 2026 csBig5 BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE x-x-big5
windows-1250 2250 CP1250 MS-EE
windows-1251 2251 CP1251 MS-CYRL
windows-1252 2252 CP1252 MS-ANSI
@@ -287,6 +287,7 @@ CP874 3004 WINDOWS-874
#MACTHAI 3024 X-MAC-THAI MAC-THAI
#MACTURKISH 3025 X-MAC-TURKISH MAC-TURKISH
#MULELAO-1 3026
+CP949 3027 WINDOWS-949
# From Unicode Lib
ISO-IR-182 4000
diff --git a/unicode/.gitignore b/unicode/.gitignore
new file mode 100644
index 0000000..c1845f3
--- /dev/null
+++ b/unicode/.gitignore
@@ -0,0 +1,2 @@
+include
+lib*
--
Iconv implementation for RISC OS
10 years, 7 months