Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Mint 構文チェッカー
使い方
mint -a databaseFile -A databaseFile -b libraryDir -d databaseFile -D macroDef -i infoLevel -I includePath -l -o outputFile -q -s -S -t errorNumber -U macroName -w width -x -v file
説明
Mint は Maple プログラムを解析し、Maple のソースファイルにエラーを起こす可能性がある箇所に関するレポートを作成します。ソースファイルが与えられていない場合は、標準入力を使用して Maple のソースステートメントを読み取ります。Mint は Maple とは異なり、quit ステートメントを読み取っても強制終了しません。代わりに、入力の終わりに到達すると強制終了します。
(Windows のみ) wmint.exe プログラムは .mpl ファイルを選択するためのファイルブラウザを開きます。選択されたら、ファイルは解析のために mint に送信されます。プログラムには Windows のスタートメニューからアクセスできます。スタート> すべてのプログラム> Maple 12> Tools> Mint と選択するか、Maple 12 のプログラムファイルが入っている bin.win ディレクトリ下で wmint.exe をダブルクリックすると Mint が起動されます。
オプション
ライブラリ指定のオプション (-b libraryDir) は Mint が指定ディレクトリのライブラリファイル内でのみライブラリルーチンを検索するよう強制します。
-D (Define) オプションは Maple のプリプロセッサマクロを予め定義 ($define 参照) しておくために使用します。-D オプションに続けて指定できるのは記号、または記号、等号、および記号の定義から成る式のいずれかです。複数の -D オプションを使用すると、複数の記号を定義できます。
情報レベルのオプション (-i infoLevel) は作成する情報量を指定します。infoLevel には以下の値を指定できます。
0 Display no information 1 Display only severe errors 2 Display severe and serious errors (default) 3 Display warnings as well as severe and serious errors 4 Give a full report on variable usage as well as displaying errors and warnings
Severe error (深刻なエラー) とは、たとえばループの外にある break ステートメントのような明白なエラーです。Serious error (重大なエラー) とは、たとえば同じ制御変数を使用する 2 つのネストされたループやステートメント直後に配置されているコードなど、ほぼ間違いなくコーディングエラーに由来するエラーです。Warning (警告) とは、たとえば割り当ての途中過程を思わせる方程式のみが記述されているステートメントなどコーディングエラーと思われるエラーを示します。
ファイルに含まれる各プロシージャのレポートが表示されます。どのプロシージャにも含まれないステートメントのための全体レポートはプロシージャのレポートの後に表示されます。あるプロシージャで検出されたエラーの深刻度が指定されている情報レベルより低い場合、そのプロシージャのレポートは作成されません。Mint の終了状態の設定にはすべての場合において、ファイルで検出された一番深刻度が高いエラーが使用されます。終了状態の値には以下のものがあります。
0 No errors or warnings 1 Warnings 2 Serious errors 3 Severe errors
infoLevel が 0 の場合、Mint は出力を作成しませんが検出した一番高い深刻度のエラーを示す終了状態を静かに (何のメッセージも表示せずに) 返します。
infoLevel が 4 の場合、ファイルには与えられた各プロシージャの使用率レポートと全体レポートも含まれます。各使用率レポートにはパラメータ、ローカル変数、グローバル変数、システム定義の名前や連結名の使用法も含まれます。例:
Used as a value Used as a table or list element Used as a call-by-value parameter Used as a call-by-name parameter (a quoted parameter) Called as a function Assigned a procedure Assigned a list Assigned a set Assigned a range Assigned a value as a table or list element Assigned a function value (assigned a value to remember as a function value)
さらに、発生したすべてのエラーメッセージのリストも出力されます。
-I (Include) オプションは $include 命令で指定されたファイルの検索先ディレクトリを指定します。カンマで区切ることにより、複数のディレクトリを指定できます。また、複数の -I オプションを使用してもかまいません。
Windows プラットフォーム専用のオプション (-k) を使用すると、mint は終了前に一旦停止し、以下のメッセージを表示します。 "- Press Enter to quit -".
ライブラリファイルのオプション (-l) は Maple のライブラリソースファイルで一般的に発生する警告およびエラーを抑制します。
下線 (_) で始まるグローバル名は Maple ライブラリ用に予約されているため、これらの使用はレポートされません。
Digits や printlevel などシステム定義の名前への値の割り当てに関する警告はライブラリファイルでは頻繁に発生するため、抑制されます。
ライブラリファイルの目的の 1 つはプロシージャにライブラリファイル名を割り当てることであるため、このオプションはライブラリファイル名の上書きに関するエラーメッセージも抑制します。
出力のオプション (-o fileName) は標準出力の代わりに指定のファイルを Mint のレポートの出力先として指定します。これは、スクリプトの一部や標準出力の概念を持たないプラットフォームで Mint を使用する場合に便利です。
quiet オプション (-q) は起動時に表示される Maple ロゴの表示を抑制します。
スタートアップファイル抑制のオプション (-s) は Mintスタートアップファイルの読み取りなしで実行するよう Mint を強制します。Mint スタートアップファイルは Mint にコマンドラインオプションを指定するために使用できます。このファイルはコマンドラインに入力するのと同じ要領で記述されたコマンドラインオプションまたは引数を含む複数の行で構成されます。Mint は最初にファイルを読み取り、次にコマンドラインをスキャンするため、実際のコマンドラインに入力されている引数は初期化ファイルに記述されている引数を無効にできます。たとえば初期化ファイルに Maple ライブラリプロシージャのデータベースファイル名を入力しておくと、-d オプションを使用しているときに Mint を使用するたびにこれを入力しなくても済むのでとても便利です。
UNIX および Mac OSX 環境では Mint のスタートアップファイルは .mintrc と呼ばれ、Windows 環境では MINT.INI と呼ばれます。
構文のみチェックのオプション (-S) を使用すると、情報レベルの指定を無効にし、構文エラーのメッセージのみを出力することができます。
エラーレポート切り替えのオプション (-t errorNumber) は番号で与えられたエラーのレポートの出力・非出力を切り替えます。エラー番号とエラーメッセージの対応は以下のとおりです。
Severe errors - return code 3 0 "The following statements are not inside any loop:" Indicates that a break or next statement has appeared outside of a loop. 1 "The following statements are not inside any procedure:" Indicates that an error or return statement has appeared outside of a procedure. 2 "These names were declared more than once as a local variable:" Indicates that the same local variable has been declared more than once in a procedure's local statement. 3 "These names appeared more than once in the parameter list:" Indicates that the same parameter has been declared more than once in a procedure's parameter list. 4 "These names were declared as both a local variable and a parameter:" Indicates that a procedure has a parameter and local variable with the same name. 5 "Invalid left hand side of assignment:" Indicates that an invalid expression (e.g. a set, a sum, etc.) appears on the left hand side of an assignment. Serious errors - return code 2 6 "These names were used as the same loop variable for nested loops:" Indicates that an inner loop uses the same loop control variable as an outer loop. 7 "There is unreachable code that will never be executed:" Indicates that a statement occurs immediately after a break, next, return, or error statement. Such a statement can never be reached during the course of execution. 8 "These names were used as iteration control variables for both a $, sum, or product construct and a loop:" Indicates that a construct such as seq, add, or $ uses the same control variable as an enclosing loop. 9 "These names were used as global names but were not declared:" Indicates that a procedure makes use of some global names, but has not declared them as such. 10 "Underscore names are reserved for use in the library. These global names start with _:" Indicates use of a global name beginning with the underscore ("_") character. Such names are reserved for use by Maple's supplied library. 11 "These local variables were never used:" Indicates that the local variables were declared, but never used within the procedure. Removing the declarations can marginally improve performance and reduce memory usage. 12 "These exported variables were never used:" Indicates that the module exports were declared, but never used within the module. Removing the declarations can marginally improve performance and reduce memory usage. 13 "These local variables were used but never assigned a value:" Indicates that a local variable's value was used, but that no value was ever assigned to it, suggesting a coding error. 14 "These local variables were assigned a value but otherwise not used:" Indicates that a value was assigned to a local variable, but that this variable was then never used, suggesting a coding error. 15 "These parameters were never used:" Indicates that the specified parameters of a procedure were never actually referred to by name within the procedure. 16 "These names defined in a macro or alias statement were assigned a value: Indicates that a value that has a macro expansion appears on the right hand side of an assignment, meaning that the object being assigned to is not what it appears to be. 17 "These parameters were also used as macro or alias names:" Indicates that a procedure parameter name conflicts with a macro or alias name. 18 "These local variables were also used as macro or alias names:" Indicates that a procedure's local variable name conflicts with a macro or alias name. 19 "These macro or alias names were expanded to a non-name where a name was needed:" Indicates that a macro or alias that expands to something other than a name has appeared in a context where a name is required. 20 "Possible implied multiplication:" Indicates that an expression such as 2(x+1) has been encountered. In Maple, this means "apply the constant function 2 to the argument x+1", not "multiply 2 by x+1". 21 "Quotes are not needed around these names:" Indicates that a name was written with backquotes (``) when such quotes were redundant. 22 "These local variables were not declared explicitly:" Indicates local variables that were implicitly declared (Maple declares as local any variables that are undeclared, and appear on the left hand side of an assignment or as the control variable of a loop). Warnings - return code 1 23 "The following function calls disagree with number of parameters in the function definition:" Indicates that a function was called with the wrong number of arguments based on the information given in a library database. 24 "These library names were assigned a value:" Indicates that a name appearing in a library database was assigned to. 25 "These system defined names were assigned a value:" 26 "These system defined names were redefined in a macro or alias statement:" Indicates that a system-defined name (e.g. Pi) was assigned to. 27 "These catenated names were used:" Indicates that the concatenation operator (||) was used to create a name. 28 "These parameters or local variables are also system defined names:" Indicates that a parameter or local variable hides a system defined name from use inside a procedure. 29 "These names defined in a macro or alias statement were redefined:" Indicates that a pre-defined macro or alias has been redefined. 30 "Control variable of seq, add, or mul not referenced in body:" Indicates that the body expression of a seq, add, or mul call is not a function of the control variable. 31 "Equations were used as statements on the following lines:" Indicates that an equation (e.g. a=b) occurs by itself as a statement, suggesting that an assignment (a:=b) might have been intended instead. 32 "These parameters were never used explicitly:" Indicates that a named formal parameter of a procedure is never actually used within the body of the procedure.
-U (Undefine) オプションは以前にコマンドラインから -D オプションで定義された Maple のプリプロセッサマクロを未定義 ($undef 参照) にします。-U オプションに続けて未定義にする記号を指定する必要があります。複数の -U オプションを使用すると、複数の記号を未定義にできます。
幅のオプション (-w width) は Mint が作成するレポートにおける行の幅を文字数で指定します。デフォルトは 79 文字です。最低は 40 文字です。
相互参照のオプション (-x) はコードから呼び出されるすべての関数を一覧表示します。
冗長出力のオプション (-v) はコードに含まれるソースファイルなど追加の情報を一覧表示します。
データベースのオプション
プロシージャのデータベースはプロシージャの正しい使用を目的とする、プロシージャの定義に関する情報を含むファイルです。データベースファイルの各行は以下のように構成されています。
name minArgs maxArgs nargsUsed fileName
ここで、name は埋め込み空白なしの合法的な Maple の名前で、minArgs は name に期待される最低引数数、maxArgs は最大引数数を指し、nargsUsed は nargs または関連値の args や _nparams など (nargs のヘルプページ参照) のずれかがプロシージャ本体で使用されている場合は 1、それ以外は 0 の値です。最後のフィールド fileName の指定は任意で、name が定義されているライブラリソースファイルの名前を指します。各行に入力するエントリの書式は自由ですが、エントリ間は空白文字 1 文字以上で区切られている必要があります。minArgs および maxArgs の値は 0 から 999 までの範囲の数字である必要があります。1 つのエントリの maxArgs が 999 の場合、そのプロシージャには引数の上限がないことを示しています。1 つのプロシージャに対して複数のエントリが存在する場合がありますが、その場合、後続のエントリは先のエントリを無効にします。
データベースファイルのオプション (-a databaseFile または -A databaseFile) は指定のデータベースファイルにプロシージャ情報を追加します。入力ファイルに定義されるプロシージャのいずれの定義もデータベースファイルに追加されます。minArgs および maxArgs の値は両方ともプロシージャの定義に使用されている format パラメータの数になります。
-A オプションが指定されていたら、args, nargs, _nparams など (args のヘルプページ参照) を使用してそれらの引数を参照するプロシージャの nargsUsed フィールドはデータベースのエントリにおいて 1 に設定され、そのプロシージャの引数カウンタは確認されなくなります。代わって -a オプションが指定されていたら、そのプロシージャはデータベースに書き込まれず、データベースのフィールド fileName も書き込まれません。
ライブラリデータベースのオプション (-d databaseFile) は指定のライブラリデータベースをプロシージャデータベースとして使用するよう Mint を強制します。これによって Mint は入力ファイルにおけるプロシージャの不正使用を確認できます。複数のライブラリデータベースが指定できます。
参考文献については、readme.txt を参照してください。
参照
debugger, maplemint
Download Help Document