RT-Thread finsh源码分析: finsh_token.h

来源:互联网 发布:网络间接市场调研方法 编辑:程序博客网 时间:2024/06/06 01:52
/* *  token lex for finsh shell. * * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team * *  This file is part of RT-Thread (http://www.rt-thread.org) *  Maintainer: bernard.xiong <bernard.xiong at gmail.com> * *  All rights reserved. * *  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 2 of the License, 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., *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date           Author       Notes * 2010-03-22     Bernard      first version */#ifndef __FINSH_TOKEN_H__#define __FINSH_TOKEN_H__#include <finsh.h>//token类型定义enum finsh_token_type{    finsh_token_type_left_paren = 1,    /* (        */    finsh_token_type_right_paren ,      /* )        */    finsh_token_type_comma ,            /* ,        */    finsh_token_type_semicolon ,        /* ;        */    finsh_token_type_mul ,              /* *        */    finsh_token_type_add ,              /* +        */    finsh_token_type_inc ,              /* ++       */    finsh_token_type_sub ,              /* -        */    finsh_token_type_dec ,              /* --       */    finsh_token_type_div ,              /* /        */    finsh_token_type_mod ,              /* %        */    finsh_token_type_assign ,           /* =        */    finsh_token_type_and,               /* &        */    finsh_token_type_or,                /* |        */    finsh_token_type_xor,               /* ^        */    finsh_token_type_bitwise,           /* ~       */    finsh_token_type_shl,               /* <<       */    finsh_token_type_shr,               /* >>       */    finsh_token_type_comments,          /* //       */    /*-- data type --*/    finsh_token_type_void,              /* void     */    finsh_token_type_char,              /* char     */    finsh_token_type_short,             /* short    */    finsh_token_type_int,               /* int      */    finsh_token_type_long,              /* long     */    finsh_token_type_unsigned,          /* unsigned */    /* data value type */    finsh_token_type_value_char,        /* v:char   */    finsh_token_type_value_int,         /* v:int    */    finsh_token_type_value_long,        /* v:long   */    finsh_token_type_value_string,      /* v:string */    finsh_token_type_value_null,        /* NULL     */    /*-- others --*/    finsh_token_type_identifier,        /* ID       */    finsh_token_type_bad,               /* bad token */    finsh_token_type_eof};//获取当前操作位移#define finsh_token_position(self) (self)->position#define finsh_token_replay(self) (self)->replay = 1void finsh_token_init(struct finsh_token* self, u_char* script);enum finsh_token_type finsh_token_token(struct finsh_token* self);void finsh_token_get_token(struct finsh_token* self, u_char* token);#endif
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 婴幼儿受凉吐奶怎么办 宝宝肚子积食了怎么办 宝宝着凉发烧拉肚子怎么办 1岁拉稀水怎么办 新生儿婴儿呕奶怎么办 儿童肚子着凉拉肚子怎么办 七个月宝宝拉肚子怎么办 小孩大便果冻状怎么办 五个月婴儿拉稀怎么办 孩子老是着凉怎么办呢 五个月孩子拉肚子怎么办 肚子着凉了拉稀怎么办 小孩子着凉吐奶怎么办 儿童大便有粘液怎么办 宝宝拉鼻涕屎怎么办 婴儿拉白色粘液怎么办 宝宝不肯吃鱼肝油怎么办 婴儿不肯吃鱼肝油怎么办 宝宝吃鱼肝油吐怎么办 五个月婴儿夏天怎么办 厌奶期宝宝瘦了怎么办 二个月的宝宝不喝夜奶怎么办 婴儿不喝奶粉怎么办 小孩整天不吃饭怎么办 婴儿不吃不喝怎么办 断奶后不吃奶瓶怎么办 小孩早上不吃饭怎么办 新生儿不认乳头怎么办 宝宝不吸奶嘴怎么办 孩子不会吸奶瓶怎么办 宝宝突然不吃奶瓶怎么办 换了奶瓶不喝奶怎么办 新生儿不喝奶粉怎么办 7个月小婴儿磨牙怎么办 宝宝出生四天不喝母乳怎么办 我的奶水不足怎么办 乳牙长得不整齐怎么办 新生儿只吃奶粉怎么办 小孩不肯吸母乳怎么办 三个月宝宝不吃奶粉怎么办 宝宝不爱喝水怎么办 崔玉涛