nsgenbind
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
webidl-ast.h File Reference

Go to the source code of this file.

Typedefs

typedef int() webidl_callback_t(struct webidl_node *node, void *ctx)
 

Enumerations

enum  webidl_node_type {
  WEBIDL_NODE_TYPE_ROOT = 0 , WEBIDL_NODE_TYPE_IDENT , WEBIDL_NODE_TYPE_MODIFIER , WEBIDL_NODE_TYPE_LIST ,
  WEBIDL_NODE_TYPE_INTERFACE , WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS , WEBIDL_NODE_TYPE_ATTRIBUTE , WEBIDL_NODE_TYPE_OPERATION ,
  WEBIDL_NODE_TYPE_CONST , WEBIDL_NODE_TYPE_DICTIONARY , WEBIDL_NODE_TYPE_INHERITANCE , WEBIDL_NODE_TYPE_SPECIAL ,
  WEBIDL_NODE_TYPE_ARGUMENT , WEBIDL_NODE_TYPE_OPTIONAL , WEBIDL_NODE_TYPE_ELLIPSIS , WEBIDL_NODE_TYPE_TYPE ,
  WEBIDL_NODE_TYPE_TYPE_BASE , WEBIDL_NODE_TYPE_TYPE_NULLABLE , WEBIDL_NODE_TYPE_TYPE_ARRAY , WEBIDL_NODE_TYPE_LITERAL_NULL ,
  WEBIDL_NODE_TYPE_LITERAL_INT , WEBIDL_NODE_TYPE_LITERAL_BOOL , WEBIDL_NODE_TYPE_LITERAL_FLOAT , WEBIDL_NODE_TYPE_LITERAL_STRING ,
  WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE
}
 
enum  webidl_type {
  WEBIDL_TYPE_ANY , WEBIDL_TYPE_USER , WEBIDL_TYPE_BOOL , WEBIDL_TYPE_BYTE ,
  WEBIDL_TYPE_OCTET , WEBIDL_TYPE_FLOAT , WEBIDL_TYPE_DOUBLE , WEBIDL_TYPE_SHORT ,
  WEBIDL_TYPE_LONG , WEBIDL_TYPE_LONGLONG , WEBIDL_TYPE_STRING , WEBIDL_TYPE_SEQUENCE ,
  WEBIDL_TYPE_OBJECT , WEBIDL_TYPE_DATE , WEBIDL_TYPE_VOID
}
 
enum  webidl_type_modifier {
  WEBIDL_TYPE_MODIFIER_NONE , WEBIDL_TYPE_MODIFIER_UNSIGNED , WEBIDL_TYPE_MODIFIER_UNRESTRICTED , WEBIDL_TYPE_MODIFIER_READONLY ,
  WEBIDL_TYPE_MODIFIER_STATIC , WEBIDL_TYPE_MODIFIER_INHERIT
}
 
enum  webidl_type_special {
  WEBIDL_TYPE_SPECIAL_GETTER , WEBIDL_TYPE_SPECIAL_SETTER , WEBIDL_TYPE_SPECIAL_CREATOR , WEBIDL_TYPE_SPECIAL_DELETER ,
  WEBIDL_TYPE_SPECIAL_LEGACYCALLER
}
 

Functions

int webidl_cmp_node_type (struct webidl_node *node, void *ctx)
 
struct webidl_nodewebidl_node_new (enum webidl_node_type, struct webidl_node *l, void *r)
 
struct webidl_nodewebidl_new_number_node (enum webidl_node_type type, struct webidl_node *l, int number)
 
struct webidl_nodewebidl_node_prepend (struct webidl_node *list, struct webidl_node *node)
 
struct webidl_nodewebidl_node_append (struct webidl_node *list, struct webidl_node *node)
 
struct webidl_nodewebidl_node_add (struct webidl_node *node, struct webidl_node *list)
 
char * webidl_node_gettext (struct webidl_node *node)
 
struct webidl_nodewebidl_node_getnode (struct webidl_node *node)
 
int * webidl_node_getint (struct webidl_node *node)
 
float * webidl_node_getfloat (struct webidl_node *node)
 
enum webidl_node_type webidl_node_gettype (struct webidl_node *node)
 
int webidl_node_for_each_type (struct webidl_node *node, enum webidl_node_type type, webidl_callback_t *cb, void *ctx)
 
int webidl_node_enumerate_type (struct webidl_node *node, enum webidl_node_type type)
 
struct webidl_nodewebidl_node_find (struct webidl_node *node, struct webidl_node *prev, webidl_callback_t *cb, void *ctx)
 
struct webidl_nodewebidl_node_find_type (struct webidl_node *node, struct webidl_node *prev, enum webidl_node_type type)
 
struct webidl_nodewebidl_node_find_type_ident (struct webidl_node *root_node, enum webidl_node_type type, const char *ident)
 
int webidl_parsefile (char *filename, struct webidl_node **webidl_ast)
 
int webidl_dump_ast (struct webidl_node *node)
 
int webidl_intercalate_implements (struct webidl_node *node)
 
int webidl_fprintf (FILE *stream, const char *format,...)
 
const char * webidl_type_to_str (enum webidl_type_modifier m, enum webidl_type t)
 

Typedef Documentation

◆ webidl_callback_t

typedef int() webidl_callback_t(struct webidl_node *node, void *ctx)

callback for search and iteration routines

Definition at line 91 of file webidl-ast.h.

Enumeration Type Documentation

◆ webidl_node_type

Enumerator
WEBIDL_NODE_TYPE_ROOT 
WEBIDL_NODE_TYPE_IDENT 
WEBIDL_NODE_TYPE_MODIFIER 

access modifier e.g. for attributes or types

WEBIDL_NODE_TYPE_LIST 

a list of nodes (interface members, arguments)

WEBIDL_NODE_TYPE_INTERFACE 

node is an interface

WEBIDL_NODE_TYPE_INTERFACE_IMPLEMENTS 
WEBIDL_NODE_TYPE_ATTRIBUTE 
WEBIDL_NODE_TYPE_OPERATION 
WEBIDL_NODE_TYPE_CONST 
WEBIDL_NODE_TYPE_DICTIONARY 

node is a dictionary

WEBIDL_NODE_TYPE_INHERITANCE 

node has inheritance

WEBIDL_NODE_TYPE_SPECIAL 
WEBIDL_NODE_TYPE_ARGUMENT 
WEBIDL_NODE_TYPE_OPTIONAL 
WEBIDL_NODE_TYPE_ELLIPSIS 
WEBIDL_NODE_TYPE_TYPE 
WEBIDL_NODE_TYPE_TYPE_BASE 
WEBIDL_NODE_TYPE_TYPE_NULLABLE 
WEBIDL_NODE_TYPE_TYPE_ARRAY 
WEBIDL_NODE_TYPE_LITERAL_NULL 
WEBIDL_NODE_TYPE_LITERAL_INT 
WEBIDL_NODE_TYPE_LITERAL_BOOL 
WEBIDL_NODE_TYPE_LITERAL_FLOAT 
WEBIDL_NODE_TYPE_LITERAL_STRING 
WEBIDL_NODE_TYPE_EXTENDED_ATTRIBUTE 

Definition at line 12 of file webidl-ast.h.

◆ webidl_type

Enumerator
WEBIDL_TYPE_ANY 

0 - The type is unconstrained

WEBIDL_TYPE_USER 

1 - The type is a dictionary or interface

WEBIDL_TYPE_BOOL 

2 - The type is boolean

WEBIDL_TYPE_BYTE 

3 - The type is a byte

WEBIDL_TYPE_OCTET 

4 - The type is a octet

WEBIDL_TYPE_FLOAT 

5 - The type is a float point number

WEBIDL_TYPE_DOUBLE 

6 - The type is a double

WEBIDL_TYPE_SHORT 

7 - The type is a signed 16bit

WEBIDL_TYPE_LONG 

8 - The type is a signed 32bit

WEBIDL_TYPE_LONGLONG 

9 - The type is a signed 64bit

WEBIDL_TYPE_STRING 

10 - The type is a string

WEBIDL_TYPE_SEQUENCE 

11 - The type is a sequence

WEBIDL_TYPE_OBJECT 

12 - The type is a object

WEBIDL_TYPE_DATE 

13 - The type is a date

WEBIDL_TYPE_VOID 

14 - The type is void

Definition at line 51 of file webidl-ast.h.

◆ webidl_type_modifier

modifiers for operations, attributes and arguments

Enumerator
WEBIDL_TYPE_MODIFIER_NONE 
WEBIDL_TYPE_MODIFIER_UNSIGNED 
WEBIDL_TYPE_MODIFIER_UNRESTRICTED 
WEBIDL_TYPE_MODIFIER_READONLY 
WEBIDL_TYPE_MODIFIER_STATIC 

operation or attribute is static

WEBIDL_TYPE_MODIFIER_INHERIT 

attribute inherits

Definition at line 70 of file webidl-ast.h.

◆ webidl_type_special

Enumerator
WEBIDL_TYPE_SPECIAL_GETTER 
WEBIDL_TYPE_SPECIAL_SETTER 
WEBIDL_TYPE_SPECIAL_CREATOR 
WEBIDL_TYPE_SPECIAL_DELETER 
WEBIDL_TYPE_SPECIAL_LEGACYCALLER 

Definition at line 80 of file webidl-ast.h.

Function Documentation

◆ webidl_cmp_node_type()

int webidl_cmp_node_type ( struct webidl_node node,
void *  ctx 
)

Definition at line 176 of file webidl-ast.c.

◆ webidl_dump_ast()

int webidl_dump_ast ( struct webidl_node node)

dump AST to file

Definition at line 571 of file webidl-ast.c.

◆ webidl_fprintf()

int webidl_fprintf ( FILE *  stream,
const char *  format,
  ... 
)

formatted printf to allow webidl trace data to be written to file.

Definition at line 662 of file webidl-ast.c.

◆ webidl_intercalate_implements()

int webidl_intercalate_implements ( struct webidl_node node)

perform replacement of implements elements with copies of ast data

Definition at line 769 of file webidl-ast.c.

◆ webidl_new_number_node()

struct webidl_node * webidl_new_number_node ( enum webidl_node_type  type,
struct webidl_node l,
int  number 
)

create a new node with an integer value

Definition at line 138 of file webidl-ast.c.

◆ webidl_node_add()

struct webidl_node * webidl_node_add ( struct webidl_node node,
struct webidl_node list 
)

Definition at line 87 of file webidl-ast.c.

◆ webidl_node_append()

struct webidl_node * webidl_node_append ( struct webidl_node list,
struct webidl_node node 
)

Definition at line 64 of file webidl-ast.c.

◆ webidl_node_enumerate_type()

int webidl_node_enumerate_type ( struct webidl_node node,
enum webidl_node_type  type 
)

Definition at line 192 of file webidl-ast.c.

◆ webidl_node_find()

struct webidl_node * webidl_node_find ( struct webidl_node node,
struct webidl_node prev,
webidl_callback_t cb,
void *  ctx 
)

Definition at line 205 of file webidl-ast.c.

◆ webidl_node_find_type()

struct webidl_node * webidl_node_find_type ( struct webidl_node node,
struct webidl_node prev,
enum webidl_node_type  type 
)

Definition at line 233 of file webidl-ast.c.

◆ webidl_node_find_type_ident()

struct webidl_node * webidl_node_find_type_ident ( struct webidl_node root_node,
enum webidl_node_type  type,
const char *  ident 
)

Definition at line 246 of file webidl-ast.c.

◆ webidl_node_for_each_type()

int webidl_node_for_each_type ( struct webidl_node node,
enum webidl_node_type  type,
webidl_callback_t cb,
void *  ctx 
)

Iterate nodes children matching their type.

For each child node where the type is matched the callback function is called with a context value.

Definition at line 152 of file webidl-ast.c.

◆ webidl_node_getfloat()

float * webidl_node_getfloat ( struct webidl_node node)

Definition at line 313 of file webidl-ast.c.

◆ webidl_node_getint()

int * webidl_node_getint ( struct webidl_node node)

Definition at line 293 of file webidl-ast.c.

◆ webidl_node_getnode()

struct webidl_node * webidl_node_getnode ( struct webidl_node node)

Definition at line 335 of file webidl-ast.c.

◆ webidl_node_gettext()

char * webidl_node_gettext ( struct webidl_node node)

Definition at line 273 of file webidl-ast.c.

◆ webidl_node_gettype()

enum webidl_node_type webidl_node_gettype ( struct webidl_node node)

Definition at line 328 of file webidl-ast.c.

◆ webidl_node_new()

struct webidl_node * webidl_node_new ( enum  webidl_node_type,
struct webidl_node l,
void *  r 
)

create a new node with a pointer value

Definition at line 124 of file webidl-ast.c.

◆ webidl_node_prepend()

struct webidl_node * webidl_node_prepend ( struct webidl_node list,
struct webidl_node node 
)

Definition at line 44 of file webidl-ast.c.

◆ webidl_parsefile()

int webidl_parsefile ( char *  filename,
struct webidl_node **  webidl_ast 
)

parse web idl file into Abstract Syntax Tree

Definition at line 619 of file webidl-ast.c.

◆ webidl_type_to_str()

const char * webidl_type_to_str ( enum webidl_type_modifier  m,
enum webidl_type  t 
)

get string of argument type

< 0 - The type is unconstrained

< 1 - The type is a dictionary or interface

< 2 - The type is boolean

< 3 - The type is a byte

< 4 - The type is a octet

< 5 - The type is a float point number

< 6 - The type is a double

< 7 - The type is a signed 16bit

< 8 - The type is a signed 32bit

< 9 - The type is a signed 64bit

< 10 - The type is a string

< 11 - The type is a sequence

< 12 - The type is a object

< 13 - The type is a date

< 14 - The type is void

Definition at line 788 of file webidl-ast.c.