Commit 78d5467a authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

support OPEN_CAST_PARENS, IS, WHILE support structs, enums, and fields,

2006-05-14  Jürg Billeter  <j@bitron.ch>

	* vala/scanner.l: support OPEN_CAST_PARENS, IS, WHILE
	* vala/parser.y: support structs, enums, and fields, cast, postfix,
	  while, ref types, and generic type parameters; fix comments
	* vala/valacodecontext.vala: add root symbol
	* vala/valasourcefile.vala: add using directives, c filenames
	* vala/valacodevisitor.vala: add begin and end visits for some container
	  types, add struct, enum, field, type parameter, namespace reference,
	  and type reference visits
	* vala/valaparser.vala: adapt to visitor changes
	* vala/valasymbolbiulder.vala: visitor to fill symbol table
	* vala/valasymbolresolver.vala: visitor to resolve symbol references
	* vala/valacodegenerator.vala: add beginning of code generation
	* vala/valacodenode.vala: add symbol reference
	* vala/valacastexpression.vala
	* vala/valaclass.vala: derive from struct
	* vala/valaenum.vala
	* vala/valaexpression.vala: add static_type, field_reference, and
	  method_reference fields
	* vala/valafield.vala
	* vala/valamemberaccess.vala
	* vala/valanamespace.vala: add structs, enums, and fields
	* vala/valanamespacereference.vala
	* vala/valapostfixexpression.vala
	* vala/valasourcereference.vala: adapt to comment changes
	* vala/valastringliteral.vala: add eval method
	* vala/valastruct.vala
	* vala/valasymbol.vala
	* vala/valatype.vala
	* vala/valatypeparameter.vala: 
	* vala/valatypereference.vala: add type, type_parameter, is_ref, and
	  is_out fields, add get_cname method
	* vala/valavariabledeclarator.vala: add name and initializer fields
	* vala/valawhilestatement.vala: 
	* vala/vala.h: update
	* compiler/valacompiler.vala: run SymbolBuilder and SymbolResolver
	* ccode/valaccodewriter.vala
	* ccode/valaccodecomment.vala
	* ccode/valaccodefragment.vala
	* ccode/valaccodenode.vala
	* ccode/valaccodestruct.vala
	* bindings/GLib.vala: add/extend ustring, Path, Object, File, HashTable
	* valac/scanner.l: support OPEN_CAST_PARENS, OP_AND, OP_OR, IS, WHILE
	* valac/parser.y: support cast, while, include_filename ccode attribute,
	  AND and OR expressions, IS type checks, unary minus
	* valac/context.h: add while statements, cast and IS expressions, and
	  AND and OR operators
	* valac/context.c: support cast, IS, while; fix if
	* valac/generator.c: support cast, IS, pointer arithmetic, namespace
	  methods, imported include files
	* valac/driver.c: add symbol alias

svn path=/trunk/; revision=15
parent 04ad6ba4
2006-05-14 Jürg Billeter <j@bitron.ch>
* vala/scanner.l: support OPEN_CAST_PARENS, IS, WHILE
* vala/parser.y: support structs, enums, and fields, cast, postfix,
while, ref types, and generic type parameters; fix comments
* vala/valacodecontext.vala: add root symbol
* vala/valasourcefile.vala: add using directives, c filenames
* vala/valacodevisitor.vala: add begin and end visits for some container
types, add struct, enum, field, type parameter, namespace reference,
and type reference visits
* vala/valaparser.vala: adapt to visitor changes
* vala/valasymbolbiulder.vala: visitor to fill symbol table
* vala/valasymbolresolver.vala: visitor to resolve symbol references
* vala/valacodegenerator.vala: add beginning of code generation
* vala/valacodenode.vala: add symbol reference
* vala/valacastexpression.vala
* vala/valaclass.vala: derive from struct
* vala/valaenum.vala
* vala/valaexpression.vala: add static_type, field_reference, and
method_reference fields
* vala/valafield.vala
* vala/valamemberaccess.vala
* vala/valanamespace.vala: add structs, enums, and fields
* vala/valanamespacereference.vala
* vala/valapostfixexpression.vala
* vala/valasourcereference.vala: adapt to comment changes
* vala/valastringliteral.vala: add eval method
* vala/valastruct.vala
* vala/valasymbol.vala
* vala/valatype.vala
* vala/valatypeparameter.vala:
* vala/valatypereference.vala: add type, type_parameter, is_ref, and
is_out fields, add get_cname method
* vala/valavariabledeclarator.vala: add name and initializer fields
* vala/valawhilestatement.vala:
* vala/vala.h: update
* compiler/valacompiler.vala: run SymbolBuilder and SymbolResolver
* ccode/valaccodewriter.vala
* ccode/valaccodecomment.vala
* ccode/valaccodefragment.vala
* ccode/valaccodenode.vala
* ccode/valaccodestruct.vala
* bindings/GLib.vala: add/extend ustring, Path, Object, File, HashTable
* valac/scanner.l: support OPEN_CAST_PARENS, OP_AND, OP_OR, IS, WHILE
* valac/parser.y: support cast, while, include_filename ccode attribute,
AND and OR expressions, IS type checks, unary minus
* valac/context.h: add while statements, cast and IS expressions, and
AND and OR operators
* valac/context.c: support cast, IS, while; fix if
* valac/generator.c: support cast, IS, pointer arithmetic, namespace
methods, imported include files
* valac/driver.c: add symbol alias
2006-05-07 Jürg Billeter <j@bitron.ch>
* vala/scanner.l: tokenizer for new vala compiler
......
......@@ -20,8 +20,6 @@
* Jürg Billeter <j@bitron.ch>
*/
using Vala;
[CCode (cname = "gboolean")]
public struct bool {
}
......@@ -90,20 +88,57 @@ public struct int64 {
public struct uint64 {
}
[CCode (cname = "gunichar")]
public struct unichar {
}
[ReferenceType ()]
[AllowPointerArithmetic ()]
[CCode (cname = "char")]
public struct string {
[CCode (cname = "g_str_has_suffix")]
public bool has_suffix (string suffix);
[CCode (cname = "g_strdup_printf")]
public string# printf (string args);
public ref string printf (string args);
[CCode (cname = "g_strconcat")]
public string# concat (string string2);
public ref string concat (string string2);
[CCode (cname = "g_strdup")]
public ref string dup ();
[CCode (cname = "g_strndup")]
public ref string ndup (int n);
[CCode (cname = "strlen")]
public int len ();
[CCode (cname = "g_strcompress")]
public string# compress ();
}
[ReferenceType ()]
[CCode (cname = "char")]
public struct ustring {
[CCode (cname = "g_utf8_offset_to_pointer")]
[PlusOperator ()]
public string offset (long offset);
[CCode (cname = "g_utf8_strlen")]
public long len (long max /*= -1*/);
}
[Import ()]
[CCode (cname = "g", cprefix = "G", include_filename = "glib/glib.h")]
[CCode (cname = "g", cprefix = "G", include_filename = "glib.h")]
namespace GLib {
public struct Path {
public static ref ustring get_basename (ustring file_name);
}
public struct Type {
}
public struct ObjectConstructParam {
}
public class Object {
public virtual Object constructor (Type type, uint n_construct_properties, ObjectConstructParam[] construct_properties);
}
[ReferenceType ()]
public struct Error {
}
......@@ -111,10 +146,21 @@ namespace GLib {
[ReferenceType ()]
[CCode (cname = "FILE")]
public struct File {
[CCode (cname = "fopen")]
public static File# open (string path, string mode);
[CCode (cname = "fprintf")]
public void printf (string format);
[InstanceLast ()]
[CCode (cname = "fputc")]
public void putc (char c);
[InstanceLast ()]
[CCode (cname = "fputs")]
public void puts (string s);
[CCode (cname = "fclose")]
public void close ();
}
[CCode (cname = "stderr")]
public static GLib.File stderr;
[Unknown (reference_type = true)]
......@@ -197,4 +243,24 @@ namespace GLib {
public List<G> next;
public List<G> prev;
}
[ReferenceType ()]
public struct HashTable<K,V> {
public static HashTable# new (HashFunc hash_func, EqualFunc key_equal_func);
public void insert (K key, V value);
public V lookup (K key);
}
public struct HashFunc {
}
public struct EqualFunc {
}
[CCode (cname = "g_str_hash")]
public static GLib.HashFunc str_hash;
[CCode (cname = "g_str_equal")]
public static GLib.EqualFunc str_equal;
}
/* valaccodecomment.vala
*
* Copyright (C) 2006 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
namespace Vala {
public class CCodeComment : CCodeNode {
public readonly string# text;
public override void write (CCodeWriter writer) {
writer.write_comment (text);
}
}
}
/* valaccodefragment.vala
*
* Copyright (C) 2006 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
namespace Vala {
public class CCodeFragment : CCodeNode {
public readonly List<CCodeNode#># children;
public void append (CCodeNode node) {
_children.append (node);
}
public override void write (CCodeWriter writer) {
foreach (CCodeNode node in children) {
node.write (writer);
}
}
}
}
/* valaccodenode.vala
*
* Copyright (C) 2006 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
namespace Vala {
public abstract class CCodeNode {
public abstract void write (CCodeWriter writer);
}
}
/* valaccodestruct.vala
*
* Copyright (C) 2006 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
namespace Vala {
public class CCodeStruct : CCodeNode {
public readonly string# name;
List<string#># fields;
public void add_field (string type, string name) {
fields.append ("%s %s".printf (type, name));
}
public override void write (CCodeWriter writer) {
writer.write_string ("struct ");
writer.write_string (name);
writer.write_begin_block ();
foreach (string field in fields) {
writer.write_indent ();
writer.write_string (field);
writer.write_string (";\n");
}
writer.write_end_block ();
writer.write_string (";\n");
}
}
}
/* valaccodewriter.vala
*
* Copyright (C) 2006 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jürg Billeter <j@bitron.ch>
*/
using GLib;
namespace Vala {
public class CCodeWriter {
public readonly File# stream;
int indent;
public void close () {
stream.close ();
}
public void write_indent () {
int i;
for (i = 0; i < indent; i++) {
stream.putc ('\t');
}
}
public void write_string (string s) {
stream.printf ("%s", s);
}
public void write_begin_block () {
stream.printf (" {\n");
indent++;
}
public void write_end_block () {
indent--;
write_indent ();
stream.printf ("}");
}
public void write_comment (string text) {
stream.printf ("/*%s*/", text);
}
}
}
......@@ -46,6 +46,12 @@ namespace Vala {
var parser = new Parser ();
parser.parse (context);
var builder = new SymbolBuilder ();
builder.build (context);
var resolver = new SymbolResolver ();
resolver.resolve (context);
var code_generator = new CodeGenerator ();
code_generator.emit (context);
}
......
......@@ -34,11 +34,13 @@
/* necessary for bootstrapping with vala compiler without memory management */
#define g_object_unref(obj) (obj)
#define src(l) (vala_source_reference_new (current_source_file, l.first_line, l.first_column, l.last_line, l.last_column, vala_parser_pop_comment (parser)))
#define src(l) (vala_source_reference_new (current_source_file, l.first_line, l.first_column, l.last_line, l.last_column))
#define src_com(l,c) (vala_source_reference_new_with_comment (current_source_file, l.first_line, l.first_column, l.last_line, l.last_column, c))
static ValaSourceFile *current_source_file;
static ValaNamespace *current_namespace;
static ValaClass *current_class;
static ValaStruct *current_struct;
int yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, ValaParser *parser);
static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
......@@ -60,15 +62,20 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
ValaStatement *statement;
ValaNamespace *namespace;
ValaClass *class;
ValaStruct *struct_;
ValaEnum *enum_;
ValaField *field;
ValaMethod *method;
ValaLocalVariableDeclaration *local_variable_declaration;
ValaVariableDeclarator *variable_declarator;
ValaTypeParameter *type_parameter;
ValaNamedArgument *named_argument;
}
%token OPEN_BRACE "{"
%token CLOSE_BRACE "}"
%token OPEN_PARENS "("
%token OPEN_CAST_PARENS "cast ("
%token CLOSE_PARENS ")"
%token OPEN_BRACKET "["
%token CLOSE_BRACKET "]"
......@@ -136,16 +143,19 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%token USING "using"
%token VAR "var"
%token VIRTUAL "virtual"
%token WHILE "while"
%token <str> IDENTIFIER "identifier"
%token <str> INTEGER_LITERAL "integer"
%token <str> CHARACTER_LITERAL "character"
%token <str> STRING_LITERAL "string"
%type <str> comment
%type <literal> literal
%type <literal> boolean_literal
%type <type_reference> type_name
%type <type_reference> type
%type <num> opt_ref
%type <num> opt_own_qualifier
%type <list> opt_argument_list
%type <list> argument_list
......@@ -154,9 +164,13 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%type <expression> simple_name
%type <expression> parenthesized_expression
%type <expression> member_access
%type <str> identifier_or_new
%type <expression> invocation_expression
%type <expression> post_increment_expression
%type <expression> post_decrement_expression
%type <expression> object_creation_expression
%type <expression> unary_expression
%type <expression> cast_expression
%type <expression> multiplicative_expression
%type <expression> additive_expression
%type <expression> shift_expression
......@@ -185,6 +199,7 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%type <statement> selection_statement
%type <statement> if_statement
%type <statement> iteration_statement
%type <statement> while_statement
%type <statement> for_statement
%type <list> opt_statement_expression_list
%type <list> statement_expression_list
......@@ -193,6 +208,10 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%type <statement> return_statement
%type <namespace> namespace_declaration
%type <class> class_declaration
%type <struct_> struct_declaration
%type <struct_> struct_header
%type <enum_> enum_declaration
%type <field> field_declaration
%type <list> variable_declarators
%type <variable_declarator> variable_declarator
%type <list> initializer_list
......@@ -203,6 +222,10 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%type <list> opt_named_argument_list
%type <list> named_argument_list
%type <named_argument> named_argument
%type <list> opt_type_parameter_list
%type <list> type_parameter_list
%type <list> type_parameters
%type <type_parameter> type_parameter
%type <list> opt_type_argument_list
%type <list> type_argument_list
%type <list> type_arguments
......@@ -247,17 +270,28 @@ boolean_literal
;
compilation_unit
: opt_using_directives opt_outer_declarations
: comment opt_using_directives opt_outer_declarations
{
current_source_file->comment = $1;
}
;
type_name
: IDENTIFIER opt_type_argument_list
{
$$ = vala_type_reference_new (NULL, $1, $2, src(@1));
GList *l;
$$ = vala_type_reference_new (NULL, $1, src(@1));
for (l = $2; l != NULL; l = l->next) {
vala_type_reference_add_type_argument ($$, l->data);
}
}
| IDENTIFIER DOT IDENTIFIER opt_type_argument_list
{
$$ = vala_type_reference_new ($1, $3, $4, src(@1));
GList *l;
$$ = vala_type_reference_new ($1, $3, src(@1));
for (l = $4; l != NULL; l = l->next) {
vala_type_reference_add_type_argument ($$, l->data);
}
}
;
......@@ -275,6 +309,17 @@ type
}
;
opt_ref
: /* empty */
{
$$ = FALSE;
}
| REF
{
$$ = TRUE;
}
;
opt_own_qualifier
: /* empty */
{
......@@ -322,6 +367,8 @@ primary_expression
| parenthesized_expression
| member_access
| invocation_expression
| post_increment_expression
| post_decrement_expression
| object_creation_expression
;
......@@ -340,7 +387,15 @@ parenthesized_expression
;
member_access
: primary_expression DOT IDENTIFIER opt_type_argument_list
: primary_expression DOT identifier_or_new opt_type_argument_list
;
identifier_or_new
: IDENTIFIER
| NEW
{
$$ = g_strdup ("new");
}
;
invocation_expression
......@@ -350,6 +405,20 @@ invocation_expression
}
;
post_increment_expression
: primary_expression OP_INC
{
$$ = VALA_EXPRESSION (vala_postfix_expression_new ($1, TRUE, src(@1)));
}
;
post_decrement_expression
: primary_expression OP_DEC
{
$$ = VALA_EXPRESSION (vala_postfix_expression_new ($1, FALSE, src(@1)));
}
;
object_creation_expression
: NEW type OPEN_PARENS opt_named_argument_list CLOSE_PARENS
{
......@@ -379,6 +448,14 @@ unary_expression
{
$$ = VALA_EXPRESSION (vala_unary_expression_new (VALA_UNARY_OPERATOR_OUT, src(@1)));
}
| cast_expression
;
cast_expression
: OPEN_CAST_PARENS type CLOSE_PARENS unary_expression
{
$$ = VALA_EXPRESSION (vala_cast_expression_new ($4, $2, src (@1)));
}
;
multiplicative_expression
......@@ -556,7 +633,10 @@ expression_statement
statement_expression
: invocation_expression
| object_creation_expression
| assignment
| post_increment_expression
| post_decrement_expression
;
selection_statement
......@@ -575,10 +655,18 @@ if_statement
;
iteration_statement
: for_statement
: while_statement
| for_statement
| foreach_statement
;
while_statement
: WHILE OPEN_PARENS expression CLOSE_PARENS embedded_statement
{
$$ = VALA_STATEMENT (vala_while_statement_new ($3, $5, src (@1)));
}
;
for_statement
: FOR OPEN_PARENS opt_statement_expression_list SEMICOLON opt_expression SEMICOLON opt_statement_expression_list CLOSE_PARENS embedded_statement
{
......@@ -624,9 +712,9 @@ return_statement
;
namespace_declaration
: opt_attributes NAMESPACE IDENTIFIER
: comment opt_attributes NAMESPACE IDENTIFIER
{
current_namespace = vala_namespace_new ($3, src(@3));
current_namespace = vala_namespace_new ($4, src_com (@4, $1));
}
namespace_body
{
......@@ -652,6 +740,9 @@ using_directives
using_directive
: USING IDENTIFIER SEMICOLON
{
vala_source_file_add_using_directive (current_source_file, vala_namespace_reference_new ($2, src (@2)));
}
;
opt_outer_declarations
......@@ -689,22 +780,35 @@ namespace_member_declaration
vala_namespace_add_class (current_namespace, $1);
}
| struct_declaration
{
vala_namespace_add_struct (current_namespace, $1);
}
| interface_declaration
| enum_declaration
{
vala_namespace_add_enum (current_namespace, $1);
}
| flags_declaration
| field_declaration
{
vala_namespace_add_field (current_namespace, $1);
}
| method_declaration
;
class_declaration
: opt_attributes opt_access_modifier opt_modifiers CLASS IDENTIFIER opt_type_parameter_list opt_class_base
: comment opt_attributes opt_access_modifier opt_modifiers CLASS IDENTIFIER opt_type_parameter_list opt_class_base
{
current_class = vala_class_new ($5, src(@5));
GList *l;
current_struct = VALA_STRUCT (vala_class_new ($6, src_com (@6, $1)));
for (l = $7; l != NULL; l = l->next) {
vala_struct_add_type_parameter (current_struct, l->data);
}
}
class_body
{
$$ = current_class;
current_class = NULL;
$$ = current_struct;
current_struct = NULL;
}
;
......@@ -767,15 +871,18 @@ class_member_declarations
class_member_declaration
: constant_declaration
| field_declaration
{
vala_struct_add_field (current_struct, $1);
}
| method_declaration
{
vala_class_add_method (current_class, $1);
vala_struct_add_method (current_struct, $1);
}
| property_declaration
;
constant_declaration
: opt_attributes opt_access_modifier CONST type constant_declarators SEMICOLON
: comment opt_attributes opt_access_modifier CONST type constant_declarators SEMICOLON
;
constant_declarators
......@@ -788,7 +895,17 @@ constant_declarator
;
field_declaration
: opt_attributes opt_access_modifier opt_modifiers type variable_declarators SEMICOLON
: comment opt_attributes opt_access_modifier opt_modifiers opt_ref type variable_declarator SEMICOLON
{
$$ = vala_field_new (vala_variable_declarator_get_name ($7), $6, vala_variable_declarator_get_initializer ($7), src_com (@6, $1));
}
;
comment
:
{
$$ = vala_parser_pop_comment (parser);
}
;
variable_declarators
......@@ -845,9 +962,9 @@ method_declaration
;
method_header
: opt_attributes opt_access_modifier opt_modifiers type IDENTIFIER OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
: comment opt_attributes opt_access_modifier opt_modifiers opt_ref type identifier_or_new OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
{
$$ = vala_method_new ($5, src(@5));
$$ = vala_method_new ($7, src_com (@7, $1));
}
;
......@@ -888,7 +1005,7 @@ parameter_modifier
;
property_declaration
: opt_attributes opt_access_modifier opt_modifiers type IDENTIFIER OPEN_BRACE accessor_declarations CLOSE_BRACE
: comment opt_attributes opt_access_modifier opt_modifiers opt_ref type IDENTIFIER OPEN_BRACE accessor_declarations CLOSE_BRACE
;
accessor_declarations
......@@ -918,11 +1035,26 @@ set_accessor_declaration
;
struct_declaration
: struct_header struct_body
: struct_header