2002-07-31 Duncan Mak <duncan@ximian.com>
[mono.git] / mcs / class / Mono.CSharp.Debugger / csharp-mono-lang.c
1 /* -*- mode: C; c-basic-offset: 2 -*-
2
3    C# language support for Mono.
4    Copyright 2002 Ximian, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.  */
20
21 #include "defs.h"
22 #include "symtab.h"
23 #include "gdbtypes.h"
24 #include "expression.h"
25 #include "parser-defs.h"
26 #include "language.h"
27 #include "gdbtypes.h"
28 #include "symtab.h"
29 #include "symfile.h"
30 #include "objfiles.h"
31 #include "gdb_string.h"
32 #include "value.h"
33 #include "csharp-lang.h"
34 #include "c-lang.h"
35 #include "gdbcore.h"
36 #include <ctype.h>
37
38 /* Local functions */
39
40 extern void _initialize_csharp_mono_language (void);
41
42 const struct language_defn csharp_mono_language_defn =
43 {
44   "csharp-mono",                /* Language name */
45   language_csharp_mono,
46   c_builtin_types,
47   range_check_off,
48   type_check_off,
49   case_sensitive_on,
50   c_parse,
51   c_error,
52   evaluate_subexp_standard,
53   c_printchar,                  /* Print a character constant */
54   c_printstr,                   /* Function to print string constant */
55   csharp_emit_char,             /* Function to print a single character */
56   c_create_fundamental_type,    /* Create fundamental type in this language */
57   csharp_print_type,            /* Print a type using appropriate syntax */
58   csharp_val_print,             /* Print a value using appropriate syntax */
59   csharp_value_print,           /* Print a top-level value */
60   {"", "", "", ""},             /* Binary format info */
61   {"0%lo", "0", "o", ""},       /* Octal format info */
62   {"%ld", "", "d", ""},         /* Decimal format info */
63   {"0x%lx", "0x", "x", ""},     /* Hex format info */
64   csharp_op_print_tab,          /* expression operators for printing */
65   0,                            /* not c-style arrays */
66   0,                            /* String lower bound */
67   &builtin_type_char,           /* Type of string elements */
68   LANG_MAGIC
69 };
70
71 void
72 _initialize_csharp_mono_language (void)
73 {
74   add_language (&csharp_mono_language_defn);
75 }
76