Commit Graph

423 Commits

Author SHA1 Message Date
rlar 4d4d51c27b inpcom.c, reorder some statements 2013-12-31 16:10:08 +01:00
rlar d19f75381c inpcom.c, local scope for `str' 2013-12-31 16:10:07 +01:00
rlar 245bd13cec inpcom.c, local scope for `global_card' 2013-12-31 16:10:05 +01:00
rlar e0e30a9d93 inpcom.c, drop variable `prev' 2013-12-31 16:10:04 +01:00
rlar 855e504b9a inpcom.c, get rid of the global `global' 2013-12-31 16:10:02 +01:00
rlar 761ca9963d inpcom.c, rewrite subckt_w_params business 2013-12-31 16:10:01 +01:00
rlar 956e7ad625 inpcom.c, execute inp_fix_for_numparam() just once when call_depth == 0 2013-12-31 16:10:00 +01:00
rlar 1c3a8670d8 inpcom.c, drop superflous initialisation 2013-12-31 16:09:56 +01:00
rlar 5425ce387e inpcom.c, improve readability of skip_back_non_ws() and skip_back_ws() 2013-12-31 16:09:54 +01:00
rlar 7fff6c27cd inpcom.c, cleanup 2013-12-31 16:09:53 +01:00
rlar fb3d474cc2 inpcom.c, drop some local variables 2013-12-31 16:09:51 +01:00
rlar cde7286721 inpcom.c, simplify error processing 2013-12-31 16:09:50 +01:00
rlar e94a7e240f inpcom.c, simplify tfree() usage 2013-12-31 16:09:49 +01:00
rlar 40343f164b inpcom.c, local scope for some variables 2013-12-31 16:09:47 +01:00
rlar 153b4ac1c3 inpcom.c, cleanup deck loops #4/4 2013-12-31 16:09:43 +01:00
rlar 0d7020067e inpcom.c, cleanup deck loops #3/4 2013-12-31 16:09:42 +01:00
rlar 5c82547109 inpcom.c, cleanup deck loops #2/4 2013-12-31 16:09:40 +01:00
rlar d4e693632b inpcom.c, cleanup deck loops #1/4 2013-12-31 16:09:39 +01:00
rlar b76f9084bd inpcom.c, inp_chk_for_multi_in_vcvs() shrink scope of variables 2013-12-31 16:09:36 +01:00
rlar 9b404a2265 inpcom.c, cleanup 2013-12-31 16:09:35 +01:00
rlar 30b4451433 inpcom.c, bug fix (incorrect check for mal formed line) 2013-12-31 16:09:34 +01:00
rlar 0f14ee3c22 inpcom.c, cleanup 2013-12-31 16:09:32 +01:00
rlar 129b1f36ed inpcom.c, simple cleanups 2013-12-31 16:09:31 +01:00
rlar 30a88925da inpcom.c, change semantics of skip_back_non_ws() and skip_back_ws() 2013-12-31 16:09:29 +01:00
rlar 144452c96c inpcom.c, unify skip_back() usage #2/2 2013-12-31 16:09:28 +01:00
rlar 7fd93a8bd6 inpcom.c, unify skip_back() usage #1/2 2013-12-31 16:09:27 +01:00
rlar 8bff6db927 inpcom.c, cleanup inp_get_func_from_line() 2013-12-31 16:09:25 +01:00
rlar 687de9fc02 inpcom.c, drop artifact, now this isn't any more a bug 2013-12-31 16:09:24 +01:00
rlar b20c6e149c inpcom.c, use a list to store the `.func' lookup table 2013-12-31 16:09:22 +01:00
rlar 9093ec8fac inpcom.c, use a `rib cage' to store the .subckt lexical scoping of `.func' 2013-12-31 16:09:21 +01:00
rlar 777dbede9b inpcom.c, cleanup inp_expand_macros_in_deck() recursion 2013-12-31 16:09:20 +01:00
rlar 9782542b62 bug fix, .func expansion for nested .subckt 2013-12-31 16:09:17 +01:00
rlar 4fee1ed6c1 inpcom.c, cleanup some while(struct line * ...) loops 2013-12-31 16:09:16 +01:00
rlar 60d9e79870 inpcom.c, cleanup 2013-12-31 16:08:59 +01:00
rlar c397bb2013 inpcom.c, abstraction, find_subckt_w_params() 2013-12-31 16:08:58 +01:00
rlar 09a2ea3b0d inpcom.c, cleanup, emphasize a search in subckt_w_params[] 2013-12-31 16:08:57 +01:00
rlar ee626636c3 inpcom.c, abstraction, new_subckt_w_params() 2013-12-31 16:08:55 +01:00
rlar f9dca702c9 inpcom.c, abstraction, new_lib() 2013-12-31 16:08:54 +01:00
rlar ec93de4a5d inpcom.c, cleanup usage of free_function() 2013-12-31 16:08:52 +01:00
rlar 5e00cbb3dd inpcom.c, abstraction, free_function() 2013-12-31 16:08:51 +01:00
rlar cb6340bf5b inpcom.c, think in terms of struct functions instead of an integer 2013-12-31 16:08:50 +01:00
rlar 2929b7b885 inpcom.c, emphasize a potential bug 2013-12-31 16:08:48 +01:00
rlar 77484595a0 inpcom.c, think in terms of struct library instead of an integer 2013-12-31 16:08:47 +01:00
rlar 00f26c7e69 inpcom.c, collect globals into a struct 2013-12-31 16:08:45 +01:00
rlar 936096ed6b inpcom.c, rename N_FUNCS and N_LIBRARY 2013-12-31 16:08:44 +01:00
rlar e0b56ca877 inpcom.c: rewrite .lib processing 2013-12-31 16:08:40 +01:00
h_vogt 0cf4fa381c inpcom.c: debug output streamlined 2013-12-31 16:08:39 +01:00
h_vogt 87352b7f04 inpcom.c: larger array size, debug output modified 2013-12-31 16:08:37 +01:00
rlar 8fa71d2ae1 inpcom.c: array bounds check 2013-12-31 16:08:36 +01:00
h_vogt a146e6abfb inpcom.c: disable `m' for E, H 2013-12-31 16:08:22 +01:00
dwarning 56449f54a3 allow Multiplier for current source in subckts 2013-12-31 16:08:18 +01:00
h_vogt 104f795a3e inpcom.c: add some some comments 2013-12-31 16:08:17 +01:00
h_vogt 4d4f05c380 inpcom.c: no multiplier 'm' added to V, I lines in subckt 2013-12-31 16:08:15 +01:00
h_vogt e953d9a796 inpcom.c: hot fix for nested ternary expressions 2013-12-31 16:07:52 +01:00
rlar dc0fbe4220 bug fix, preserve filename case for `codemodel', `load' and `use'
reported and fixed by Emil Lambrache on the bug tracker
http://sourceforge.net/p/ngspice/bugs/241/
  "#241 case sensitivity not preserved for file names"
2013-12-31 16:07:29 +01:00
h_vogt d7e291c53a HAS_WINDOWS --> HAS_WINGUI
allow compilation on MS Windows without GUI
2013-12-31 12:56:57 +01:00
h_vogt 1e88db6f7d add command 'circbyline' to allow entering circuit line by line 2013-12-31 12:56:56 +01:00
rlar efd8843f21 inpcom.c: cleanup comments 2013-12-31 12:56:52 +01:00
rlar a07817271a expand_libs(): think of `next' instead `prev' 2013-12-31 12:56:52 +01:00
rlar bdea094050 expand_libs(): rename `tmp_ptr2' --> `next' 2013-12-31 12:56:51 +01:00
rlar 27d68e8db7 expand_libs(): reposition `keep_char' restorage 2013-12-31 12:56:50 +01:00
rlar fcb5b12364 expand_libs(): shrink scope of `found_section' 2013-12-31 12:56:50 +01:00
rlar edc2503a3a expand_libs(): bug fix, missing check for .endl at the tail of a file 2013-12-31 12:56:49 +01:00
rlar 182911a5c7 inpcom.c: rename local variable names 2013-12-31 12:56:48 +01:00
rlar 07d3e3aa42 inpcom.c: rename local variable names 2013-12-31 12:56:48 +01:00
rlar 99141bbdfc inpcom.c: rename local variable names 2013-12-31 12:56:47 +01:00
rlar 181742a020 inpcom.c: rename found_lib_name --> found_section 2013-12-31 12:56:46 +01:00
rlar 7d5c48c0f2 inpcom.c: rename inp_determine_libraries() --> collect_section_references() 2013-12-31 12:56:46 +01:00
rlar fda6912f0e inpcom.c: rename expand_libs() --> expand_section_references() 2013-12-31 12:56:45 +01:00
rlar e898eb4faf inpcom.c: rename function argument names 2013-12-31 12:56:45 +01:00
rlar ffe82f1722 inpcom.c: rename function argument names 2013-12-31 12:56:44 +01:00
rlar b22be31496 inpcom.c: cleanup 2013-12-31 12:56:43 +01:00
rlar adeb2885c5 inpcom.c: rename library_file[] --> library_name[] 2013-12-31 12:56:43 +01:00
rlar 20f5bb3e2e inpcom.c: rename library_name[][] --> section_name[][] 2013-12-31 12:56:42 +01:00
rlar b8e3843f45 inpcom.c: rename library_ll_ptr[][] --> section_ref[][] 2013-12-31 12:56:41 +01:00
rlar aa9d291114 inpcom.c: rename libraries[] -> library_deck[] 2013-12-31 12:56:41 +01:00
rlar 61ab7b1de2 inpcom.c: rename num_lib_names --> num_sections 2013-12-31 12:56:40 +01:00
rlar d619a8b024 inpcom.c: rename new_lib_name() --> remember_section_ref() 2013-12-31 12:56:39 +01:00
rlar 05bd53b8de inpcom.c: rename find_lib_name() --> find_section() 2013-12-31 12:56:39 +01:00
rlar 09e89df89d inpcom.c: static declaration of library related global variables 2013-12-31 12:56:38 +01:00
rlar d1764cc7fa inp_readall() change function signature for readability 2013-12-31 12:56:35 +01:00
rlar 536d3c229f inpcom.c: abstract into new function read_a_lib() 2013-12-31 12:56:34 +01:00
rlar eaf4801b33 inpcom.c: rewrite using new function find_lib() 2013-12-31 12:56:34 +01:00
rlar 9d856dad61 inp_determine_libraries(): rewrite 2013-12-31 12:56:33 +01:00
rlar 9e3f2a9d28 inp_determine_libraries(): can happen at most once 2013-12-31 12:56:32 +01:00
rlar 111a258ff4 inpcom.c: small cleanup 2013-12-31 12:56:32 +01:00
rlar b4db509d83 inpcom.c: comment .lib semantic 2013-12-31 12:56:31 +01:00
rlar 7463499523 inp_readall(): rename local variables 2013-12-31 12:56:31 +01:00
rlar 3877e2d0d6 inp_readall(): local scope for `tmp_ptr1' 2013-12-31 12:56:30 +01:00
rlar 5fda0e2694 inp_readall(): local scope for `fdo' 2013-12-31 12:56:29 +01:00
rlar 4184aa8c10 cleanup, use array operator
checked for object file invariance on linux with
   ./configure --enable-debug=no --enable-maintainer-mode --with-readline=yes --enable-cider --enable-ndev --enable-pss --enable-xspice
2013-12-31 12:54:43 +01:00
rlar 8c69016464 inpcom.c: rewrite for readability 2013-09-20 21:38:58 +02:00
rlar dbfc90df0a inpcom.c, bug fix, incorrect start value for `prev'
this bug was introduced in the following commit,
which `reused' variable prev,
failing to preserve its initialization value NULL

Author: pnenzi <pnenzi>
Date:   Mon Oct 8 21:10:34 2007 +0000

    Improvements in frontend by Phil Barker
2013-01-12 23:26:42 +01:00
h_vogt 20716d3496 inpcom.c: exit if 'poly' option is required, but XSPICE not available,
remove memory leak
2012-12-30 19:27:36 +01:00
rlar 83e3100917 remove unused variables 2012-12-01 16:05:20 +01:00
h_vogt 6a6c49516a inpcom.c: remove memory leak 2012-12-01 13:24:46 +01:00
h_vogt 9d52468471 inpcom.c: plug memory leaks 2012-11-27 23:56:00 +01:00
h_vogt d0f58dc5a6 inpcom.c: prevent invalid memory read/write 2012-11-25 18:27:42 +01:00
h_vogt 85244d0222 inpcom.c: remove bug in inp_add_series_resistor(),
prevent crash in inp_remove_ws() upon erroneous input
2012-11-04 14:15:37 +01:00
h_vogt a57361333a inpcom.c: add series resistor to each inductor with option rseries=1m 2012-10-29 23:13:20 +01:00
rlar ba131a5077 remove adms3 #1/2, code
due to license issues, and with the aim to approach the next
  ngspice release 25
we have to move this over to a development branch
2012-10-25 18:54:09 +02:00
rlar a394d79c56 use utf-8 encoding 2012-10-20 21:27:15 +02:00
h_vogt 0853c374a1 inpcom.c: require parentheses in ternary functions if numparam
parser is involved (no B sources)
2012-10-17 22:28:49 +02:00
h_vogt ae25f54709 inpcom.c: plug small memory leak 2012-10-15 18:35:12 +02:00
rlar ebc50b8639 inpcom.c, rewrite 2012-10-13 16:48:15 +02:00
rlar a4e167a657 inpcom.c, use strchr() in favour of strstr() 2012-10-13 12:27:20 +02:00
rlar 3b2b130177 inpcom.c, inp_fix_ternary_operator_str(), use copy_substring() 2012-10-13 12:00:29 +02:00
rlar 680e45f7f3 inpcom.c, inp_fix_ternary_operator_str(), rewrite 2012-10-13 11:47:22 +02:00
rlar 9352a4b72d inpcom.c, get_instance_subckt(), more carefull when there is trailing whitespace 2012-10-13 11:31:37 +02:00
rlar f61f323be0 inpcom.c, get_instance_subckt(), rewrite 2012-10-13 11:31:37 +02:00
rlar 7f0065e7fb inpcom.c, make use of copy_substring() 2012-10-13 11:03:52 +02:00
rlar 69bf624097 inpcom.c, rewrite 2012-10-13 11:02:34 +02:00
rlar 3f4e2eed49 inpcom.c, bug fix in inp_get_subckt_name() 2012-10-13 10:45:09 +02:00
rlar 021a5dd871 inpcom.c, rewrite 2012-10-12 19:23:46 +02:00
rlar e0b796f3c5 inpcom.c, rewrite 2012-10-12 18:10:52 +02:00
rlar 3085c471ac inpcom.c, cleanup 2012-10-12 17:58:05 +02:00
rlar dbf288bae7 inpcom.c, fix a bug
which was introduced in commit
  skip-ws, #5/6, unify macro versions, obj not invariant
where the SKIP.*back.* macros have been unified

FIXME, the check for `\0' in the backwards direction if of course nonsense.
These backward functions either shall not check it at all (being optimistic),
or they shell check against a start of string pointer.
2012-10-11 19:33:32 +02:00
rlar caf50ba4d8 inpcom.c, cleanup 2012-10-10 20:48:42 +02:00
rlar 2b72fbbc5e skip_ws(), #2/2, drop macros, obj-invariant 2012-10-08 17:48:27 +02:00
rlar 9f3f794ced skip_ws(), #1/2, use functions instead of macros 2012-10-08 17:28:52 +02:00
rlar 701942cebf skip-ws, #6/6, unify macro versions, obj-invariant
checked for object file invariance
2012-10-07 21:53:42 +02:00
rlar 532ff76dac skip-ws, #5/6, unify macro versions, obj not invariant 2012-10-07 21:53:29 +02:00
rlar 6a5f234519 skip-ws, #4/6, use macros, obj-invariant
checked for object file invariance
2012-10-07 21:52:54 +02:00
rlar 4bf52410fb skip-ws, #3/6, introduce macros, obj-invariant
checked for object file invariance
2012-10-07 21:52:35 +02:00
rlar e3b5ff94c5 skip-ws, #2/6, prepare for rewrite, obj-invariant
checked for object file invariance
2012-10-07 21:52:22 +02:00
rlar 841db86e00 skip-ws, #1/6, prepare for rewrite, obj-invariant
checked for object file invariance
2012-10-07 21:52:09 +02:00
h_vogt 996dedaa71 inpcom.c: remove cccs from F, ccvs from H source 2012-10-07 17:12:42 +02:00
h_vogt e69f50270d inpcom.c: correct replacement of vccs, vcvs in E, G-sources
search for 'par(' instead of 'par'
2012-10-07 15:19:28 +02:00
rlar fe1acd3757 src/frontend/** remove superfluous `return' invocations 2012-09-22 19:33:55 +02:00
rlar 7454a6d486 src/frontend/**, whitespace, indentation, ...
untabify
delete-trailing-whitespace
braces
...

checked for object file invariance on linux
2012-09-20 20:30:53 +02:00
rlar adc9ee09ce api change for ngdirname() to fix a memory leak
ngdirname did `own' the returned string.
now the invoker is responsible for the returned string.

note, this is contrary to the POSIX dirname() implementation,
   which *might* return pointers to statical allocated memory.
2012-09-13 20:07:33 +02:00
h_vogt acfc7a2a27 remove memory leaks 2012-08-04 19:09:13 +02:00
h_vogt 05437b1d48 inpcom.c: safely uncomment unused subcircuits (top level only)
if they contain further nested subcircuits
2012-08-03 22:42:33 +02:00
h_vogt 4d0d0fafb9 repair broken ternary function in B-Source
failed if parameters were included in function.
fixed by finding nested parens in gettok_char()
2012-07-21 22:23:49 +02:00
h_vogt c3141d94e0 table: prevent crashes upon wrong inputs, allow time, temper, hertz as part of device or node name (e.g. Rtime), remove some memory leaks 2012-07-21 21:18:24 +02:00
rlar 9655b9885a cleanup, use wl_cons(), wl_append_word() and wl_chop_rest() 2012-07-14 10:23:51 +02:00
h_vogt 0207dc7239 no exchange of ' ' by { } inside .control section 2012-06-26 23:28:31 +02:00
rlar d8105873db remove error.h, use fteext.h for controlled_exit() 2012-06-12 21:26:29 +02:00
rlar a9eb96e164 avoid `ambiguous else' Warning 2012-06-12 21:26:29 +02:00
h_vogt a51953d93e allow `time', `temper', and `hertz' in expressions of behavioral R,L,C devices 2012-06-12 21:26:27 +02:00
h_vogt 8b780fa42b bug_fix: R,L,C instantiations, tc1, tc2, numbers followed by `:'
Ternary function was not recognized in R, C, or L lines
  if no voltage or current node was part of the expression,
  because then B-Source is not used.
In these cases now inp_fix_ternary_operator_str() is called explicitly.

tc1, tc2 were sometimes recognized falsely,
  if part of a token e.g. tc1end.

R, C, and L models are never commented out,
  because their names may be token no. 4 or 5 in an R, C, or L line,
  and will not be recognized if 5.

INPevaluate() will now correctly evaluate a number if followed by ':'
  (number may be part of the ternary function).
2012-03-31 23:42:37 +02:00
h_vogt 232270cbc4 bug fix, inp_bsource_compat(): `tc1=' `tc2=' `reciproctc=' `}'
don't substitute `tc1=' `tc2=' `reciproctc='
don't fail when processing tokens followed by `}' chars
2012-03-30 22:56:15 +02:00
h_vogt 0a2e031cb1 bug fix, inp_fix_subckt(): problem when parsing a .subckt line
this worked
  .subckt psub a b p2 = {p1*2-1} p1 = 1
but this failed
  .subckt psub a b p2 = { p1 * 2 - 1 }  p1 = 1

thanks to Ivan Riis Nielsen for the report in Message
  [Ngspice-devel] parsing problem (ngspice-24 tarball)
2012-03-24 18:29:36 +01:00
h_vogt 787a6a3581 inp_fix_subckt(): allow spaces in an expression which acts as a parameter 2012-03-17 16:56:30 +01:00
dwarning 70e9907415 Add reciprocal temperature behaviour for B sources 2012-02-19 12:55:54 +00:00
dwarning d9561123f9 Add temperature coefficients for B sources 2012-02-11 19:45:25 +00:00
h_vogt 1a7fa85e3c reading incs, libs etc. 2012-02-11 13:14:34 +00:00
rlar f285dd0aa8 use strchr() instead of index() 2012-02-06 17:46:33 +00:00
rlar 33764b1f91 cleanup, muffle compiler warning 2012-01-07 14:48:55 +00:00
rlar 29442c91c8 cleanup, muffle compiler warning 2012-01-02 19:43:02 +00:00