-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparser.cpp
49 lines (43 loc) · 1.44 KB
/
parser.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "parser.h"
Parser::Parser(QObject *parent) :
QObject(parent)
{
}
void Parser::findCommand(QString templ,QString command)
{
// templ=":ACQU:STOP:CHAN:{int}?";
// \:(ACQU)\:(STOP)\:(CHAN)\:(-?[0-9]+)\?
// QString c1=
// QRegExp any_symbol(".");
// QStringList command_list = templ.split(":").filter(any_symbol);
// foreach (var, container) {
// }
// /*foreach (QString s, com_list ){
// printf("string %s len %d \n",s.toStdString().c_str(),s.length());
// }*/
// printf("sss=%d",com_list.size());
}
void Parser::findDataType(QString str)
{
// QRegExp integer_exp("^-?[0-9]+$");
// QRegExpValidator int_validator(integer_exp);
// if ( int_validator.validate(str,0) == QValidator::State::Acceptable)
// return;
// return;
// QRegExp double_exp("/^[0-9]+(\\.[0-9]+)?$");
// QRegExpValidator double_validator(double_exp);
// if ( double_validator.validate(str,0) == QValidator::State::Acceptable)
// return;
// return;
// // /^[0-9]+(\\.[0-9]+)?$ double
}
bool Parser::regexpCommand(QRegExp rexp,QString str){
//QRegExpValidator validator(rexp);
int pos=0;
//if ( validator.exactMatch(str,pos) == QValidator::Intermediate)
if (rexp.exactMatch(str)==true)
return true;
printf("strlen=%d ",str.length());
printf("%d ",rexp.matchedLength());
return false;
}