# For fun: parsing nested decision chains for GDL3 / Task Planning **Category:** [BMM/Expressions](https://discourse.openehr.org/c/bmm-el/60) **Created:** 2022-02-21 21:56 UTC **Views:** 482 **Replies:** 0 **URL:** https://discourse.openehr.org/t/for-fun-parsing-nested-decision-chains-for-gdl3-task-planning/2385 --- ## Post #1 by @thomas.beale Mainly for language geeks, I have the following parsing in my development Antlr4 Expression Language parser. Geek clinicians like @joostholslag, @siljelb , @varntzen might or might not find it interesting. (You have to pretend you are an oncologist to even potentially be excited). ``` Result := choice in ================================================================================ not metastatic: choice in ======================================================================== molecular_subtype matches {#luminal_B_HER2_negative, #triple_negative} and (tnm_t matches {"1b", "1c"} or tnm_n > 0): #taxanes, ------------------------------------------------------------------------ molecular_subtype = #luminal_A and (tnm_t ≥ 3 or tnm_n ≥ 2 or tnm_g ≥ 3): #anthracyclines, ------------------------------------------------------------------------ molecular_subtype = #luminal_B_HER2_positive and (tnm_t matches {"1b", "1c"} and tnm_n = 0) or molecular_subtype = #HER2_positive and (tnm_t = "1b" and tnm_n = 0): #paditaxel_trastuzumab ======================================================================== ;, -------------------------------------------------------------------------------- *: choice in ===================== yyy: aaa, --------------------- xxx: bbb, --------------------- *: ccc ===================== ; ================================================================================= ; ``` --- **Canonical:** https://discourse.openehr.org/t/for-fun-parsing-nested-decision-chains-for-gdl3-task-planning/2385 **Original content:** https://discourse.openehr.org/t/for-fun-parsing-nested-decision-chains-for-gdl3-task-planning/2385