View a markdown version of this page

Expressions - Amazon Lex

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Expressions

표현식 문자열을 추가하여 Amazon Lex V2에서 함수를 수행할 수 있습니다. 이 표에는 SRGS 표현식에 사용할 수 있는 구문과 예제가 적혀 있습니다.

표현식 유형 구문 예제 지원 여부
정규식 리터럴 유효한 정규식 특수 문자를 포함하는 문자열 리터럴
"^\d\.$"
아니요
함수 function functionName(parameters) { functionBody}
var x = function calc() { return 10; }
아니요
Delete delete expression
delete obj.property;
아니요
Void void expression
void (2 == '2');
아니요
Typeof typeof expression
typeof 42;
아니요
Member index expression [ expressions ]
var fruits = ["apple"]; fruits[0];
예
Member dot expression . identifier
out.value
yes
인수 expression (arguments)
new Date('1994-10-11')
예
Post increment expression++
var x=10; x++;
예
Post decrement expression--
var x=10; x--;
예
Pre increment ++expression
var x=10; ++x;
예
Pre decrement --expression
var x=10; --x;
예
Unary plus / Unary minus +expression / -expression
+x / -x;
예
Bit not ~ expression
const a = 5; console.log( ~a );
예
Logical not ! expression
!(a > 0 || b > 0)
예
Multiplicative expression ('*' | '/' | '%') expression
(x + y) * (a / b)
예
Additive expression ('+' | '-') expression
(a + b) - (a - (a + b))
예
Bit shift expression ('<<' | '>>' | '>>>') expression
(a >> b) >>> c
예
Relative expression ('<' | '>' | '<=' | '>=') expression
if (a > b) { ... }
예
있음 expression in expression
fruits[0] in otherFruits;
예
Equality expression ('==' | '!=' | '===' | '!===') expression
if (a == b) { ... }
예
Bit and / xor / or expression ('&' | '^' | '|') expression
a & b / a ^ b / a | b
예
Logical and / or expression ('&&' | '||') expression
if (a && (b ||c)) { ...}
예
3진 expression ? expression : expression
a > b ? obj.prop : 0
예
대입 expression = expression
out.value = "string";
예
Assignment operator expression ('*=' | '/=' | '+=' | '-=' | '%=') expression
a *= 10;
예
Assignment bitwise operator expression ('<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|=') expression
a <<= 10;
예
식별자 identifierSequence 여기서 identifierSequence는 유효한 문자의 시퀀스임
fruits=[10, 20, 30];
예
Null literal null
x = null;
예
Boolean literal true | false
x = true;
예
String literal 'string' / "string"
a = 'hello', b = "world";
예
Decimal literal integer [.] digits [exponent]
111.11 e+12
예
Hex literal 0 (x | X)[0-9a-fA-F]
0x123ABC
예
Octal literal O [0-7]
"O51"
예
Array literal [ expression, ... ]
v = [a, b, c];
예
Object literal {property: value, ...}
out = {value: 1, flag: false};
예
Parenthesized ( expressions )
x + (x + y)
예