perf expr: Move expr lexer to flex
authorJiri Olsa <jolsa@kernel.org>
Fri, 28 Feb 2020 09:36:13 +0000 (10:36 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Mar 2020 00:43:24 +0000 (21:43 -0300)
commit26226a97724d1671d553b8eb0cd95b0a5557cfb2
tree57d666c7b5ac539d42b77945b8d16b6bf7a3ea27
parent576a65b6974ddc830a89b6feb6823bd6b5914bde
perf expr: Move expr lexer to flex

Adding expr flex code instead of the manual parser code. So it's easily
extensible in upcoming changes.

The new flex code is in flex.l object and gets compiled like all the
other flexers we use.  It's defined as flex reentrant parser.

It's used by both expr__parse and expr__find_other interfaces by
separating the starting point.

There's no intended change of functionality ;-) the test expr is
passing.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20200228093616.67125-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/Build
tools/perf/util/expr.c
tools/perf/util/expr.h
tools/perf/util/expr.l [new file with mode: 0644]
tools/perf/util/expr.y