gambas-source-code/main/lib/eval/gb.eval.h
Benoît Minisini 31f0d78532 [DEVELOPMENT ENVIRONMENT]
* NEW: Theme configuration was redesigned and enhanced.
* NEW: New option for setting the tabstrip title font size.
* NEW: The file information dialog was redesigned again.
* NEW: Some option names were changed.
* NEW: A new "Project" virtual folder in the project treeview. It is 
  exactly like the "Data" folder, except that the files and directories 
  stored inside are not included in the generated executable.
* NEW: As keywords are now displayed in lowercase by default, there is a 
  new option for displaying them in uppercase as before.
  
[INTERPRETER]
* NEW: Object.GetProperty() can return the value of a constant.
* NEW: Keywords are in lowercase by default, the first letter of the words 
  staying in uppercase.

[GB.EVAL]
* NEW: The Highlight.Analyze() method always return keywords in uppercase, 
  so that you can continue to easily do non case-sensitive comparisons.

[GB.QT]
* BUG: Changing the font of a TabStrip correctly refreshes its layout now.

[GB.QT.EXT]
* NEW: The Editor can force highlighted keywords to uppercase. It is only 
  done when drawing the keyword. The internal text is not changed.


git-svn-id: svn://localhost/gambas/trunk@1265 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-03-27 16:27:24 +00:00

115 lines
2.5 KiB
C

/***************************************************************************
gb.eval.h
The evaluator plug-in
(c) 2000-2007 Benoit Minisini <gambas@freesurf.fr>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/
#ifndef __GB_EVAL_H
#define __GB_EVAL_H
#include "gambas.h"
/*#define DEBUG*/
typedef
bool (*EVAL_FUNCTION)(const char *, int, GB_VARIANT *);
typedef
void *EVAL_EXPRESSION;
typedef
struct {
unsigned state : 4;
unsigned len : 12;
}
EVAL_COLOR;
typedef
EVAL_COLOR *EVAL_COLOR_ARRAY;
typedef
struct
{
char *str;
EVAL_COLOR *color;
int len;
int proc;
}
EVAL_ANALYZE;
#define EVAL_NORMAL 0
#define EVAL_USE_CONTEXT 1
enum {
EVAL_TYPE_END = 0,
EVAL_TYPE_NEWLINE = 1,
EVAL_TYPE_RESERVED = 2,
EVAL_TYPE_IDENTIFIER = 3,
EVAL_TYPE_NUMBER = 4,
EVAL_TYPE_STRING = 5,
EVAL_TYPE_TSTRING = 6,
EVAL_TYPE_PARAM = 7,
EVAL_TYPE_SUBR = 8,
EVAL_TYPE_CLASS = 9,
EVAL_TYPE_COMMENT = 10,
EVAL_TYPE_OPERATOR = 11,
EVAL_TYPE_DATATYPE = 12,
EVAL_TYPE_ERROR = 13
};
typedef
enum
{
HIGHLIGHT_BACKGROUND,
HIGHLIGHT_NORMAL,
HIGHLIGHT_KEYWORD,
HIGHLIGHT_SUBR,
HIGHLIGHT_OPERATOR,
HIGHLIGHT_SYMBOL,
HIGHLIGHT_NUMBER,
HIGHLIGHT_STRING,
HIGHLIGHT_COMMENT,
HIGHLIGHT_BREAKPOINT,
HIGHLIGHT_CURRENT,
HIGHLIGHT_DATATYPE,
HIGHLIGHT_SELECTION,
HIGHLIGHT_HIGHLIGHT,
HIGHLIGHT_LINE,
HIGHLIGHT_ERROR,
HIGHLIGHT_NUM_COLOR
}
HIGHLIGHT_COLOR;
typedef
struct {
int version;
void (*Analyze)(const char *src, int len, EVAL_ANALYZE *result, bool rewrite);
void (*New)(EVAL_EXPRESSION *expr, const char *src, int len);
bool (*Compile)(EVAL_EXPRESSION expr);
GB_VALUE *(*Run)(EVAL_EXPRESSION expr, EVAL_FUNCTION func);
void (*Free)(EVAL_EXPRESSION *expr);
}
EVAL_INTERFACE;
#define EVAL_INTERFACE_VERSION 2
#endif