Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing expressions defined by end users
Message
From
28/04/2016 15:58:23
 
 
To
28/04/2016 14:02:30
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01635536
Message ID:
01635581
Views:
60
>>>>The purpose of the process I'm looking for is to limit the access to potentially dangerous objects and functions. So, I think that a simple de-tokenization that can identify authorized functions, and constants in the supported data types, will do. The evaluation will be left to the VFP parser (with proper error handler).
>>>
>>>I have no idea what you you mean with de-tokenization here :(
>>
>>If I'm not mistaken, he's basically saying that once you've parsed the input string into a sequence of tokens, you can perform a lexical analysis by traversing the parse tree to identify the identifier and check them against a list of what you want to allow or prohibit.
>
>Then I do not understand the whole thread. If it's parsed most of the work is done?

The de-tokenization is just to make sure nothing dangerous is used in the expression. For instance, to make sure there is no EXECSCRIPT() :-)

As long as there are no menaces in sight, VFP can EVALUATE() the expression safely and the result fetched.
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform