Rename all C files in apps/interpreters/bas to begin with bas_ in order to avoid future name collisions in libapps.a
This commit is contained in:
parent
a76f057bc6
commit
4db4ea2bbd
@ -40,11 +40,11 @@ include $(APPDIR)/Make.defs
|
|||||||
# BAS Library
|
# BAS Library
|
||||||
|
|
||||||
ASRCS =
|
ASRCS =
|
||||||
CSRCS = auto.c bas.c fs.c global.c main.c program.c str.c token.c value.c
|
CSRCS = bas.c bas_auto.c bas_fs.c bas_global.c bas_main.c bas_program.c
|
||||||
CSRCS += var.c
|
CSRCS += bas_str.c bas_token.c bas_value.c bas_var.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_INTERPREPTER_BAS_VT100),y)
|
ifeq ($(CONFIG_INTERPREPTER_BAS_VT100),y)
|
||||||
CSRCS += vt100.c
|
CSRCS += bas_vt100.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEPPATH = --dep-path .
|
DEPPATH = --dep-path .
|
||||||
|
@ -79,14 +79,14 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "auto.h"
|
#include "bas_auto.h"
|
||||||
#include "bas.h"
|
#include "bas.h"
|
||||||
#include "error.h"
|
#include "bas_error.h"
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
#include "global.h"
|
#include "bas_global.h"
|
||||||
#include "program.h"
|
#include "bas_program.h"
|
||||||
#include "value.h"
|
#include "bas_value.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -2256,7 +2256,7 @@ static struct Value *dataread(struct Value *value, struct Value *l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct Value more_statements;
|
static struct Value more_statements;
|
||||||
#include "statement.c"
|
#include "bas_statement.c"
|
||||||
static struct Value *statements(struct Value *value)
|
static struct Value *statements(struct Value *value)
|
||||||
{
|
{
|
||||||
more:
|
more:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/fs.h
|
* apps/interpreters/bas/bas.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/auto.c
|
* apps/interpreters/bas/bas_auto.c
|
||||||
* BASIC file system interface.
|
* BASIC file system interface.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
@ -68,7 +68,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "auto.h"
|
#include "bas_auto.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/auto.h
|
* apps/interpreters/bas/bas_auto.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,15 +56,15 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_AUTO_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_AUTO_H
|
||||||
#define __APPS_EXAMPLES_BAS_AUTO_H
|
#define __APPS_EXAMPLES_BAS_BAS_AUTO_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "programtypes.h"
|
#include "bas_programtypes.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
@ -107,7 +107,7 @@ union AutoSlot
|
|||||||
struct Var var;
|
struct Var var;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "token.h"
|
#include "bas_token.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
@ -130,4 +130,4 @@ enum ValueType Auto_argType(const struct Auto *this, int l);
|
|||||||
enum ValueType Auto_varType(const struct Auto *this, struct Symbol *sym);
|
enum ValueType Auto_varType(const struct Auto *this, struct Symbol *sym);
|
||||||
void Auto_funcEnd(struct Auto *this);
|
void Auto_funcEnd(struct Auto *this);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_AUTO_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_AUTO_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/autotypes.h
|
* apps/interpreters/bas/bas_autotypes.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,22 +56,22 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* REVISIT: Why is this? If the following is __APPS_EXAMPLES_BAS_AUTOTYPES_H
|
/* REVISIT: Why is this? If the following is __APPS_EXAMPLES_BAS_BAS_AUTO_H
|
||||||
* then there are compile errors! Those compile errors occur because this
|
* then there are compile errors! Those compile errors occur because this
|
||||||
* function defines some of the same structures as does auto.h. BUT, the
|
* function defines some of the same structures as does bas_auto.h. BUT, the
|
||||||
* definitions ARE NOT THE SAME. What is up with this?
|
* definitions ARE NOT THE SAME. What is up with this?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_AUTO_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_AUTO_H
|
||||||
#define __APPS_EXAMPLES_BAS_AUTO_H
|
#define __APPS_EXAMPLES_BAS_BAS_AUTO_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "program.h"
|
#include "bas_program.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
#include "token.h"
|
#include "bas_token.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
@ -104,4 +104,4 @@ union AutoSlot
|
|||||||
struct Var var;
|
struct Var var;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_AUTO_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_AUTO_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/error.h
|
* apps/interpreters/bas/bas_error.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,8 +56,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_ERROR_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_ERROR_H
|
||||||
#define __APPS_EXAMPLES_BAS_ERROR_H
|
#define __APPS_EXAMPLES_BAS_BAS_ERROR_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -185,4 +185,4 @@
|
|||||||
#define OUTOFMEMORY RUNTIME+20,_("Out of memory")
|
#define OUTOFMEMORY RUNTIME+20,_("Out of memory")
|
||||||
#define RESTRICTED RUNTIME+21,_("Restricted")
|
#define RESTRICTED RUNTIME+21,_("Restricted")
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_ERROR_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_ERROR_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/fs.c
|
* apps/interpreters/bas/bas_fs.c
|
||||||
* BASIC file system interface.
|
* BASIC file system interface.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
@ -81,8 +81,8 @@
|
|||||||
#include <nuttx/ascii.h>
|
#include <nuttx/ascii.h>
|
||||||
#include <nuttx/vt100.h>
|
#include <nuttx/vt100.h>
|
||||||
|
|
||||||
#include "vt100.h"
|
#include "bas_vt100.h"
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/fs.h
|
* apps/interpreters/bas/bas_fs.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,15 +56,15 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_FS_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_FS_H
|
||||||
#define __APPS_EXAMPLES_BAS_FS_H
|
#define __APPS_EXAMPLES_BAS_BAS_FS_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "str.h"
|
#include "bas_str.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -195,4 +195,4 @@ int FS_memInput(int address);
|
|||||||
int FS_portOutput(int address, int value);
|
int FS_portOutput(int address, int value);
|
||||||
int FS_memOutput(int address, int value);
|
int FS_memOutput(int address, int value);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_FS_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_FS_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/global.c
|
* apps/interpreters/bas/bas_global.c
|
||||||
* Global variables and functions.
|
* Global variables and functions.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
@ -75,12 +75,12 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "auto.h"
|
#include "bas_auto.h"
|
||||||
#include "bas.h"
|
#include "bas.h"
|
||||||
#include "error.h"
|
#include "bas_error.h"
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
#include "global.h"
|
#include "bas_global.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/global.h
|
* apps/interpreters/bas/bas_global.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,16 +56,16 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_GLOBAL_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_GLOBAL_H
|
||||||
#define __APPS_EXAMPLES_BAS_GLOBAL_H
|
#define __APPS_EXAMPLES_BAS_BAS_GLOBAL_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "token.h"
|
#include "bas_token.h"
|
||||||
#include "value.h"
|
#include "bas_value.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -108,4 +108,4 @@ int Global_variable(struct Global *this, struct Identifier *ident,
|
|||||||
enum ValueType type, enum SymbolType symbolType,
|
enum ValueType type, enum SymbolType symbolType,
|
||||||
int redeclare);
|
int redeclare);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_GLOBAL_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_GLOBAL_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/main.c
|
* apps/interpreters/bas/bas_main.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -69,7 +69,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
#include "bas.h"
|
#include "bas.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/value.c
|
* apps/interpreters/bas/bas_program.c
|
||||||
* Program storage.
|
* Program storage.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
@ -69,10 +69,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "auto.h"
|
#include "bas_auto.h"
|
||||||
#include "error.h"
|
#include "bas_error.h"
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
#include "program.h"
|
#include "bas_program.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/program.h
|
* apps/interpreters/bas/bas_program.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,15 +56,15 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_PROGRAM_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_PROGRAM_H
|
||||||
#define __APPS_EXAMPLES_BAS_PROGRAM_H
|
#define __APPS_EXAMPLES_BAS_BAS_PROGRAM_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "programtypes.h"
|
#include "bas_programtypes.h"
|
||||||
#include "token.h"
|
#include "bas_token.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
@ -111,4 +111,4 @@ void Program_unnum(struct Program *this);
|
|||||||
int Program_setname(struct Program *this, const char *filename);
|
int Program_setname(struct Program *this, const char *filename);
|
||||||
void Program_xref(struct Program *this, int chn);
|
void Program_xref(struct Program *this, int chn);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_PROGRAM_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_PROGRAM_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/programtypes.h
|
* apps/interpreters/bas/bas_programtypes.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,14 +56,14 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_PROGRAMTYPES_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_PROGRAMTYPES_H
|
||||||
#define __APPS_EXAMPLES_BAS_PROGRAMTYPES_H
|
#define __APPS_EXAMPLES_BAS_BAS_PROGRAMTYPES_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "str.h"
|
#include "bas_str.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
@ -96,4 +96,4 @@ struct Program
|
|||||||
struct Scope *scope;
|
struct Scope *scope;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_PROGRAMTYPES_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_PROGRAMTYPES_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/var.c
|
* apps/interpreters/bas/bas_statement.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "statement.h"
|
#include "bas_statement.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/value.c
|
* apps/interpreters/bas/bas_str.c
|
||||||
* Dynamic strings.
|
* Dynamic strings.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
@ -71,7 +71,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "str.h"
|
#include "bas_str.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/str.h
|
* apps/interpreters/bas/bas_str.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,8 +56,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_STR_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_STR_H
|
||||||
#define __APPS_EXAMPLES_BAS_STR_H
|
#define __APPS_EXAMPLES_BAS_BAS_STR_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@ -112,4 +112,4 @@ void String_set(struct String *this, size_t pos, const struct String *s,
|
|||||||
struct StringField *StringField_new(struct StringField *this);
|
struct StringField *StringField_new(struct StringField *this);
|
||||||
void StringField_destroy(struct StringField *this);
|
void StringField_destroy(struct StringField *this);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_STR_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_STR_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/token.h
|
* apps/interpreters/bas/bas_token.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,16 +56,16 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_TOKEN_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_TOKEN_H
|
||||||
#define __APPS_EXAMPLES_BAS_TOKEN_H
|
#define __APPS_EXAMPLES_BAS_BAS_TOKEN_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "autotypes.h"
|
#include "bas_autotypes.h"
|
||||||
#include "value.h"
|
#include "bas_value.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -126,8 +126,8 @@ struct Symbol
|
|||||||
struct Symbol *next;
|
struct Symbol *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "program.h"
|
#include "bas_program.h"
|
||||||
#include "str.h"
|
#include "bas_str.h"
|
||||||
|
|
||||||
struct Identifier
|
struct Identifier
|
||||||
{
|
{
|
||||||
@ -543,4 +543,4 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto,
|
|||||||
struct String *s, int *indent, int full);
|
struct String *s, int *indent, int full);
|
||||||
void Token_init(int backslash_colon, int uppercase);
|
void Token_init(int backslash_colon, int uppercase);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_TOKEN_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_TOKEN_H */
|
@ -1,6 +1,5 @@
|
|||||||
/* Tokens and token sequence arrays. */
|
/* Tokens and token sequence arrays. */
|
||||||
%{
|
%{
|
||||||
/* #includes */ /*{{{C}}}*//*{{{*/
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -13,14 +12,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
#include "auto.h"
|
#include "bas_auto.h"
|
||||||
#include "token.h"
|
#include "bas_token.h"
|
||||||
#include "statement.h"
|
#include "bas_statement.h"
|
||||||
|
|
||||||
#ifdef DMALLOC
|
|
||||||
#include "dmalloc.h"
|
|
||||||
#endif
|
|
||||||
/*}}}*/
|
|
||||||
|
|
||||||
static int g_matchdata;
|
static int g_matchdata;
|
||||||
static int g_backslash_colon;
|
static int g_backslash_colon;
|
||||||
@ -28,7 +22,7 @@ static int g_uppercase;
|
|||||||
int yylex(void);
|
int yylex(void);
|
||||||
static struct Token *g_cur;
|
static struct Token *g_cur;
|
||||||
|
|
||||||
static void string(const char *text) /*{{{*/
|
static void string(const char *text)
|
||||||
{
|
{
|
||||||
if (g_cur)
|
if (g_cur)
|
||||||
{
|
{
|
||||||
@ -49,8 +43,8 @@ static void string(const char *text) /*{{{*/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
static void string2(void) /*{{{*/
|
static void string2(void)
|
||||||
{
|
{
|
||||||
if (g_cur)
|
if (g_cur)
|
||||||
{
|
{
|
||||||
@ -70,9 +64,9 @@ static void string2(void) /*{{{*/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
%}
|
%}
|
||||||
/* flex options and definitions */ /*{{{*/
|
/* flex options and definitions */
|
||||||
%option noyywrap
|
%option noyywrap
|
||||||
%option nounput
|
%option nounput
|
||||||
%x DATAINPUT ELSEIF IMAGEFMT
|
%x DATAINPUT ELSEIF IMAGEFMT
|
||||||
@ -99,9 +93,9 @@ ONERROR on[ \t]+error
|
|||||||
ONERROROFF on[ \t]+error[ \t]+off
|
ONERROROFF on[ \t]+error[ \t]+off
|
||||||
ONERRORGOTO0 on[ \t]+error[ \t]+goto[ \t]+0
|
ONERRORGOTO0 on[ \t]+error[ \t]+goto[ \t]+0
|
||||||
SELECTCASE select[ \t]+case
|
SELECTCASE select[ \t]+case
|
||||||
/*}}}*/
|
|
||||||
%%
|
%%
|
||||||
/* flex rules */ /*{{{*/
|
/* flex rules */
|
||||||
if (g_matchdata) BEGIN(DATAINPUT);
|
if (g_matchdata) BEGIN(DATAINPUT);
|
||||||
|
|
||||||
"#" return T_CHANNEL;
|
"#" return T_CHANNEL;
|
||||||
@ -1228,12 +1222,12 @@ end[ \t]+function {
|
|||||||
if (g_cur) g_cur->u.junk=yytext[0];
|
if (g_cur) g_cur->u.junk=yytext[0];
|
||||||
return T_JUNK;
|
return T_JUNK;
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
int g_token_property[T_LASTTOKEN];
|
int g_token_property[T_LASTTOKEN];
|
||||||
|
|
||||||
struct Token *Token_newCode(const char *ln) /*{{{*/
|
struct Token *Token_newCode(const char *ln)
|
||||||
{
|
{
|
||||||
int l,lasttok,thistok,addNumber=0,sawif;
|
int l,lasttok,thistok,addNumber=0,sawif;
|
||||||
struct Token *result;
|
struct Token *result;
|
||||||
@ -1241,7 +1235,7 @@ struct Token *Token_newCode(const char *ln) /*{{{*/
|
|||||||
|
|
||||||
g_cur=(struct Token*)0;
|
g_cur=(struct Token*)0;
|
||||||
buf=yy_scan_string(ln);
|
buf=yy_scan_string(ln);
|
||||||
/* determine number of tokens */ /*{{{*/
|
/* determine number of tokens */
|
||||||
g_matchdata=sawif=0;
|
g_matchdata=sawif=0;
|
||||||
for (lasttok=T_EOL,l=1; (thistok=yylex()); ++l)
|
for (lasttok=T_EOL,l=1; (thistok=yylex()); ++l)
|
||||||
{
|
{
|
||||||
@ -1253,7 +1247,7 @@ struct Token *Token_newCode(const char *ln) /*{{{*/
|
|||||||
lasttok=thistok;
|
lasttok=thistok;
|
||||||
}
|
}
|
||||||
if (l==1) { addNumber=1; ++l; }
|
if (l==1) { addNumber=1; ++l; }
|
||||||
/*}}}*/
|
|
||||||
yy_delete_buffer(buf);
|
yy_delete_buffer(buf);
|
||||||
g_cur=result=malloc(sizeof(struct Token)*l);
|
g_cur=result=malloc(sizeof(struct Token)*l);
|
||||||
if (addNumber)
|
if (addNumber)
|
||||||
@ -1295,8 +1289,8 @@ struct Token *Token_newCode(const char *ln) /*{{{*/
|
|||||||
yy_delete_buffer(buf);
|
yy_delete_buffer(buf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
struct Token *Token_newData(const char *ln) /*{{{*/
|
struct Token *Token_newData(const char *ln)
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
struct Token *result;
|
struct Token *result;
|
||||||
@ -1316,8 +1310,8 @@ struct Token *Token_newData(const char *ln) /*{{{*/
|
|||||||
yy_delete_buffer(buf);
|
yy_delete_buffer(buf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
void Token_destroy(struct Token *token) /*{{{*/
|
void Token_destroy(struct Token *token)
|
||||||
{
|
{
|
||||||
struct Token *r=token;
|
struct Token *r=token;
|
||||||
|
|
||||||
@ -1506,8 +1500,8 @@ void Token_destroy(struct Token *token) /*{{{*/
|
|||||||
} while ((r++)->type!=T_EOL);
|
} while ((r++)->type!=T_EOL);
|
||||||
free(token);
|
free(token);
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
struct String *Token_toString(struct Token *token, struct Token *spaceto, struct String *s, int *indent, int width) /*{{{*/
|
struct String *Token_toString(struct Token *token, struct Token *spaceto, struct String *s, int *indent, int width)
|
||||||
{
|
{
|
||||||
int ns=0,infn=0;
|
int ns=0,infn=0;
|
||||||
int thisindent=0,thisnotindent=0,nextindent=0;
|
int thisindent=0,thisnotindent=0,nextindent=0;
|
||||||
@ -1699,7 +1693,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
|||||||
/* T_ZONE */ {"zone",1},
|
/* T_ZONE */ {"zone",1},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* precompute indentation */ /*{{{*/
|
/* precompute indentation */
|
||||||
if (indent) thisindent=nextindent=*indent;
|
if (indent) thisindent=nextindent=*indent;
|
||||||
t=token;
|
t=token;
|
||||||
do
|
do
|
||||||
@ -1825,7 +1819,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
} while (t++->type!=T_EOL);
|
} while (t++->type!=T_EOL);
|
||||||
/*}}}*/
|
|
||||||
if (width>=0) /* whole line */
|
if (width>=0) /* whole line */
|
||||||
{
|
{
|
||||||
if (width) /* nicely formatted listing */
|
if (width) /* nicely formatted listing */
|
||||||
@ -1876,7 +1870,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
|||||||
}
|
}
|
||||||
case T_REM: String_appendPrintf(s,"%s%s",g_uppercase?"REM":"rem",token->u.rem); break;
|
case T_REM: String_appendPrintf(s,"%s%s",g_uppercase?"REM":"rem",token->u.rem); break;
|
||||||
case T_QUOTE: String_appendPrintf(s,"'%s",token->u.rem); break;
|
case T_QUOTE: String_appendPrintf(s,"'%s",token->u.rem); break;
|
||||||
case T_STRING: /*{{{*/
|
case T_STRING:
|
||||||
{
|
{
|
||||||
size_t l=token->u.string->length;
|
size_t l=token->u.string->length;
|
||||||
char *data=token->u.string->character;
|
char *data=token->u.string->character;
|
||||||
@ -1891,7 +1885,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
|||||||
String_appendPrintf(s,"\"");
|
String_appendPrintf(s,"\"");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (g_uppercase)
|
if (g_uppercase)
|
||||||
@ -1913,8 +1907,8 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
|||||||
if (spaceto && s->length>oldlength) memset(s->character+oldlength,' ',s->length-oldlength);
|
if (spaceto && s->length>oldlength) memset(s->character+oldlength,' ',s->length-oldlength);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
||||||
void Token_init(int b_c, int uc) /*{{{*/
|
void Token_init(int b_c, int uc)
|
||||||
{
|
{
|
||||||
#define PROPERTY(t,assoc,unary_priority,binary_priority,is_unary,is_binary) \
|
#define PROPERTY(t,assoc,unary_priority,binary_priority,is_unary,is_binary) \
|
||||||
g_token_property[t]=(assoc<<8)|(unary_priority<<5)|(binary_priority<<2)|(is_unary<<1)|is_binary
|
g_token_property[t]=(assoc<<8)|(unary_priority<<5)|(binary_priority<<2)|(is_unary<<1)|is_binary
|
||||||
@ -1941,4 +1935,4 @@ void Token_init(int b_c, int uc) /*{{{*/
|
|||||||
PROPERTY(T_EQV, 0,0,0,0,1);
|
PROPERTY(T_EQV, 0,0,0,0,1);
|
||||||
PROPERTY(T_IMP, 0,0,0,0,1);
|
PROPERTY(T_IMP, 0,0,0,0,1);
|
||||||
}
|
}
|
||||||
/*}}}*/
|
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/value.c
|
* apps/interpreters/bas/bas_value.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -73,8 +73,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "error.h"
|
#include "bas_error.h"
|
||||||
#include "value.h"
|
#include "bas_value.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/value.h
|
* apps/interpreters/bas/bas_value.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,14 +56,14 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_VALUE_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_VALUE_H
|
||||||
#define __APPS_EXAMPLES_BAS_VALUE_H
|
#define __APPS_EXAMPLES_BAS_BAS_VALUE_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "str.h"
|
#include "bas_str.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -179,4 +179,4 @@ struct Value *Value_toStringUsing(struct Value *this, struct String *s,
|
|||||||
struct String *Value_toWrite(struct Value *this, struct String *s);
|
struct String *Value_toWrite(struct Value *this, struct String *s);
|
||||||
struct Value *Value_nullValue(enum ValueType type);
|
struct Value *Value_nullValue(enum ValueType type);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_VALUE_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_VALUE_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/var.c
|
* apps/interpreters/bas/bas_var.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -66,8 +66,8 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "error.h"
|
#include "bas_error.h"
|
||||||
#include "var.h"
|
#include "bas_var.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/var.h
|
* apps/interpreters/bas/bas_var.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014 Michael Haardt
|
* Copyright (c) 1999-2014 Michael Haardt
|
||||||
*
|
*
|
||||||
@ -56,14 +56,14 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_EXAMPLES_BAS_VAR_H
|
#ifndef __APPS_EXAMPLES_BAS_BAS_VAR_H
|
||||||
#define __APPS_EXAMPLES_BAS_VAR_H
|
#define __APPS_EXAMPLES_BAS_BAS_VAR_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "value.h"
|
#include "bas_value.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -112,4 +112,4 @@ struct Value *Var_mat_redim(struct Var *this, unsigned int dim,
|
|||||||
const unsigned int *geometry,
|
const unsigned int *geometry,
|
||||||
struct Value *err);
|
struct Value *err);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_VAR_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_VAR_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/vt100.c
|
* apps/interpreters/bas/bas_vt100.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -44,7 +44,8 @@
|
|||||||
|
|
||||||
#include <nuttx/vt100.h>
|
#include <nuttx/vt100.h>
|
||||||
|
|
||||||
#include "fs.h"
|
#include "bas_fs.h"
|
||||||
|
#include "bas_vt100.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/interpreters/bas/vt100.h
|
* apps/interpreters/bas/bas_vt100.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __APPS_INTERPRETERS_BAS_VT100_H
|
#ifndef __APPS_INTERPRETERS_BAS_BAS_VT100_H
|
||||||
#define __APPS_INTERPRETERS_BAS_VT100_H
|
#define __APPS_INTERPRETERS_BAS_BAS_VT100_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@ -232,4 +232,4 @@ void vt100_background_color(int chn, uint8_t color);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __APPS_INTERPRETERS_BAS_VT100_H */
|
#endif /* __APPS_INTERPRETERS_BAS_BAS_VT100_H */
|
Loading…
x
Reference in New Issue
Block a user