Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

While coding a language in textx, I have the following rules: 'has input format ' format=FormatType FormatType: "hh:mm:ss AM/PM" | "YYYY-MM-DD HH:mm:ss" While specifying the ...
Anjan's user avatar
  • 2,980
1 vote
1 answer
26 views

I have the following rule in textx: IsLessThanOrEqualToRule: 'is <= ' reference_value_input = FLOAT | INT ; This rule allows the DSL user to specify a reference numeric value as a float or an ...
Anjan's user avatar
  • 2,980
0 votes
1 answer
36 views

I'm trying to make a textx grammar that will include a the ability to have single line comments like a c/c++ source file. e.g. //this is a comment This is the grammar I have developed to test this. ...
kabla002's user avatar
  • 391
1 vote
1 answer
74 views

I am trying out a prototype for a language using the textx module for python that can interpret grammars. I am creating a model like this: from textx import metamodel_from_str funl_grammar = "&...
user avatar
0 votes
1 answer
43 views

Using Python's textx library I am having trouble capturing exactly what I want from a network configuration file. I can capture the interface and its attribute information, but I want textx to do ...
user190270's user avatar
0 votes
2 answers
197 views

I am trying to parse a network device configuration file, and though I would be going through the whole file, I will not want to include all the terms of the file, but only a subset. So assume that ...
user190270's user avatar
0 votes
1 answer
77 views

I’m attempting to define a grammar file that parses the following: Section0: Key0 = “Val0” Key1 = “Val1” … My attempts thus far have just resulted in one long concatenation string with no real ...
5k1zk17's user avatar
  • 387
0 votes
1 answer
58 views

I'm working on writing a parser for an existing file format, and the trouble is that the syntax does not have a way of indicating what is a comment other than the fact that everything that is not a ...
Cohan's user avatar
  • 4,594
1 vote
1 answer
98 views

I am trying to build a state machine for microwave oven. I am designing it such that it has only two functionalities as of now : bake and clean. It will have 3 states: idle, baking and cleaning. While ...
Tech de Enigma's user avatar
0 votes
1 answer
166 views

TL;DR: The issue will be fixed in version 3.0 of TextX. The workaround is to use regex for matching escaped (\) characters, such as \n. FULL QUESTION: Using TextX, I am parsing a homegrown mark-up ...
MLAO's user avatar
  • 3
1 vote
1 answer
123 views

I need to parse through a file path in Windows, make sure I have provided a csv file. I have tested the regex in an online regex generator and made sure it matches the text I provide it. Program.tx: ...
ivan's user avatar
  • 11
1 vote
1 answer
82 views

I am new to TextX. I am trying to create a grammar for defining data types that have fields that could be of a simple type or of the type of another data type. The grammar description is: Library: ...
Stefan's user avatar
  • 13
1 vote
1 answer
278 views

I feel like I am missing something very simple. I am trying to create a textX grammar that would make my parser to recognize normal text tokens vs special keywords. In the following grammar, I cannot ...
Stanislav Pankevich's user avatar
1 vote
1 answer
51 views

Sample code that is failing when adding the fifth test line to the input variable. Leave the fifth line out and the model works. from textx import metamodel_from_str mm = metamodel_from_str(''' File: ...
Richard Wheeler's user avatar
0 votes
1 answer
118 views

Have a file keywords.tx with Commands: keywords = 'this' & 'way' ; StartWords: keywords = 'bag' ; Then a file mygram.tx with import keywords MyModel: keyword*=StartWords[' '] ...
Richard Wheeler's user avatar
1 vote
1 answer
104 views

I'm trying to write a parser for input files used by Fire Dynamics Simulator using textx. For the most part, ignoring the whitespace is perfect as most parameters and values should be separated by ...
Cohan's user avatar
  • 4,594
0 votes
1 answer
275 views

I'm trying to have an iterable of TextXClass instances for the implementation part of my meta-model but since that class is created dynamically, I'm out of luck. Is there still some clever way to type ...
Christian's user avatar
  • 539
2 votes
2 answers
148 views

I'm trying to design a method for generating audio signals rapidly. I need this for electrophysiological experiments in which I will play tone sequences for the purpose of examining neuronal responses ...
user90664's user avatar
0 votes
1 answer
56 views

I'm trying to write a small DSL for translating classes from one domain to another where the classes and attributes are mostly the same but with some attribute names may be different. For example, the ...
agrant3d's user avatar
1 vote
1 answer
38 views

Consider the following made up example with 3 rules. Model: id_1=Ident 'is' id_2=Ident; Keyword: 'is'; Ident: !Keyword ID; It seems like TextX cannot parse inputs where id_2 starts with "is",...
user1857364's user avatar
3 votes
1 answer
118 views

Assume that we have two rules like this in our grammar: Value: AttributeReference | PrimitiveValue; PrimitiveValue: BoolValue | StringValue | IntValue; I want to implement a code generator for this ...
user1857364's user avatar
1 vote
1 answer
119 views

I'm trying to create a grammar in textx. The syntax should look like this: name_a name_a, name_b name_a, name_b: name_c, * name_a, name_b: name_c, *, name_d *, name_d * Where asterisk (*) means "...
culebrón's user avatar
  • 37.1k
-1 votes
1 answer
61 views

I parsed text using TextX. When I want to process the commands using a for loop, I get THIS: grammar.tx Traceback (most recent call last): File "C:/Users/user/SomerandomIDE/program/program/parser....
Penguin's user avatar
  • 103
1 vote
1 answer
289 views

When I try to load the model (input, not meta-model), it returns a MemoryError about 30 seconds after executing. Expected: List of tree: [{'type':'func', 'callee':'print', 'args':[['Hello']]}] Actual:...
Penguin's user avatar
  • 103
2 votes
1 answer
126 views

I am facing a problem that you guys can probably help me solve. I am trying to parse a grammar that contains this : Expr: BinOp | Name | Constant ; Name: id=ID ; Constant: value=INT ; BinOp: left=...
MrFlow's user avatar
  • 63
1 vote
1 answer
116 views

I want to use textx to parse "foo bar." differently to "foo bar ." (tying the '.' to the last word if there's no space, but still parsing the '.' separately). I would have thought the following would ...
james.haggerty's user avatar
1 vote
1 answer
109 views

I am attempting to use textx in order to parse a language similar to SQL. I would like to use link rule references in order to reference aliases before they are declared. I get an "Unknown Object of ...
Codi Burley's user avatar
2 votes
1 answer
127 views

I have a simple example model where I would like to generate names for the objects of the Position rule that were not given a name with as <NAME>. This is needed so that I can find them later ...
AGK's user avatar
  • 99
2 votes
0 answers
72 views

I have a set of quite complex textX meta-models that I use for parsing files and creating models with. This involves using different custom scope providers. I would like to verify the produced model ...
AGK's user avatar
  • 99
0 votes
1 answer
76 views

The following throws an exception for me (on line 9), complaining that Expected '.' at position (5, 15) => 'k foo bar *end '.: mm = metamodel_from_str(''' File: Line*; Line: Block | Sentence; ...
james.haggerty's user avatar
1 vote
1 answer
395 views

I would like to parse an expression with parenthesis in python using textx. For example the following DSL : CREATE boby = sacha - ( boby & tralaa) ;  CREATE boby = sacha & boby - ( david &...
DrIDK's user avatar
  • 7,983
0 votes
1 answer
428 views

I want to write a textx grammar rule that can consists of either another defined rule or any kind of standard datatype (Int, Float, String etc.). This is for a simple textx DSL which should have the ...
mep's user avatar
  • 351
0 votes
1 answer
84 views

I'm new with DSL and I'm not sure if it's possible the tasks that I want to do with textx: I already have language description textX (ex: hello.tx) Load an initial model file for this language (ex: ...
Xean's user avatar
  • 25
1 vote
1 answer
241 views

As I cannot find any guidelines about syntax highlighting, I decided to prepare simple write-as-plain-text-and-then-highlight-everything-in-html-preview, which is enough for my scope at the moment. ...
proxy's user avatar
  • 519
0 votes
1 answer
305 views

I am done with this tutorial which shows how to use textX to write a java POJO. I am thinking of adapting this to write Django model classes. The issue is when I have to add custom model methods to ...
Kim Stacks's user avatar
  • 10.9k
1 vote
2 answers
107 views

I followed the set of instructions for this open source. At step 3, I am supposed to run py.test tests/functional/ When I do so, I get ModuleNotFoundError: No module named 'textx' However, when I ...
Kim Stacks's user avatar
  • 10.9k
0 votes
1 answer
173 views

Was working through the hello-world example in the docs. I then realized I wanted to add comments to help me learn the textX syntax better. There's no indication that this is possible in the first ...
Kim Stacks's user avatar
  • 10.9k
2 votes
1 answer
939 views

I'm using https://github.com/igordejanovic/textX to parse dhcpd.conf file (no, https://pypi.org/project/iscconf/ does not work for me, it crashes on my dhcpd.conf file), specifically extract hosts ...
LetMeSOThat4U's user avatar
0 votes
1 answer
116 views

I want to ask if it is possible to read - from my Python code - a literal which I have defined in the meta model. This may be best explained with an example. Lets say this is my meta model (inspired ...
DonHaugaard's user avatar
1 vote
2 answers
487 views

I am writing a parser for an existing language, using the TextX Python Library (based on the Arpeggio PEG parser) But when I try to use it to parse a file, I get the exception: RecursionError: ...
Chen Levy's user avatar
  • 16.6k
0 votes
1 answer
147 views

I'm using textx (documentation) as DSL parser and my application would greatly benefit from re-use of both textx metamodels and models. I tried with pickle, but I realized I can't pickle textx ...
Antonio Ken Iannillo's user avatar