[Equest-users] Parsing Error: Expression too long to be parsed.
Nicholas Caton
Nicholas.Caton at schneider-electric.com
Wed Nov 15 09:33:40 PST 2017
For everyone's benefit, I was further informed by JJH that every linefeed and carriage return counts as a character, thus the "every line counts as 2 characters" from the reference manual.
There is however normally one of each for every line, except for the last line which only has a line feed.
So technically, the check for expression length is:
C + L*2 - 1 <= 4096
where
C = # of characters (including whitespaces), and
L = number of lines in your text editor
Nailed that one to the wall!
I'm going to retract my 2nd query regarding #L vs. #LR as a non-issue, as I think this truly was an expression length problem that I accidentally hid from myself in troubleshooting the expression with a separate model.
Thanks everyone,
~Nick
[cid:image001.png at 01D35E04.D225D050]
Nick Caton, P.E., BEMP
Senior Energy Engineer
Regional Energy Engineering Manager
Energy and Sustainability Services
Schneider Electric
D 913.564.6361
M 785.410.3317
F 913.564.6380
E nicholas.caton at schneider-electric.com<mailto:nicholas.caton at schneider-electric.com>
15200 Santa Fe Trail Drive
Suite 204
Lenexa, KS 66219
United States
[cid:image002.png at 01D35E04.D225D050]
From: Bishop, Bill [mailto:bbishop at pathfinder-ea.com]
Sent: Tuesday, November 14, 2017 1:22 PM
To: Nicholas Caton <Nicholas.Caton at schneider-electric.com>; equest-users at onebuilding.org
Subject: RE: Parsing Error: Expression too long to be parsed.
Hi Nick,
>From the DOE-2 help file for Keyword Expressions, "The length of an expression cannot exceed 4096 characters (new line counts as two characters.)".
It is not too hard to exceed this limit for long expressions. I'm wondering if your original expression exceeded it and your revised did not, so that it has nothing to do with the #L vs. #LR issue you mention.
Regards,
~Bill
William Bishop, PE, BEMP, BEAP, CEM, LEED AP | Pathfinder Engineers & Architects LLP
Senior Energy Engineer
[cid:image010.jpg at 01D35E05.8DE3A470] [cid:image011.jpg at 01D35E05.8DE3A470]
134 South Fitzhugh Street Rochester, NY 14608
T: (585) 698-1956 F: (585) 325-6005
bbishop at pathfinder-ea.com<mailto:wbishop at pathfinder-ea.com> www.pathfinder-ea.com<http://www.pathfinder-ea.com/>
[http://png-5.findicons.com/files/icons/977/rrze/720/globe.png]Carbon Fee and Dividend - simple, effective, and market-based.
From: Equest-users [mailto:equest-users-bounces at lists.onebuilding.org] On Behalf Of Nicholas Caton via Equest-users
Sent: Tuesday, November 14, 2017 1:00 PM
To: equest-users at onebuilding.org<mailto:equest-users at onebuilding.org>
Subject: [Equest-users] Parsing Error: Expression too long to be parsed.
Hi Friends,
I have encountered an expression evaluation error that would seem pretty self-explanatory on the surface:
[cid:image009.png at 01D35E04.D225D050]
After a couple passes to do the logical thing and reduce the line count and character count in the expression (trimming whitespace, removing annotations), I realized a mistake where I used #L instead of #LR for a reference to C-ACTIVITY-DESC.
Trimmed Example - the highlighted characters should read #LR:
switch(#SV(#PS()))
case 1 : 38800.32*#L("SPACE","AREA")/10260.77 $Exh*Area/Total Unit Area
case 2 : 27584.18*#L("SPACE","AREA")/7294.65 $Exh*Area/Total Unit Area
case 3 : 33622.74*#L("SPACE","AREA")/8891.55 $Exh*Area/Total Unit Area
case 4 : 12621.09*#L("SPACE","AREA")/3337.66 $Exh*Area/Total Unit Area
case 5 : 8551.12*#L("SPACE","AREA")/2901.15 $Exh*Area/Total Unit Area
case 7 : 18717.66*#L("SPACE","AREA")/6350.37 $Exh*Area/Total Unit Area
case 8 : 8066.63*#L("SPACE","AREA")/2899.83 $Exh*Area/Total Unit Area
case 10 : 24826.83*#L("SPACE","AREA")/8924.85 $Exh*Area/Total Unit Area
default : no_def
endswitch
Fixing that function, unintuitively, caused the above "expression too long" error to go away!
This however raises a couple questions - I'd be sincerely interested to see any replies or thoughts around either prompt:
1. I didn't think there was a limit for expression length (or at least a practical limit). The existence of this error suggests otherwise. To avoid crossing that line and to better interpret these errors in the future: Does anyone know what the actual character/line/other limits are for expression length?
* For reference, after trimming this was a relatively hefty expression clocking in at 2737 characters and 73 lines, according to my text editor... so if there is a limit it would be above those figures since it's now working again.
2. To further help interpret/troubleshoot similar situations in the future... Why would using #L (which I would think should resolve in an error along the lines "you're using the wrong function here, dummy") trigger an expression length error? Is there a hierarchy of error messages that maps out "throw error X before checking for root cause Y," that we could construct and keep as a reference for interpreting what different expression evaluation errors could mean when they come up?
Thanks everyone!
~Nick
[cid:image001.png at 01D35E04.D225D050]
Nick Caton, P.E., BEMP
Senior Energy Engineer
Regional Energy Engineering Manager
Energy and Sustainability Services
Schneider Electric
D 913.564.6361
M 785.410.3317
F 913.564.6380
E nicholas.caton at schneider-electric.com<mailto:nicholas.caton at schneider-electric.com>
15200 Santa Fe Trail Drive
Suite 204
Lenexa, KS 66219
United States
[cid:image002.png at 01D35E04.D225D050]
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 255 bytes
Desc: image001.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 8477 bytes
Desc: image002.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 47586 bytes
Desc: image009.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oledata.mso
Type: application/octet-stream
Size: 7132 bytes
Desc: oledata.mso
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.jpg
Type: image/jpeg
Size: 1242 bytes
Desc: image010.jpg
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image011.jpg
Type: image/jpeg
Size: 1308 bytes
Desc: image011.jpg
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0009.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image012.png
Type: image/png
Size: 2842 bytes
Desc: image012.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/789579f2/attachment-0019.png>
More information about the Equest-users
mailing list