File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed
Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ TEST_OUT = $(TEST_FILES:.nec=.antlr)
4949 - ./antlr_test -i $* .nec -o $@
5050
5151test_clean :
52- rm ${TEST_OUT}
52+ rm -f ${TEST_OUT}
5353
5454test_all : ${TEST_OUT}
5555 echo " DONE"
Original file line number Diff line number Diff line change @@ -18,15 +18,25 @@ Also requires lapack libraries.
1818
1919 aptitude install math-atlas-dev
2020
21+ ### Testing
22+
23+ Just build in the current directory
24+
25+ make
26+ make test_clean
27+ make test_all
28+
2129## New parser for NEC cards
2230
23- The grammar is in the file nec.g
31+ The grammar is in the file nec.g. This is an ANTLR grammar for the existing NEC2 card deck for describing
32+ antennas.
2433
2534
2635## New Language
2736
2837The new language for nec++ will be more explicit and easy to read. It will also allow comments anywhere
29- inside the code.
38+ inside the code. In addition it will not depend on whitespace to skip over missing parameters, and therefore
39+ will be far more robust.
3040
3141 /* This is a comment */
3242 geometry {
Original file line number Diff line number Diff line change @@ -196,6 +196,8 @@ analysisLine
196196 | tlCard
197197 | xqCard
198198 | enCard
199+ | pqCard
200+ | gsCard
199201 ;
200202
201203
@@ -378,6 +380,29 @@ enCard
378380 }
379381 ;
380382
383+ pqCard
384+ { int iptflq = 0 ;
385+ int iptaq, iptaqf, iptaqt;
386+ }
387+ : PQ (iptflq= intNum)?
388+ ( { nec-> pq_card(iptflq, 0 , 0 , 0 );
389+ }
390+ | iptaq= intNum iptaqf= intNum iptaqt= intNum
391+ { nec-> pq_card(iptflq, iptaq, iptaqf, iptaqt);
392+ }
393+ ) NEWLINE
394+ ;
395+
396+ gsCard
397+ { float f1 = 0.0 ; }
398+ : GS (f1= realNum)? NEWLINE
399+ {
400+ c_geometry* geo = nec-> get_geometry();
401+ geo-> scale(f1);
402+ }
403+ ;
404+
405+
381406protected
382407realNum returns [ double val]
383408 : r: REAL
You can’t perform that action at this time.
0 commit comments