# Error in parsing BaseModelica model

**URL:** https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851
**Category:** General Usage
**Tags:** parsing, modelingtoolkit, modelling
**Created:** [June 19, 2024, 11:06am UTC](https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851 "2024-06-19T11:06:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![thermal\_pro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thermal_pro/32/51064_2.png) [@thermal\_pro](https://discourse.julialang.org/u/thermal_pro)
#### Post date: [June 19, 2024, 11:06am UTC](https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851/1 "2024-06-19T11:06:15Z")

</div>

I have been trying to parse a model to ModelingToolkit using the `parse_basemodelica` function, available in Basemodelica.jl. But encounters the following error:

"Error during FSM execution at buffer position 19. Last 19 byte(s) were:“package ‘First’\n t"Observed input: ‘t’ at state 14. Outgoing edges: \* ’ ’ \* 'm’Input is not in any outgoing edge, and machine therefore errored.”

Here is my basemodelica model ‘First.mo’, as available in the following link,  
[BaseModelica](https://github.com/modelica/ModelicaSpecification/issues/3505)

I have already given EOL conversion to Unix Style but still nothing works…  
Can I get some assistance to troubleshoot the above error and parse my model?  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [June 19, 2024, 11:39am UTC](https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851/2 "2024-06-19T11:39:01Z")

</div>

Jadon has a new branch of the BaseModelica parser someone, let’s try that.

I don’t CC him but I’ll get him on this thread so we can keep this going.

---

<div class="post-metadata">

### Author: ![jClugstor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jclugstor/32/32689_2.png) [@jClugstor](https://discourse.julialang.org/u/jClugstor)
#### Post date: [June 19, 2024, 1:29pm UTC](https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851/3 "2024-06-19T13:29:18Z")

</div>

The current version of BaseModelica.jl doesn’t support creating custom types yet, which is the source of the parsing error. I’m currently working on adding support for all language constructs, but it’s still a work in progress. I have a branch that greatly improves the parser here [GitHub - jClugstor/BaseModelica.jl at parser\_improvements](https://github.com/jClugstor/BaseModelica.jl/tree/parser_improvements) but it’s not ready yet. Hopefully it will be ready in the next couple of months.

---

<div class="post-metadata">

### Author: ![thermal\_pro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thermal_pro/32/51064_2.png) [@thermal\_pro](https://discourse.julialang.org/u/thermal_pro)
#### Post date: [June 20, 2024, 4:36am UTC](https://discourse.julialang.org/t/error-in-parsing-basemodelica-model/115851/4 "2024-06-20T04:36:49Z")

</div>

Really thankful for your responses!
