Questions tagged [qi]

Qi is a modern lisp-like functional programming language, which incorporates many ML-style features, and a very powerful (turing complete) type system.

From the homepage:

Qi is an award-winning functional programming language based on 20 years R&D that offers the advantages of pattern matching, λ calculus consistency, optional lazy evaluation and static type checking. It uses sequent calculus notation to define types, and has the most powerful type system of any existing functional language, including ML and Haskell. Qi includes an integrated fully functional Prolog and an inbuilt compiler-compiler. Qi is free for personal and educational use and runs under Common Lisp.

33 questions
1
vote
1 answer

C++ boost::qi parse space and newline delimited numbers as a 2D vector

I have multiple floating point numbers lines, numbers in a line are space separated e.g. 1.2 2.2 3.2 1.1 2.1 3.1 I want to extract the above numbers as strings and parse to a 2D vector as; std::vector< std::vector< std::string > > { {"1.2", "2.2",…
shaaa
  • 503
  • 1
  • 4
  • 16
1
vote
1 answer

How to use std::function in a qi symbol table

I have the following code. This code shall parse two int and return the result of a comparison as a bool. For compare, I use the qi::symbol table. But, unfortunately, it does not compile. Any idea what goes wrong? #include…
SRoeber
  • 61
  • 1
1
vote
0 answers

SQL WHERE Clause Parser by boost qi

I want to implement some rules of SQL WHERE clause parser by boost qi. If ound the its BNF on https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#_8_4_in_predicate. I implemented a specific predicate rules by some special…
1
vote
1 answer

Boost.Qi rule with skipper does not match '.' character

So I have the following qi skipper: template struct verilog_skipper : public qi::grammar { verilog_skipper() : verilog_skipper::base_type(skip) { namespace phx = boost::phoenix; skip = qi::ascii::space | qi::eol…
kevinshms
  • 41
  • 3
1
vote
1 answer

boost phoenix not referencing previous match

i am trying to parse a character stream and do a lookup on the second character parsed to get the number of repeats required for the third character. Variable objSize however does not get referenced correctly within repeat and full parse fails. If i…
user2149346
  • 295
  • 1
  • 8
1
vote
1 answer

Boost Spirit: slow parsing optimization

I'm new to Spirit and to Boost in general. I'm trying to parse a section of a VRML file that looks like this: point [ #coordinates written in meters. -3.425386e-001 -1.681608e-001 0.000000e+000, …
Slava C
  • 51
  • 4
1
vote
1 answer

boost::spirit::qi::parse grammar not working as expected

I try to write a grammar to parse the following syntax: // - command // - command value0 ... valueN // - command -arg0 ... -argN // - command -arg0 value0 ... valueN ... -argN value0 ... valueN Each element shall be interpreted as a string Within…
Maik
  • 541
  • 4
  • 15
1
vote
1 answer

Returning multiple data types from Boost::spirit parse

I would like to parse about 5-10 different message types that share a common format (such as JSON, for example) but each have specific fields that need to be validated. Each message should eventually be parsed into a custom class/struct that has…
Scott M
  • 482
  • 3
  • 14
1
vote
1 answer

Spirit: Allowing a character at the begining but not in the middle

I'm triying to write a parser for javascript identifiers so far this is what I have: // All this rules have string as attribute. identifier_ = identifier_start >> *( identifier_part >> -(qi::char_(".") > identifier_part) …
Raydel Miranda
  • 13,825
  • 3
  • 38
  • 60
1
vote
1 answer

Spirit Qi : rule for char [5]

I have the following structure struct MyStruct { char CODE; char NAME[5]; }; I make it a fusion struct BOOST_FUSION_ADAPT_STRUCT ( MyStruct, (char, MARKET_CODE) (char, NAME[5]) ) My grammar is implemented as follow: MyStruct_parser() :…
DJ Guion
  • 37
  • 2
0
votes
0 answers

Boost Phoenix can no longer assign qi::_1 to variable after porting Boost 1.56 to 1.71

I have some C++ code that uses Boost Qi and Phoenix to parse command line parameters. The following code worked fine with Boost 1.56. namespace qi = boost::spirit::qi; namespace phx = boost::phoenix; using boost::spirit::repository::distinct; int…
B-Dawg
  • 13
  • 3
0
votes
1 answer

Parse key, value pairs when key is not unique

My input are multiple key, value pairs e.g.: A=1, B=2, C=3, ..., A=4 I want to parse the input into the following type: std::map< char, std::vector< int > > m Values for equal keys shall be appended to the vector. So the parsed output should be…
Maik
  • 541
  • 4
  • 15
0
votes
2 answers

Eventloop stuck: NAO C++ SDK OnFaceDetection Example

I installed the NAOqi C++ SDK on my MAC and I tried out some examples from the SDK. HelloWorld-Example worked fine but with the OnFaceDetection-Example I'll get an Error/Warning with qi.eventloop after the NAO detect my…
noudels
  • 11
  • 3
0
votes
1 answer

Socket is not connected Pepper

I use pythonsdk and naoqi for programming my pepper robot. i created a session and call the main by it is follows: try session = qi.Session() session.connect("tcp://#.#.#.#:9559") except RuntimeError: print ("Cannot…
user9805040
  • 73
  • 1
  • 9
0
votes
1 answer

How to use spirit's qi attributes properly?

I want to parse something like "a=1;b=2;{c=3;d=4;}e=5;f=6;". My problem is how to handle the block within the '{}' chars. The values within the block shall be parsed (but not propagated to attribute of r1) if ignoreBlock is true. using namespace…
SRoeber
  • 61
  • 1