antlr

6/6

like_concat

:{functionMap.containsKey(input.LT(1).getText().toUpperCase())}? ID (LPAREN concat_func? RPAREN)->^(ID concat_func?)

|value

;

likeCondition

:'NOT''LIKE' like_concat->^(NOT_LIKE like_concat)

|'LIKE' like_concat->^(LIKE like_concat)

;

concat_func

:myvalue ( COMMA! myvalue )*

;

myvalue

:'\'' '%' '\''

|quoted_string ->^(QUTED_STR quoted_string)

|'?'

;


package com.taobao.tddl.sqlobjecttree.common.value.function;

import com.taobao.tddl.sqlobjecttree.common.value.OperationBeforTwoArgsFunction;

public class ConCat extends OperationBeforTwoArgsFunction{

public String getFuncName() {

return "concat";

}

}


6/5


like_concat

:myvalue ( '||'^ myvalue )*

;

myvalue

//:'\'''%''\''

:QUOTED_STRING

|'?'

;

likeCondition

:'NOT''LIKE' like_concat->^(NOT_LIKE like_concat)

|'LIKE' like_concat->^(LIKE like_concat)

;

你可能感兴趣的:(antlr)