parse

Parse strings.

PARSE

NAME

parse - Parses strings.

SYNOPSIS

parse([error:t, state:0|1]data:"…", "data" ….)

DEFINITION

This function is used to do the syntactic analysis of the input, conforming to the rules of a grammar.

PARAMETERS

data
data to parse
state
0 for text, 1 for extenso default is 1

RETURN

string
Returns a string with the result of the parse.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{ parse("1+1"); }}. return res=2.
res={_{ parse("1+"); }}. return Syntax error in string
res={_{ parse(error:t,"1+"); t.errcode;}}. return res=18.
res={_{ parse(error:t,"1+1; a=2; a+5;", data:"3*4;", "7+8;"); t.errcode;}}. return res=2712150.

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.