2010-03-22 07:49:57 +08:00
|
|
|
/*
|
2021-03-08 18:19:04 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2010-03-22 07:49:57 +08:00
|
|
|
*
|
2018-10-14 19:28:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2010-03-22 07:49:57 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2010-03-22 Bernard first version
|
|
|
|
*/
|
2009-07-03 06:48:23 +08:00
|
|
|
#ifndef __FINSH_NODE_H__
|
|
|
|
#define __FINSH_NODE_H__
|
|
|
|
|
|
|
|
#include <finsh.h>
|
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_NODE_UNKNOWN 0
|
|
|
|
#define FINSH_NODE_ID 1
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_NODE_VALUE_CHAR 2
|
|
|
|
#define FINSH_NODE_VALUE_INT 3
|
|
|
|
#define FINSH_NODE_VALUE_LONG 4
|
|
|
|
#define FINSH_NODE_VALUE_STRING 5
|
|
|
|
#define FINSH_NODE_VALUE_NULL 6
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_NODE_SYS_ADD 7
|
|
|
|
#define FINSH_NODE_SYS_SUB 8
|
|
|
|
#define FINSH_NODE_SYS_MUL 9
|
|
|
|
#define FINSH_NODE_SYS_DIV 10
|
|
|
|
#define FINSH_NODE_SYS_MOD 11
|
|
|
|
#define FINSH_NODE_SYS_AND 12
|
|
|
|
#define FINSH_NODE_SYS_OR 13
|
|
|
|
#define FINSH_NODE_SYS_XOR 14
|
|
|
|
#define FINSH_NODE_SYS_BITWISE 15
|
|
|
|
#define FINSH_NODE_SYS_SHL 16
|
|
|
|
#define FINSH_NODE_SYS_SHR 17
|
|
|
|
#define FINSH_NODE_SYS_FUNC 18
|
|
|
|
#define FINSH_NODE_SYS_ASSIGN 19
|
|
|
|
#define FINSH_NODE_SYS_CAST 20
|
|
|
|
#define FINSH_NODE_SYS_PREINC 21
|
|
|
|
#define FINSH_NODE_SYS_PREDEC 22
|
|
|
|
#define FINSH_NODE_SYS_INC 23
|
|
|
|
#define FINSH_NODE_SYS_DEC 24
|
2009-07-03 06:48:23 +08:00
|
|
|
#define FINSH_NODE_SYS_GETVALUE 25
|
|
|
|
#define FINSH_NODE_SYS_GETADDR 26
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_NODE_SYS_NULL 27
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_DATA_TYPE_VOID 0x00
|
|
|
|
#define FINSH_DATA_TYPE_BYTE 0x01
|
|
|
|
#define FINSH_DATA_TYPE_WORD 0x02
|
|
|
|
#define FINSH_DATA_TYPE_DWORD 0x03
|
|
|
|
#define FINSH_DATA_TYPE_PTR 0x10
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define FINSH_NODE_VALUE 0
|
|
|
|
#define FINSH_NODE_ADDRESS 1
|
|
|
|
#define FINSH_NODE_FUNCTION 2
|
2009-07-03 06:48:23 +08:00
|
|
|
|
|
|
|
int finsh_node_init(void);
|
|
|
|
|
2017-10-10 14:27:34 +08:00
|
|
|
struct finsh_node* finsh_node_allocate(uint8_t type);
|
2009-07-03 06:48:23 +08:00
|
|
|
struct finsh_node* finsh_node_new_id(char* id);
|
|
|
|
struct finsh_node* finsh_node_new_char(char c);
|
|
|
|
struct finsh_node* finsh_node_new_int(int i);
|
|
|
|
struct finsh_node* finsh_node_new_long(long l);
|
|
|
|
struct finsh_node* finsh_node_new_string(char* s);
|
|
|
|
struct finsh_node* finsh_node_new_ptr(void* ptr);
|
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
#define finsh_node_sibling(node) ((node)->sibling)
|
|
|
|
#define finsh_node_child(node) ((node)->child)
|
2009-07-03 06:48:23 +08:00
|
|
|
|
|
|
|
#endif
|