[Equest-users] Parsing Error: Expression too long to be parsed.

David Griffin II DGriffin at archnexus.com
Wed Nov 15 14:57:30 PST 2017


In addition to the character length of an expression, there is also a line length; i.e. # of characters per line of text. However, I forget what the exact maximum character length.

[ARCH | NEXUS]<http://www.archnexus.com>
DAVID W. GRIFFIN II
BEMP
ENERGY ANALYST
2505 E Parleys Way
Salt Lake City, UT 84109
Office 801.924.5028
archnexus.com<http://www.archnexus.com>
[Twitter]<https://twitter.com/arch_nexus>[Facebook]<https://www.facebook.com/pages/Architectural-Nexus/179588705397563?ref=ts&fref=ts>[Youtube]<https://www.youtube.com/channel/UCYRPWKF-yp-AUiI8ia2XfKw?feature=mhee>[LinkedIn]<https://www.linkedin.com/company/architectural-nexus>

From: Nicholas Caton [mailto:Nicholas.Caton at schneider-electric.com]
Sent: Wednesday, November 15, 2017 10:34 AM
To: Bishop, Bill; equest-users at onebuilding.org
Cc: Jeff Hirsch
Subject: Re: [Equest-users] Parsing Error: Expression too long to be parsed.

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 01D35E26.0CC6F510]
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 01D35E26.0CC6F510]



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<mailto:Nicholas.Caton at schneider-electric.com>>; equest-users at onebuilding.org<mailto: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:image003.jpg at 01D35E26.0CC6F510]  [cid:image004.jpg at 01D35E26.0CC6F510]



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:image006.png at 01D35E26.0CC6F510]

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 01D35E26.0CC6F510]
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 01D35E26.0CC6F510]




______________________________________________________________________
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/808a9330/attachment.html>
-------------- 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/808a9330/attachment.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/808a9330/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 1242 bytes
Desc: image003.jpg
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/808a9330/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 1308 bytes
Desc: image004.jpg
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/808a9330/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2842 bytes
Desc: image005.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/808a9330/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 47586 bytes
Desc: image006.png
URL: <http://lists.onebuilding.org/pipermail/equest-users-onebuilding.org/attachments/20171115/808a9330/attachment-0003.png>


More information about the Equest-users mailing list