|
File ChangingCfg.html Author McKeeman Copyright © 2007 index Changing the Cfg ObjectPreliminariesType >> help Cfg % one page help for Cfg >> load cfg cfg % fetch the precomputed X Cfg object into variable cfg. >> cfg % see the public fields and methods of Cfg >> cfg.dump() % see some of the information in Cfg
Read about context-free grammars. Typically the file Cfg.m does not have to be changed to make a small change to X. Think twice before you do anything to it. The Input FormatThe "everyday cfg" format was chose primarily to avoid complicated processing of the text of CFGs. Adding a new Class SymbolsSymbols id, integer and real are not reserved words. They represent classes of symbols, with each symbol containing more information (its text). Neither is eof reserved, it is just unprintable. One might want to add yet another such symbol (say string). It will have to be added to the "special" list in Cfg.m. Running the Cfg table builder for xcomThe Cfg module supports two parsing methods; top-down and bottom-up. You will read more about them later. At the moment the concern is that the bottom-up support takes time. If you are not going to use the bottom-up tables (usual case), then you can get the simpler top-down only tables. Try >> makeCfg -noLR X.cfgto check for cfg errors. Usually there will be none. You can look at the results by calling the Cfg method directly
>> help Cfg % for list of flags
>> c = Cfg(xread('X.cfg'), flag), % for the some flag (e.g. '-shiftDump')
>> c % just to see what Cfg makes
When you want to change the MAT file that xcom will access, try
>> makeCfg -saveMat -noLR X.cfg |