亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? parser.c

?? 機器人足球AI設計比賽
?? C
?? 第 1 頁 / 共 3 頁
字號:
/** SFSEXP: Small, Fast S-Expression Library version 1.0Written by Matthew Sottile (matt@lanl.gov)Copyright (2004). The Regents of the University of California. This materialwas produced under U.S. Government contract W-7405-ENG-36 for Los AlamosNational Laboratory, which is operated by the University of California forthe U.S. Department of Energy. The U.S. Government has rights to use,reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR THEUNIVERSITY MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITYFOR THE USE OF THIS SOFTWARE. If software is modified to produce derivativeworks, such modified software should be clearly marked, so as not to confuseit with the version available from LANL.Additionally, this program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or (at youroption) any later version. Accordingly, this program is distributed in thehope that it will be useful, but WITHOUT ANY WARRANTY; without even theimplied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Seethe GNU General Public License for more details.LA-CC-04-094**/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include "sexp.h"#include "faststack.h"/* * constants related to atom buffer sizes and growth. */static size_t sexp_val_start_size = 256;static size_t sexp_val_grow_size  = 64;/* * Function for tuning growth parameters. */void set_parser_buffer_params(size_t ss, size_t gs) {  if (ss > 0)    sexp_val_start_size = ss;  else     fprintf(stderr,"%s: Cannot set buffer start size to value<1.\n",__FILE__);  if (gs > 0)    sexp_val_grow_size = gs;  else    fprintf(stderr,"%s: Cannot set buffer grow size to value<1.\n",__FILE__);}/** * this structure is pushed onto the stack so we can keep track of the * first and last elements in a list. * !!!!DON'T USE THESE OUTSIDE THIS FILE!!!! */typedef struct parse_stack_data{  sexp_t *fst, *lst;}parse_data_t;/** * parse_data_t stack - similar malloc prevention to sexp_t_cache. */faststack_t *pd_cache;/**  * The global <I>sexp_t_cache</I> is a faststack implementing a cache of * pre-alloced s-expression element entities.  Odds are a user should never  * touch this.  If you do, you're on your own.  This is used internally by  * the parser and related code to store unused but allocated sexp_t elements. * This should be left alone and manipulated only by the sexp_t_allocate and * sexp_t_deallocate functions.  Touching the stack is bad.   */ faststack_t *sexp_t_cache;/** * sexp_t allocation */#ifdef _NO_MEMORY_MANAGEMENT_sexp_t *sexp_t_allocate(void) {  sexp_t *sx = (sexp_t *) sexp_calloc(1, sizeof(sexp_t));  assert(sx != NULL);  return(sx);}#elsesexp_t *sexp_t_allocate(void) {  sexp_t *sx;  stack_lvl_t *l;  if (sexp_t_cache == NULL) {    sexp_t_cache = make_stack();    sx = (sexp_t *)sexp_malloc(sizeof(sexp_t));    assert(sx != NULL);    sx->next = sx->list = NULL;  } else {    if (empty_stack(sexp_t_cache)) {      sx = (sexp_t *)sexp_malloc(sizeof(sexp_t));      assert(sx != NULL);      sx->next = sx->list = NULL;    } else {      l = pop(sexp_t_cache);      sx = (sexp_t *)l->data;    }  }  return sx;}#endif/** * sexp_t de-allocation */#ifdef _NO_MEMORY_MANAGEMENT_voidsexp_t_deallocate(sexp_t *s) {  if (s->ty == SEXP_VALUE && s->val != NULL) {    sexp_free(s->val,s->val_allocated);  }  sexp_free(s,sizeof(sexp_t));}#elsevoidsexp_t_deallocate(sexp_t *s) {  if (sexp_t_cache == NULL) sexp_t_cache = make_stack();  if (s == NULL) return;  s->list = s->next = NULL;  if (s->ty == SEXP_VALUE && s->val != NULL) {    sexp_free(s->val,s->val_allocated);  }  s->val = NULL;  sexp_t_cache = push(sexp_t_cache, s);}#endif/** * cleanup the sexp library.  Note this is implemented HERE since we need * to know about pd_cache, which is local to this file. */#ifdef _NO_MEMORY_MANAGEMENT_void sexp_cleanup(void) {}#elsevoid sexp_cleanup(void) {  stack_lvl_t *l;  if (pd_cache != NULL) {    l = pd_cache->top;    while (l != NULL) {      sexp_free(l->data,sizeof(sexp_t));      l = l->below;    }    destroy_stack(pd_cache);    pd_cache = NULL;  }  if (sexp_t_cache != NULL) {    l = sexp_t_cache->top;    while (l != NULL) {      sexp_free(l->data,sizeof(sexp_t));      l = l->below;    }    destroy_stack(sexp_t_cache);    sexp_t_cache = NULL;  }}#endif/** * allocation */parse_data_t *pd_allocate(void) {  parse_data_t *p;  stack_lvl_t *l;  if (pd_cache == NULL) {    pd_cache = make_stack();    p = (parse_data_t *)sexp_malloc(sizeof(parse_data_t));    assert(p!=NULL);  } else {    if (empty_stack(pd_cache)) {      p = (parse_data_t *)sexp_malloc(sizeof(parse_data_t));      assert(p!=NULL);    } else {      l = pop(pd_cache);      p = (parse_data_t *)l->data;    }  }  return p;}/** * de-allocation */voidpd_deallocate(parse_data_t *p) {  if (pd_cache == NULL) pd_cache = make_stack();  pd_cache = push(pd_cache, p);}/** * Destroy a continuation by freeing all of its fields that it is responsible * for managing, and then free the continuation itself.  This includes internal * buffers, stacks, etc.. */voiddestroy_continuation (pcont_t * pc){  stack_lvl_t *lvl;  parse_data_t *lvl_data;  if (pc == NULL) return; /* return if null passed in */  if (pc->stack != NULL) {    lvl = pc->stack->top;        /*     * note that destroy_stack() does not free the data hanging off of the     * stack.  we have to walk down the stack and do that here.      */        while (lvl != NULL) {      lvl_data = (parse_data_t *)lvl->data;      /**       * Seems to have fixed bug with destroying partially parsed       * expression continuations with the short three lines below.       */      if (lvl_data != NULL) {        lvl_data->lst = NULL;        destroy_sexp(lvl_data->fst);        lvl_data->fst = NULL;        pd_deallocate(lvl_data);        lvl->data = lvl_data = NULL;      }      lvl = lvl->below;    }        /*     * stack has no data on it anymore, so we can free it.     */    destroy_stack(pc->stack);    pc->stack = NULL;  }  /*   * free up data used for INLINE_BINARY mode   */  if (pc->bindata != NULL) {    sexp_free(pc->bindata,pc->binexpected);    pc->bindata = NULL;  }  /*   * free up other allocated data   */  sexp_free (pc->val,pc->val_allocated);  sexp_free (pc,sizeof(pcont_t));}/*  * wrapper around cparse_sexp.  assumes s contains a single, complete, * null terminated s-expression.  partial sexps or strings containing more * than one will act up. */sexp_t *parse_sexp (char *s, size_t len){  pcont_t *pc = NULL;  sexp_t *sx = NULL;  if (len < 1 || s == NULL) return NULL; /* empty string - return */    pc = cparse_sexp (s, len, pc);  sx = pc->last_sexp;  destroy_continuation(pc);  return sx;}pcont_t *init_continuation(char *str) {  pcont_t *cc;  /* new continuation... */  cc = (pcont_t *)sexp_malloc(sizeof(pcont_t));  assert(cc != NULL);    /* allocate atom buffer */  cc->val = (char *)sexp_malloc(sizeof(char)*sexp_val_start_size);  assert(cc->val != NULL);    /* by default we assume a normal parser */  cc->mode = PARSER_NORMAL;  cc->val_allocated = sexp_val_start_size;  cc->val_used = 0;  cc->bindata = NULL;  cc->binread = cc->binexpected = 0;  /* allocate stack */  cc->esc = 0;  cc->stack = make_stack();  cc->sbuffer = str;  cc->lastPos = NULL;  cc->state = 1;  cc->vcur = cc->val;  cc->depth = 0;  cc->qdepth = 0;  cc->squoted = 0;  return cc;}/** * Iterative parser.  Wrapper around parse_sexp that is slightly more * intelligent and allows users to iteratively "pop" the expressions * out of a string that contains a bunch of expressions. * Useful if you have a string like "(foo bar)(goo har)(moo mar)" and * want to get "(foo bar)", "(goo har)", and "(moo mar)" individually on * repeated calls. */sexp_t *iparse_sexp (char *s, size_t len, pcont_t *cc) {  pcont_t *pc;  sexp_t *sx = NULL;    /*    * sanity check.   */  if (cc == NULL) {    fprintf(stderr,"iparse_sexp called with null continuation!\n");    return NULL;  }    /* call the parser */  pc = cparse_sexp(s,len,cc);    if (cc->last_sexp != NULL) {    sx = cc->last_sexp;    cc->last_sexp = NULL;  }    return sx;}/*************************************************************************//*************************************************************************//*************************************************************************//*************************************************************************//*************************************************************************//** * Continuation based parser - the guts of the package. */pcont_t *cparse_sexp (char *str, size_t len, pcont_t *lc){  char *t, *s;  register size_t       binexpected = 0;  register size_t       binread = 0;   register unsigned int mode = PARSER_NORMAL;  register size_t       val_allocated = 0;  register unsigned int squoted = 0;  register size_t       val_used = 0;  register unsigned int state = 1;  register unsigned int depth = 0;  register unsigned int qdepth = 0;  register unsigned int elts = 0;  register unsigned int esc = 0;  pcont_t *cc;  char *val, *vcur, *bindata = NULL;  sexp_t *sx = NULL;  faststack_t *stack;  parse_data_t *data;  stack_lvl_t *lvl;#ifdef _DEBUG_  unsigned long fsm_iterations = 0;  unsigned long maxdepth = 0;#endif /* _DEBUG_ */  char *bufEnd;  int keepgoing = 1;  /* make sure non-null string */  if (str == NULL) {    fprintf(stderr,"cparse_sexp: called with null string.\n");    return lc;  }    /* first, if we have a non null continuation passed in, restore state. */  if (lc != NULL) {    cc = lc;    binexpected = cc->binexpected;    binread = cc->binread;    bindata = cc->bindata;    val_used = cc->val_used;    val_allocated = cc->val_allocated;    squoted = cc->squoted;    val = cc->val;    vcur = cc->vcur;    state = cc->state;    depth = cc->depth;    qdepth = cc->qdepth;    stack = cc->stack;    esc = cc->esc;    mode = cc->mode;    s = str;    if (cc->lastPos != NULL)      t = cc->lastPos;    else {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久88色综合天天免费| 欧洲一区二区三区免费视频| 一本一道综合狠狠老| 91精品国产综合久久福利| 国产精品素人一区二区| 奇米色777欧美一区二区| 97精品超碰一区二区三区| 精品国产乱码久久久久久影片| 亚洲欧美日韩国产综合在线| 精品一区二区在线免费观看| 91精品办公室少妇高潮对白| 国产精品色哟哟| 精品一区二区免费看| 欧美日韩国产中文| 国产精品久久久一本精品| 久久精品72免费观看| 欧美喷水一区二区| 亚洲激情在线激情| 91免费视频观看| 亚洲国产精品传媒在线观看| 国产一区二区在线观看视频| 91麻豆精品国产自产在线| 有码一区二区三区| 一本久久综合亚洲鲁鲁五月天| 国产午夜精品在线观看| 国产综合色产在线精品| 欧美电影免费观看高清完整版在 | 国产精品国产馆在线真实露脸 | 91亚洲午夜精品久久久久久| 国产日韩欧美a| 国产馆精品极品| 国产清纯白嫩初高生在线观看91| 久久99精品国产.久久久久 | 67194成人在线观看| 日韩精品久久理论片| 欧美久久免费观看| 三级久久三级久久久| 337p亚洲精品色噜噜狠狠| 日本视频免费一区| 欧美成人a视频| 国产精品自拍三区| 欧美高清一级片在线观看| 成人精品高清在线| 亚洲女同女同女同女同女同69| 色综合天天综合网天天狠天天| 亚洲欧美另类久久久精品2019| 91在线观看免费视频| 亚洲精品ww久久久久久p站| 欧美系列日韩一区| 日韩福利电影在线| 久久精品亚洲一区二区三区浴池| 国产精品77777竹菊影视小说| 国产精品久久网站| 欧洲视频一区二区| 男女男精品视频| 久久久不卡网国产精品二区| 懂色av中文字幕一区二区三区| 国产精品国产馆在线真实露脸| 欧洲中文字幕精品| 另类小说欧美激情| 国产精品福利一区二区三区| 欧美三区在线观看| 久久精品国产久精国产| 国产精品的网站| 欧美精品一二三| 国产美女一区二区| 亚洲尤物在线视频观看| 欧美精品一区二区三区蜜桃视频| aaa亚洲精品| 免费高清不卡av| 一区在线播放视频| 欧美一区二区三区在| www.欧美色图| 久久国产精品无码网站| 成人免费在线视频观看| 欧美一区二区三区四区在线观看| 久草精品在线观看| 亚洲午夜日本在线观看| 国产午夜精品久久久久久久| 欧美日韩午夜在线视频| 岛国精品在线观看| 青青青伊人色综合久久| 亚洲三级在线看| 久久亚洲一区二区三区四区| 欧美日韩亚洲综合在线| 成人h动漫精品一区二区| 免费欧美高清视频| 亚洲一区二区在线播放相泽| 国产欧美日韩不卡免费| 欧美一级黄色大片| 欧美日韩免费不卡视频一区二区三区| 国产精品亚洲成人| 毛片基地黄久久久久久天堂| 亚洲美女精品一区| 中国av一区二区三区| 精品国产免费视频| 在线成人免费视频| 日本乱人伦一区| 不卡一卡二卡三乱码免费网站| 国产在线看一区| 美腿丝袜在线亚洲一区| 午夜国产精品一区| 亚洲综合男人的天堂| 亚洲欧美日韩国产手机在线| 日本一区二区三区免费乱视频| 精品久久人人做人人爱| 日韩欧美一二三四区| 欧美乱妇23p| 91精品国产综合久久久久久| 欧美性受xxxx| 精品视频一区 二区 三区| 色综合色狠狠天天综合色| www.日韩大片| 一本一本久久a久久精品综合麻豆| 成人动漫一区二区在线| 高潮精品一区videoshd| 国产suv一区二区三区88区| 国产精品一区久久久久| 国产精品69久久久久水密桃| 国产传媒欧美日韩成人| 成人小视频在线| av在线一区二区| 在线欧美小视频| 欧美日韩国产片| 日韩一区二区三区免费观看| 日韩欧美高清在线| 久久五月婷婷丁香社区| 久久精品亚洲国产奇米99| 国产精品乱人伦一区二区| 国产精品第四页| 亚洲国产精品一区二区久久| 首页亚洲欧美制服丝腿| 精品一区二区三区欧美| 国产精品一区二区在线观看网站 | 欧美亚洲国产怡红院影院| 在线不卡中文字幕| 久久久综合网站| **性色生活片久久毛片| 亚洲小说欧美激情另类| 麻豆精品久久精品色综合| 国内精品久久久久影院色| av电影在线观看一区| 欧美在线|欧美| 26uuu精品一区二区在线观看| 国产精品毛片高清在线完整版| 伊人开心综合网| 美女视频网站黄色亚洲| yourporn久久国产精品| 欧美丝袜丝交足nylons图片| 精品国产乱码久久久久久久| **性色生活片久久毛片| 肉色丝袜一区二区| 国产91在线观看丝袜| 欧美日韩精品系列| 欧美国产一区二区| 五月激情六月综合| 波多野结衣91| 日韩久久久久久| 亚洲免费av高清| 国产精品资源站在线| 欧美中文字幕一二三区视频| 久久欧美中文字幕| 亚洲国产一区二区a毛片| 国产精品小仙女| 日韩欧美一区二区不卡| 亚洲欧洲99久久| 精品一区二区在线观看| 欧美日韩大陆一区二区| 国产精品久久久久永久免费观看 | 免费精品视频在线| 91精品福利在线| 国产精品欧美一区二区三区| 麻豆91精品视频| 欧美亚洲高清一区| 亚洲欧美一区二区久久| 国产成人午夜高潮毛片| 日韩美女一区二区三区四区| 亚洲成a人片综合在线| 99久久亚洲一区二区三区青草 | 日韩一区二区视频在线观看| 一区二区在线观看视频在线观看| 成人综合在线观看| 2020国产成人综合网| 日本免费在线视频不卡一不卡二| 在线中文字幕一区| 亚洲免费毛片网站| 91免费视频网| 国产亚洲精品aa午夜观看| 免费看欧美美女黄的网站| 色噜噜偷拍精品综合在线| 中文字幕欧美激情| 国产乱人伦偷精品视频免下载| 精品久久久久久最新网址| 亚洲一区在线视频| av亚洲精华国产精华精| 成人欧美一区二区三区白人| 国产麻豆精品theporn| 日韩欧美国产三级| 一区二区三区资源| 成人av网站在线|