Atitit.java expression fsm 表达式词法分析引擎 v2 qaa.docx

C:\0workspace\AtiPlatf_cms\src\com\attilax\fsm\JavaExpFsm.java

String code = "new(com.attilax.util.connReduceDync).set_resfile(uc_js.txt).joinNout() "

.trim();

Ver2 新特性

字符串单引号括起来的支持

字符串可以不要双引号括起来..方便的使用path等..

$code=new(com.attilax.user.AgentService).login(admin,admin)

[

"new",

"(",

"com.attilax.user.AgentService",

")",

".",

"login",

"(",

"admin",

"admin",

")"

]

作者::  ★(attilax)>>>   绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.cnb.net/attilax

package com.attilax.fsm;

import java.util.List;

import com.google.common.collect.Lists;

public class JavaExpFsm {

List<String> tokens = Lists.newLinkedList();

String curToken = "";

// String splitors = "(),\"";

String curStat = "ini";

private String code;

public char[] code_char_arr;

public JavaExpFsm(String code) {

this.code = code;

}

/**

* http://localhost/new(com.attilax.util.connReduceDync).set_resfile(uc_js.txt).joinNout()

* http://localhost/wrmiServlet?code=new(com.attilax.util.connReduceDync).set_resfile(uc_js.txt).joinNout()

* @param args

*/

public static void main(String[] args) {

String code = "new(com.attilax.util.connReduceDync).set_resfile(uc_js.txt).joinNout() "

.trim();

code= " new(com.attilax.agent.AgentRechargeService).getSubMemTotalsRecycleByAgentId(\"promoter:$pid$,fld2:v2\")";

List li = new JavaExpFsm(code).getTokens();

for (Object object : li) {

System.out.println(object);

}

System.out.println(li);

}

public List getTokens() {

code_char_arr = code.toCharArray();

for (char c : code_char_arr) {

// get next char,,then change stat

// jude cur char and cur stat...then if or not chage stat

if (c == '(' && !this.curStat.equals("strStart")) {    //&&  cur stta=ini

this.curStat = "brkStart";

tokens.add(this.curToken);

tokens.add("(");

this.curToken = "";

continue;

}

// if (c == '.' && this.curStat.equals("brkStart")) {

//

// curToken = curToken + String.valueOf(c);

// continue;

//

// // this.curStat.equals("brkEnd"))

//

// }

//

if (c == ')'  && !this.curStat.equals("strStart") ) {    //&& cur stat =brk start

this.curStat = "brkEnd";

if(this.curToken.length()>0)

tokens.add(this.curToken);

tokens.add(")");

this.curToken = "";

continue;

}

if (c == '.' && this.curStat.equals("brkEnd")) {

tokens.add(".");

curToken = "";

continue;

}

if(c=='\"' && this.curStat.equals("brkStart"))

{

this.curStat = "strStart";

// tokens.add(c);

this.curToken = "";

continue;

}

if(c=='\"' && this.curStat.equals("strStart"))

{

this.curStat = "strEnd";

tokens.add(this.curToken);

this.curToken = "";

continue;

}

if(c==',' && this.curStat.equals("brkStart"))

{

//this.curStat = "strEnd";

tokens.add(this.curToken);

this.curToken = "";

continue;

}

// if (this.curStat.equals("ini"))

curToken = curToken + String.valueOf(c);

}

return tokens;

}

}

Atiend

Atitit.java expression fsm 表达式词法分析引擎 v2 qaa.docx的更多相关文章

  1. Atitit.java expression fsm 表达式分词fsm引擎

    Atitit.java expression fsm 表达式分词fsm引擎 C:\0workspace\AtiPlatf_cms\src\com\attilax\fsm\JavaExpFsm.java ...

  2. Atitit s2018.5 s5 doc list on com pc.docx  v2

    Atitit s2018.5 s5  doc list on com pc.docx  Acc  112237553.docx Acc Acc  112237553.docx Acc baidu ne ...

  3. 2019t1_sumdoc_list.txt aa.docx acc baidu v2 sbb.docx Acc jindon v2 sbb.docx assetsList.html Atiitt 日本刑法典读后笔记.docx Atiti 遇到说花心的时候赞美应对.docx Atitit lesson.docx Atitit malye主义、mzd思想和dsp理论的区别和联系.docx Ati

    2019t1_sumdoc_list.txtaa.docxacc baidu v2 sbb.docxAcc jindon v2 sbb.docxassetsList.htmlAtiitt 日本刑法典读 ...

  4. Atitit s2018.6 s6 doc list on com pc.docx Atitit s2018.6 s6 doc list on com pc.docx  Aitit algo fix 算法系列补充.docx Atiitt 兼容性提示的艺术 attilax总结.docx Atitit 应用程序容器化总结 v2 s66.docx Atitit file cms api

    Atitit s2018.6 s6  doc list on com pc.docx Atitit s2018.6 s6  doc list on com pc.docx  Aitit algo fi ...

  5. Atitit s2018.5 s5 doc list on com pc.docx  Acc 112237553.docx Acc baidu netdisk.docx Acc csdn 18821766710 attilax main num.docx Atiitt put post 工具 开发工具dev tool test.docx Atiitt 腾讯图像分类相册管家.docx

    Atitit s2018.5 s5  doc list on com pc.docx  Acc  112237553.docx Acc baidu netdisk.docx Acc csdn 1882 ...

  6. Atitit s2018.2 s2 doc list on home ntpc.docx  \Atiitt uke制度体系 法律 法规 规章 条例 国王诏书.docx \Atiitt 手写文字识别 讯飞科大 语音云.docx \Atitit 代码托管与虚拟主机.docx \Atitit 企业文化 每日心灵 鸡汤 值班 发布.docx \Atitit 几大研发体系对比 Stage-Gat

    Atitit s2018.2 s2 doc list on home ntpc.docx \Atiitt uke制度体系  法律 法规 规章 条例 国王诏书.docx \Atiitt 手写文字识别   ...

  7. Atitit.java相比c#.net的优点 优缺点  v2 q330

    Atitit.java相比c#.net的优点 优缺点  v2 q330 1. 跨平台可在LINUX上,mac跑以外.主要如下: 1 2. IDE ECLIPSE(500m)是绿色的,换机器不用安装,C ...

  8. Atitit.java jna  调用c  c++ dll的原理与实践  总结  v2  q27

    Atitit.java jna  调用c  c++ dll的原理与实践  总结  v2  q27 1. Jna简单介绍1 2. Jna范例halo owrld1 3. Jna概念2 3.1. (1)需 ...

  9. atitit.java解析sql语言解析器解释器的实现

    atitit.java解析sql语言解析器解释器的实现 1. 解析sql的本质:实现一个4gl dsl编程语言的编译器 1 2. 解析sql的主要的流程,词法分析,而后进行语法分析,语义分析,构建sq ...

随机推荐

  1. Block循环引用问题研究

    自从苹果在objc中添加Block功能支持以后已经过了很久.目前网上对于Block的使用有很多介绍.不过对于Block的内存管理问题,则是众说纷纭.再加上objc开始使用ARC以后,对于Block的内 ...

  2. Win7 64位 VS2015及MinGW环境编译FFMPEG-20160326

    因为又要弄MinGW了,所以顺便把FFMPEG编译了,文章主要参考这篇,防抽所以复制一遍,顺便加些自己的内容 http://blog.csdn.net/finewind/article/details ...

  3. MATLAB 画出三个通信小区cell边界示意图

    d=1000; %两个小区中心间距离的一半 rcell=2*d/sqrt(3); %小区半径 ncell=3; %小区个数 cellposition=zeros(ncell,2); %初始化小区中心位 ...

  4. VM12安装OS X10.11步骤及说明

    参考文献: 1. http://www.crsay.com/network/enable-hardware-based-dep.html 2. http://jingyan.baidu.com/art ...

  5. [UCSD白板题] Compute the Edit Distance Between Two Strings

    Problem Introduction The edit distinct between two strings is the minimum number of insertions, dele ...

  6. GetRelevantAnimTimeRemainingFraction节点Bug

    初始设置: 动画状态机: MoveStop->Idle的条件: 使用该节点的目的: 在动画蓝图的过渡条件中使用该节点,保证上一个状态的动作完成后进入下一个动作.需求是MoveStop动作完成后才 ...

  7. css中关于position属性的探究(原创)

    关于position属性的设置,头脑中一直觉得不是很清楚,所以借助这次机会单独自己测试了一下,记作学习笔记.   首先,css的position属性包含下面四种设置情况: static:默认属性.指定 ...

  8. ubuntu网络配置&&ubuntu apt-get错误解决办法

    网络配置: 方式1:网卡通过DHCP自动获取IP地址 $ sudo gedit /etc/network/interfaces # 修改文件/etc/network/interfaces如下文 #-- ...

  9. d3 API axis

    场景 1.画网格线 使用方法.innerTickSize(): 指定内刻度大小 或者 .tickSize(inner, outer): 2.内外刻度线 innerTickSize outerTickS ...

  10. ABP框架详解(四)Feature

    ABP框架中存在一个Feature的特性,功能和设计思路非常类似于框架中的Authorization功能,都是来控制用户是否能够继续操作某项功能,不同点在于Authorization默认是应用在IAp ...