Updated Spanish translation
[anjuta.git] / plugins / language-support-js / js-node.h
blob228b0a73f0b0fe485932f4c3ba25cf14f8372466
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 Copyright (C) 2009 Maxim Ermilov <zaspire@rambler.ru>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _JS_NODE_H_
21 #define _JS_NODE_H_
23 #include <glib-object.h>
25 #include "jstypes.h"
27 G_BEGIN_DECLS
29 #define JS_TYPE_NODE (js_node_get_type ())
30 #define JS_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), JS_TYPE_NODE, JSNode))
31 #define JS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), JS_TYPE_NODE, JSNodeClass))
32 #define JS_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JS_TYPE_NODE))
33 #define JS_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), JS_TYPE_NODE))
34 #define JS_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), JS_TYPE_NODE, JSNodeClass))
36 typedef struct _JSNodeClass JSNodeClass;
37 typedef struct _JSNode JSNode;
39 struct _JSNodeClass
41 GObjectClass parent_class;
44 struct _JSNode
46 GObject parent_instance;
48 int pn_type;
49 int pn_op;
50 int pn_arity;
51 JSTokenPos pn_pos;
52 union {
53 struct { /* TOK_FUNCTION node */
54 JSNode *body;
55 JSNode *name;
56 JSNode *args;
57 } func;
58 struct { /* list of next-linked nodes */
59 JSNode *head;
60 } list;
61 struct { /* ternary: if, for(;;), ?: */
62 char dummy;
63 } ternary;
64 struct { /* two kids if binary */
65 JSNode *left;
66 JSNode *right;
67 } binary;
68 struct { /* one kid if unary */
69 JSNode *kid;
70 } unary;
71 struct { /* name, labeled statement, etc. */
72 JSNode *expr;
73 void *name;
74 char isconst;
75 } name;
76 struct {
77 char dummy;
78 } apair;
79 } pn_u;
80 JSNode *pn_next;
83 GType js_node_get_type (void) G_GNUC_CONST;
84 gchar* js_node_get_name (JSNode *node);
85 JSNode* js_node_new_from_file (const gchar *name);
86 GList* js_node_get_list_member_from_rc (JSNode* node);
87 JSNode* js_node_get_member_from_rc (JSNode* node, const gchar *mname);
88 GList* js_node_get_lines_missed_semicolon (JSNode *node);
90 G_END_DECLS
92 #endif /* _JS_NODE_H_ */